Label translations added

Label translations added
This commit is contained in:
norahmollo
2013-07-15 17:30:59 -04:00
parent c8fc67ca73
commit b30bd75a1d
4 changed files with 28 additions and 15 deletions

View File

@@ -237,34 +237,34 @@ class dashletOpenVSCompleted implements DashletInterface
$this->completed = $casesCompleted + $casesTodo; $this->completed = $casesCompleted + $casesTodo;
switch ($config['DAS_INS_CONTEXT_TIME']) { switch ($config['DAS_INS_CONTEXT_TIME']) {
case 'TODAY': case 'TODAY':
$this->centerLabel = 'Today'; $this->centerLabel = G::LoadTranslation('ID_TODAY');
break; break;
case 'YESTERDAY': case 'YESTERDAY':
$this->centerLabel = 'Yesterday'; $this->centerLabel = G::LoadTranslation('ID_YESTERDAY');
break; break;
case 'THIS_WEEK': case 'THIS_WEEK':
$this->centerLabel = 'This week'; $this->centerLabel = G::LoadTranslation('ID_THIS_WEEK');
break; break;
case 'PREVIOUS_WEEK': case 'PREVIOUS_WEEK':
$this->centerLabel = 'Previous week'; $this->centerLabel = G::LoadTranslation('ID_PREVIOUS_WEEK');
break; break;
case 'THIS_MONTH': case 'THIS_MONTH':
$this->centerLabel = 'This month'; $this->centerLabel = G::LoadTranslation('ID_THIS_MONTH');
break; break;
case 'PREVIOUS_MONTH': case 'PREVIOUS_MONTH':
$this->centerLabel = 'Previous month'; $this->centerLabel = G::LoadTranslation('ID_PREVIOUS_MONTH');
break; break;
case 'THIS_QUARTER': case 'THIS_QUARTER':
$this->centerLabel = 'This quarter'; $this->centerLabel = G::LoadTranslation('ID_THIS_QUARTER');
break; break;
case 'PREVIOUS_QUARTER': case 'PREVIOUS_QUARTER':
$this->centerLabel = 'Previous quarter'; $this->centerLabel = G::LoadTranslation('ID_PREVIOUS_QUARTER');
break; break;
case 'THIS_YEAR': case 'THIS_YEAR':
$this->centerLabel = 'This year'; $this->centerLabel = G::LoadTranslation('ID_THIS_YEAR');
break; break;
case 'PREVIOUS_YEAR': case 'PREVIOUS_YEAR':
$this->centerLabel = 'Previous year'; $this->centerLabel = G::LoadTranslation('ID_PREVIOUS_YEAR');
break; break;
default: default:
$this->centerLabel = ''; $this->centerLabel = '';

View File

@@ -33,6 +33,7 @@ class PMDashlet extends DashletInstance implements DashletInterface
{ {
try { try {
$this->dashletInstance = $this->loadDashletInstance( $dasInsUid ); $this->dashletInstance = $this->loadDashletInstance( $dasInsUid );
if (! isset( $this->dashletInstance['DAS_CLASS'] )) { if (! isset( $this->dashletInstance['DAS_CLASS'] )) {
throw new Exception( G::LoadTranslation( 'ID_ERROR_OBJECT_NOT_EXISTS' ) . ' - Probably the plugin related is disabled' ); throw new Exception( G::LoadTranslation( 'ID_ERROR_OBJECT_NOT_EXISTS' ) . ' - Probably the plugin related is disabled' );
} }
@@ -78,7 +79,7 @@ class PMDashlet extends DashletInstance implements DashletInterface
public function getDashletsInstances ($start = null, $limit = null) public function getDashletsInstances ($start = null, $limit = null)
{ {
try { try {
$dashletsInstances = array (); $dashletsInstances = array ();
$criteria = new Criteria( 'workflow' ); $criteria = new Criteria( 'workflow' );
@@ -96,6 +97,9 @@ class PMDashlet extends DashletInstance implements DashletInterface
while ($row = $dataset->getRow()) { while ($row = $dataset->getRow()) {
$arrayField = unserialize( $row["DAS_INS_ADDITIONAL_PROPERTIES"] ); $arrayField = unserialize( $row["DAS_INS_ADDITIONAL_PROPERTIES"] );
if (strstr($row['DAS_TITLE'], '*')) {
$row['DAS_TITLE'] = G::LoadTranslationPlugin('advancedDashboards', str_replace("*","",$row['DAS_TITLE']));
}//G::pr($row['DAS_TITLE']);
$row['DAS_INS_STATUS_LABEL'] = ($row['DAS_INS_STATUS'] == '1' ? G::LoadTranslation( 'ID_ACTIVE' ) : G::LoadTranslation( 'ID_INACTIVE' )); $row['DAS_INS_STATUS_LABEL'] = ($row['DAS_INS_STATUS'] == '1' ? G::LoadTranslation( 'ID_ACTIVE' ) : G::LoadTranslation( 'ID_INACTIVE' ));
$row['DAS_INS_TITLE'] = (isset( $arrayField['DAS_INS_TITLE'] ) && ! empty( $arrayField['DAS_INS_TITLE'] )) ? $arrayField['DAS_INS_TITLE'] : ''; $row['DAS_INS_TITLE'] = (isset( $arrayField['DAS_INS_TITLE'] ) && ! empty( $arrayField['DAS_INS_TITLE'] )) ? $arrayField['DAS_INS_TITLE'] : '';
if (! class_exists( $row['DAS_CLASS'] )) { if (! class_exists( $row['DAS_CLASS'] )) {
@@ -154,6 +158,7 @@ class PMDashlet extends DashletInstance implements DashletInterface
} }
$dataset->next(); $dataset->next();
} }
return $dashletsInstances; return $dashletsInstances;
} catch (Exception $error) { } catch (Exception $error) {
throw $error; throw $error;

View File

@@ -147,7 +147,7 @@ class Dashboard extends Controller
} }
public function renderDashletInstance ($data) public function renderDashletInstance ($data)
{ {
try { try {
if (! isset( $data->DAS_INS_UID )) { if (! isset( $data->DAS_INS_UID )) {
$data->DAS_INS_UID = ''; $data->DAS_INS_UID = '';
@@ -163,6 +163,7 @@ class Dashboard extends Controller
$width = $_REQUEST['w']; $width = $_REQUEST['w'];
} }
$this->pmDashlet->render( $width ); $this->pmDashlet->render( $width );
//G::pr($this->pmDashlet->setup( $width ));die;
} catch (Exception $error) { } catch (Exception $error) {
//ToDo: Show the error message //ToDo: Show the error message
echo $error->getMessage(); echo $error->getMessage();
@@ -203,7 +204,7 @@ class Dashboard extends Controller
} }
public function getDashletsInstances ($data) public function getDashletsInstances ($data)
{ {
$this->setResponseType( 'json' ); $this->setResponseType( 'json' );
$result = new stdclass(); $result = new stdclass();
$result->status = 'OK'; $result->status = 'OK';
@@ -226,7 +227,7 @@ class Dashboard extends Controller
public function dashletInstanceForm ($data) public function dashletInstanceForm ($data)
{ {
try { try {
$this->includeExtJS( 'dashboard/dashletInstanceForm', false ); $this->includeExtJS( 'dashboard/dashletInstanceForm', true, true );
$this->setView( 'dashboard/dashletInstanceForm' ); $this->setView( 'dashboard/dashletInstanceForm' );
if (! isset( $data->DAS_INS_UID )) { if (! isset( $data->DAS_INS_UID )) {
$data->DAS_INS_UID = ''; $data->DAS_INS_UID = '';
@@ -434,8 +435,14 @@ class Dashboard extends Controller
$dataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $dataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$dataset->next(); $dataset->next();
while ($row = $dataset->getRow()) { while ($row = $dataset->getRow()) {
if (strstr($row['DAS_TITLE'], '_')) {
$row['DAS_TITLE'] = str_replace('*', '', $row['DAS_TITLE']);
$row['DAS_TITLE'] = G::LoadTranslationPlugin('advancedDashboards', $row['DAS_TITLE']);
}
if ($this->pmDashlet->verifyPluginDashlet($row['DAS_CLASS'])) { if ($this->pmDashlet->verifyPluginDashlet($row['DAS_CLASS'])) {
$dashlets[] = array ($row['DAS_UID'],$row['DAS_TITLE']); $dashlets[] = array ($row['DAS_UID'],$row['DAS_TITLE']);
} }
$dataset->next(); $dataset->next();
} }
@@ -443,6 +450,7 @@ class Dashboard extends Controller
} catch (Exception $error) { } catch (Exception $error) {
throw $error; throw $error;
} }
//G::pr($dashlets);die;
return $dashlets; return $dashlets;
} }

View File

@@ -173,7 +173,7 @@ Ext.onReady(function(){
columns: [ columns: [
{id:'DAS_INS_UID', dataIndex: 'DAS_INS_UID', hidden:true, hideable:false}, {id:'DAS_INS_UID', dataIndex: 'DAS_INS_UID', hidden:true, hideable:false},
{header: _("ID_TITLE"), dataIndex: "DAS_INS_TITLE", width: 150, hidden: false, align: "left"}, {header: _("ID_TITLE"), dataIndex: "DAS_INS_TITLE", width: 150, hidden: false, align: "left"},
{header: "Dashlet", dataIndex: "DAS_TITLE", width: 200, hidden: false, align: "left"}, {header: _("ID_DASHLET"), dataIndex: "DAS_TITLE", width: 200, hidden: false, align: "left"},
{header: _('ID_VERSION'), dataIndex: 'DAS_VERSION', width: 60, hidden: false, align: 'center'}, {header: _('ID_VERSION'), dataIndex: 'DAS_VERSION', width: 60, hidden: false, align: 'center'},
{header: _('ID_ASSIGNED_TO'), dataIndex: 'DAS_INS_OWNER_TITLE', width: 200, hidden: false, align: 'center'}, {header: _('ID_ASSIGNED_TO'), dataIndex: 'DAS_INS_OWNER_TITLE', width: 200, hidden: false, align: 'center'},
{header: _('ID_UPDATE_DATE'), dataIndex: 'DAS_INS_UPDATE_DATE', width: 80, hidden: false, align: 'center'}, {header: _('ID_UPDATE_DATE'), dataIndex: 'DAS_INS_UPDATE_DATE', width: 80, hidden: false, align: 'center'},