BUG 000 Add property "version" in the dashlet class template
This commit is contained in:
@@ -7,19 +7,21 @@ require_once ("classes/interfaces/dashletInterface.php");
|
|||||||
|
|
||||||
class dashlet{className} implements DashletInterface
|
class dashlet{className} implements DashletInterface
|
||||||
{
|
{
|
||||||
|
const version = '1.0';
|
||||||
|
|
||||||
private $role;
|
private $role;
|
||||||
private $note;
|
private $note;
|
||||||
|
|
||||||
public static function getAdditionalFields($className)
|
public static function getAdditionalFields($className)
|
||||||
{
|
{
|
||||||
$additionalFields = array();
|
$additionalFields = array();
|
||||||
|
|
||||||
///////
|
///////
|
||||||
$cnn = Propel::getConnection("rbac");
|
$cnn = Propel::getConnection("rbac");
|
||||||
$stmt = $cnn->createStatement();
|
$stmt = $cnn->createStatement();
|
||||||
|
|
||||||
$arrayRole = array();
|
$arrayRole = array();
|
||||||
|
|
||||||
$sql = "SELECT ROL_CODE
|
$sql = "SELECT ROL_CODE
|
||||||
FROM ROLES
|
FROM ROLES
|
||||||
WHERE ROL_SYSTEM = '00000000000000000000000000000002' AND ROL_STATUS = 1
|
WHERE ROL_SYSTEM = '00000000000000000000000000000002' AND ROL_STATUS = 1
|
||||||
@@ -27,10 +29,10 @@ class dashlet{className} implements DashletInterface
|
|||||||
$rsSQL = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
|
$rsSQL = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
|
||||||
while ($rsSQL->next()) {
|
while ($rsSQL->next()) {
|
||||||
$row = $rsSQL->getRow();
|
$row = $rsSQL->getRow();
|
||||||
|
|
||||||
$arrayRole[] = array($row["ROL_CODE"], $row["ROL_CODE"]);
|
$arrayRole[] = array($row["ROL_CODE"], $row["ROL_CODE"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
///////
|
///////
|
||||||
$storeRole = new stdclass();
|
$storeRole = new stdclass();
|
||||||
$storeRole->xtype = "arraystore";
|
$storeRole->xtype = "arraystore";
|
||||||
@@ -55,7 +57,7 @@ class dashlet{className} implements DashletInterface
|
|||||||
$cboRole->width = 320;
|
$cboRole->width = 320;
|
||||||
$cboRole->fieldLabel = "Role";
|
$cboRole->fieldLabel = "Role";
|
||||||
$additionalFields[] = $cboRole;
|
$additionalFields[] = $cboRole;
|
||||||
|
|
||||||
///////
|
///////
|
||||||
$txtNote = new stdclass();
|
$txtNote = new stdclass();
|
||||||
$txtNote->xtype = "textfield";
|
$txtNote->xtype = "textfield";
|
||||||
@@ -84,9 +86,9 @@ class dashlet{className} implements DashletInterface
|
|||||||
{
|
{
|
||||||
$cnn = Propel::getConnection("workflow");
|
$cnn = Propel::getConnection("workflow");
|
||||||
$stmt = $cnn->createStatement();
|
$stmt = $cnn->createStatement();
|
||||||
|
|
||||||
$arrayUser = array();
|
$arrayUser = array();
|
||||||
|
|
||||||
$sql = "SELECT USR.USR_USERNAME, USR.USR_FIRSTNAME, USR.USR_LASTNAME, USR.USR_STATUS
|
$sql = "SELECT USR.USR_USERNAME, USR.USR_FIRSTNAME, USR.USR_LASTNAME, USR.USR_STATUS
|
||||||
FROM USERS AS USR
|
FROM USERS AS USR
|
||||||
WHERE USR.USR_ROLE = '" . $this->role . "'
|
WHERE USR.USR_ROLE = '" . $this->role . "'
|
||||||
@@ -94,10 +96,10 @@ class dashlet{className} implements DashletInterface
|
|||||||
$rsSQL = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
|
$rsSQL = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
|
||||||
while ($rsSQL->next()) {
|
while ($rsSQL->next()) {
|
||||||
$row = $rsSQL->getRow();
|
$row = $rsSQL->getRow();
|
||||||
|
|
||||||
$arrayUser[] = array("userName" => $row["USR_USERNAME"], "fullName" => $row["USR_FIRSTNAME"] . " " . $row["USR_LASTNAME"], "status" => $row["USR_STATUS"]);
|
$arrayUser[] = array("userName" => $row["USR_USERNAME"], "fullName" => $row["USR_FIRSTNAME"] . " " . $row["USR_LASTNAME"], "status" => $row["USR_STATUS"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
///////
|
///////
|
||||||
$dashletView = new dashlet{className}View($arrayUser, $this->note);
|
$dashletView = new dashlet{className}View($arrayUser, $this->note);
|
||||||
$dashletView->templatePrint();
|
$dashletView->templatePrint();
|
||||||
@@ -111,7 +113,7 @@ class dashlet{className} implements DashletInterface
|
|||||||
class dashlet{className}View extends Smarty
|
class dashlet{className}View extends Smarty
|
||||||
{
|
{
|
||||||
private $smarty;
|
private $smarty;
|
||||||
|
|
||||||
private $user;
|
private $user;
|
||||||
private $note;
|
private $note;
|
||||||
|
|
||||||
@@ -119,7 +121,7 @@ class dashlet{className}View extends Smarty
|
|||||||
{
|
{
|
||||||
$this->user = $u;
|
$this->user = $u;
|
||||||
$this->note = $n;
|
$this->note = $n;
|
||||||
|
|
||||||
$this->smarty = new Smarty();
|
$this->smarty = new Smarty();
|
||||||
$this->smarty->compile_dir = PATH_SMARTY_C;
|
$this->smarty->compile_dir = PATH_SMARTY_C;
|
||||||
$this->smarty->cache_dir = PATH_SMARTY_CACHE;
|
$this->smarty->cache_dir = PATH_SMARTY_CACHE;
|
||||||
@@ -132,7 +134,7 @@ class dashlet{className}View extends Smarty
|
|||||||
{
|
{
|
||||||
$this->smarty->assign("user", $this->user);
|
$this->smarty->assign("user", $this->user);
|
||||||
$this->smarty->assign("note", $this->note);
|
$this->smarty->assign("note", $this->note);
|
||||||
|
|
||||||
return ($this->smarty->fetch($this->smarty->templateFile));
|
return ($this->smarty->fetch($this->smarty->templateFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user