Skip to content
Snippets Groups Projects
Commit 4ac92475 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

dev #33379 fix user title

parent adb53b88
Branches
Tags
8 merge requests!1553Master,!1502Master,!1501Stable,!1472Stable,!1409Stable,!1403Dev#33379 redmine create and edit ticket,!1387Dev#33379 redmine create and edit ticket,!1370Dev#33379 redmine create and edit ticket
......@@ -37,11 +37,12 @@ class Admin_RedmineController extends ZendAfi_Controller_Action {
};
$renderUser = function($library_id, $data) {
return $this->view->libraries[$library_id]['user'] = Class_WebService_redmine::extractConnectedUser($data, Class_Users::getIdentity()->getRedmineLibrary());
return $this->view->libraries[$library_id]['user'] = Class_WebService_redmine::extractConnectedUser($data, $this->view->user->getRedmineLibrary());
};
$renderProject = function($library_id, $data) {
return $this->view->libraries[$library_id ]['project'] = Class_WebService_redmine::extractProject($data);
if(!$this->view->project)
return $this->view->project = Class_WebService_redmine::extractProject($data);
};
foreach($libraries as $library) {
......@@ -84,13 +85,15 @@ class Admin_RedmineController extends ZendAfi_Controller_Action {
protected function withResponseDo($library, $data, $call_back) {
$message = $this->view->getHelper('Redmine_AccountStatus')->connectionFail();
$error_message = $this->view->getHelper('Redmine_AccountStatus')->connectionFail();
if(false === $data)
return $message;
return $error_message;
if(isset($data['error_message']) && '' != $data['error_message'])
return $data['error_message'];
if(isset($data['error_message']))
return $data['error_message']
? $data['error_message']
: $error_message;
return call_user_func($call_back, $library->getId(), $data);
}
......
......@@ -26,13 +26,13 @@ class Admin_UsersController extends ZendAfi_Controller_Action {
'name' => 'user',
'order' => 'id'],
'messages' => ['successful_save' => $this->_('Utilisateur "%s" sauvegardé'),
'messages' => ['successful_save' => $this->_('L\'utilisateur "%s" a été sauvegardé'),
'successful_add' => $this->_('L\'utilisateur "%s" a été ajouté'),
'successful_delete' => $this->_('L\'utilisateur "%s" a été supprimée')],
'successful_delete' => $this->_('L\'utilisateur "%s" a été supprimé')],
'actions' => ['add' => ['title' => $this->_("Ajouter un utilisateur")],
'edit' => ['title' => $this->_("Modifier le utilisateur: %s")],
'delete' => ['title' => $this->_("Supprimer le utilisateur: %s")]
'edit' => ['title' => $this->_("Modifier l\'utilisateur: %s")],
'delete' => ['title' => $this->_("Supprimer l\'utilisateur: %s")]
],
'form_class_name' => 'ZendAfi_Form_Admin_User'];
......
<?php
$html = '';
echo $this->getHelper('Redmine_Header')->projectInfo($this->project);
if(!$this->libraries) {
echo $this->Redmine_Header($this->user,null, false, '');
return;
......@@ -9,8 +11,7 @@ if(!$this->libraries) {
foreach($this->libraries as $library_id => $data)
$html .= $this->tag('li', $this->Redmine_Header($this->user,
isset($data['instance']) ? $data['instance'] : null,
isset($data['user']) ? $data['user'] : false,
isset($data['project']) ? $data['project'] : '') .
isset($data['user']) ? $data['user'] : null) .
$this->Redmine_Issues(isset($data['issues']) ? $data['issues'] : []));
echo $this->tag('ul', $html);
......
......@@ -182,5 +182,4 @@ class ZendAfi_Form extends Zend_Form {
return $this->_summary;
}
}
?>
\ No newline at end of file
......@@ -22,7 +22,7 @@
class ZendAfi_View_Helper_Redmine_Header extends ZendAfi_View_Helper_BaseHelper {
public function Redmine_Header($user, $library, $user_info = false, $project_info) {
public function Redmine_Header($user, $library, $user_info) {
if (!Class_AdminVar::isRedmineEnabled() || !$user)
return '';
......@@ -32,9 +32,7 @@ class ZendAfi_View_Helper_Redmine_Header extends ZendAfi_View_Helper_BaseHelper
if((!$user->getRedmineLibrary()) || (!$library))
return $this->shouldSelectLib($user);
return $this->view->tag('p', $this->projectInfo($project_info) .
BR .
$this->connectedThrough($user, $library, $user_info));
return $this->view->tag('p', $this->connectedThrough($user, $library, $user_info));
}
......@@ -75,7 +73,7 @@ class ZendAfi_View_Helper_Redmine_Header extends ZendAfi_View_Helper_BaseHelper
}
protected function projectInfo($name) {
public function projectInfo($name) {
return $this->_('Projet sélectionné : ') . $this->anchorEditProject($name);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment