Merge pull request #1898 from norahmollo/master

Translations added - Modified
This commit is contained in:
julceslauhub
2013-07-17 11:18:07 -07:00
4 changed files with 27 additions and 15 deletions

View File

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

View File

@@ -33,6 +33,7 @@ class PMDashlet extends DashletInstance implements DashletInterface
{
try {
$this->dashletInstance = $this->loadDashletInstance( $dasInsUid );
if (! isset( $this->dashletInstance['DAS_CLASS'] )) {
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)
{
{
try {
$dashletsInstances = array ();
$criteria = new Criteria( 'workflow' );
@@ -96,6 +97,9 @@ class PMDashlet extends DashletInstance implements DashletInterface
while ($row = $dataset->getRow()) {
$arrayField = unserialize( $row["DAS_INS_ADDITIONAL_PROPERTIES"] );
if (strstr($row['DAS_TITLE'], '*')) {
$row['DAS_TITLE'] = G::LoadTranslationPlugin('advancedDashboards', str_replace("*","",$row['DAS_TITLE']));
}
$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'] : '';
if (! class_exists( $row['DAS_CLASS'] )) {
@@ -154,6 +158,7 @@ class PMDashlet extends DashletInstance implements DashletInterface
}
$dataset->next();
}
return $dashletsInstances;
} catch (Exception $error) {
throw $error;

View File

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

View File

@@ -173,7 +173,7 @@ Ext.onReady(function(){
columns: [
{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: "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_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'},