Skip to content
Snippets Groups Projects
Commit 4d11cd33 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

Merge branch 'hotline_#29103_translate_portail' into 'stable'

Hotline #29103 translate portail

See merge request !1061
parents 4632a33b af1ee60b
Branches
Tags
No related merge requests found
- ticket #29103 : Le terme 'Portail' est maintenant traductible et peut être remplacé via la variable TEXT_REPLACEMENTS
\ No newline at end of file
......@@ -36,7 +36,7 @@ echo $this->ligneInfos($this->traduire("Utilisateur"), $this->user->getLogin());
echo $this->ligneInfos("Pseudo", $this->user->getNomAff());
echo $this->ligneInfos("Rôle", $acl->getLibelleRole($this->user->getRoleLevel()));
$bib = $this->user->getBib();
$bib = (!$bib) ? 'Portail' : $bib->getLibelle();
$bib = (!$bib) ? $this->_('Portail') : $bib->getLibelle();
echo $this->ligneInfos("Bibliothèque", $bib);
?>
......
<?php
<?php
echo $this->profileSelect('users',$this->id_zone,$this->id_bib,'zb',0,true,true,true);
......@@ -23,7 +23,7 @@ else
<tr>
<td colspan="10" class="separ"></td>
</tr>
<?php
<?php
$acl = new ZendAfi_Acl_AdminControllerRoles();
......@@ -31,8 +31,8 @@ $ligne=0;
foreach($this->users as $user)
{
$ligne ++ ;
if ($ligne & 1) $class="first"; else $class="second";
if ($user["ID_SITE"] =="0") $nom_bib="Portail";
if ($ligne & 1) $class="first"; else $class="second";
if ($user["ID_SITE"] =="0") $nom_bib = $this->_('Portail');
else $nom_bib=fetchOne("select nom_court from int_bib where id_bib=".$user["ID_SITE"]);
if (strlen($user["LOGIN"])>=15) $login= substr($user["LOGIN"],0,15).'...'; else $login=$user["LOGIN"];
if (strlen($nom_bib)>=40) $nom_bib_r= substr($nom_bib,0,40).'...'; else $nom_bib_r=$nom_bib;
......@@ -45,11 +45,11 @@ foreach($this->users as $user)
if (Class_Users::getIdentity()->isAdmin()) {
echo('<a href="'.BASE_URL.'/admin/users/edit/id/'.$user["ID_USER"].'">'.$this->boutonIco("type=edit").'</a>&nbsp;&nbsp; <a href="'.BASE_URL.'/admin/users/delete/id/'.$user["ID_USER"].'">');
if ($user["ID_USER"] != '1') echo $this->boutonIco("type=del");
echo('</a>');
}
echo('</td></tr>');
}
echo ('</table>');
echo BR.'<div align="center" style="width:100%">'.$this->pager($this->nombre,$this->nb_par_page,$this->page,$this->url).'</div>';
......
......@@ -8,8 +8,8 @@
// Nom de la ville
if ($bib = $article->getBib())
$ville = $bib->getVille();
else
$ville = "Portail";
else
$ville = $this->_('Portail');
if (!array_key_exists($ville, $news_bib))
$news_bib[$ville] = array();
......@@ -28,4 +28,4 @@
}
echo('</ul>');
}
}?>
\ No newline at end of file
}?>
......@@ -32,6 +32,9 @@ class BibCSite extends Zend_Db_Table_Abstract {
class BibLoader extends Storm_Model_Loader {
use Trait_Translator;
protected $_portail;
public function findAllWithPortail() {
......@@ -68,7 +71,7 @@ class BibLoader extends Storm_Model_Loader {
public function getPortail() {
if (!isset($this->_portail))
$this->_portail = $this->newInstanceWithId(0)->setLibelle('Portail');
$this->_portail = $this->newInstanceWithId(0)->setLibelle($this->_('Portail'));
return $this->_portail;
}
......
......@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
////////////////////////////////////////////////////////////////////////////////
// OPAC3 : FILTRE DE SELECTION : ZONE / BIBLIOTHEQUE / PROFIL
......@@ -25,13 +25,13 @@
// b -> rend combo bib
// p -> rend combo profil
////////////////////////////////////////////////////////////////////////////////
class ZendAfi_View_Helper_Admin_ProfileSelect extends ZendAfi_View_Helper_BaseHelper
{
public $user; // User identifié
//-----------------------------------------------------------------------------------------------
// Main routine
// Main routine
//-----------------------------------------------------------------------------------------------
public function profileSelect($url,$id_zone=0, $id_bib=0,$combo="zb", $id_profil=0,$portail=false,$all=true,$champ_nom=false)
{
......@@ -39,7 +39,7 @@ class ZendAfi_View_Helper_Admin_ProfileSelect extends ZendAfi_View_Helper_BaseHe
if($id_profil) $titre.=$this->translate()->_(" et profil");
$this->user = ZendAfi_Auth::getInstance()->getIdentity();
$html = '<div class="form" style="font-size:10pt">'.$titre.'<br/><table cellpadding="3" cellspacing="1" border="0">';
// Combo des zones
if(preg_match("^z^",$combo))
{
......@@ -48,7 +48,7 @@ class ZendAfi_View_Helper_Admin_ProfileSelect extends ZendAfi_View_Helper_BaseHe
<td>'.$this->getZoneSelect($id_zone,$portail,$all,$url).'</td>
</tr>';
}
// Combo des bibliotheques
if(preg_match("^b^",$combo))
{
......@@ -57,7 +57,7 @@ class ZendAfi_View_Helper_Admin_ProfileSelect extends ZendAfi_View_Helper_BaseHe
<td>'.$this->getBibSelect($id_zone,$id_bib,$portail,$all,$url).'</td>
</tr>';
}
// Combo des profils
if(preg_match("^p^",$combo))
{
......@@ -67,7 +67,7 @@ class ZendAfi_View_Helper_Admin_ProfileSelect extends ZendAfi_View_Helper_BaseHe
</tr>';
}
$html.='</table>';
// Recherche d'abonnés
if($champ_nom==true)
{
......@@ -76,9 +76,9 @@ class ZendAfi_View_Helper_Admin_ProfileSelect extends ZendAfi_View_Helper_BaseHe
$html.='<table cellpadding="3" cellspacing="1" border="0">';
$rech_user = isset($_SESSION["admin"]["rech_user"]) ? $_SESSION["admin"]["rech_user"] : array('role' => 0, 'login' => '', 'nom' => '');
$cls=new ZendAfi_Acl_AdminControllerRoles();
$combo_roles= Class_Users::getIdentity()->isAdmin() ? $cls->rendCombo($rech_user["role"],$this->user->ROLE_LEVEL,true) : $cls->rendCombo('2','2',false);
$combo_roles= Class_Users::getIdentity()->isAdmin() ? $cls->rendCombo($rech_user["role"],$this->user->ROLE_LEVEL,true) : $cls->rendCombo('2','2',false);
$html.='
<tr>
......@@ -101,7 +101,7 @@ class ZendAfi_View_Helper_Admin_ProfileSelect extends ZendAfi_View_Helper_BaseHe
</table>
</form>';
}
$html.='</div>';
return $html;
}
......@@ -114,22 +114,22 @@ class ZendAfi_View_Helper_Admin_ProfileSelect extends ZendAfi_View_Helper_BaseHe
$class_zone = new Class_Zone();
$zone_array = $class_zone->getAllZone();
$redirect = "location='".BASE_URL."/admin/".$url."?z='+ this.value + '&amp;b=ALL'";
// Si l'user est minimum modo_portail
if ($this->user->ROLE_LEVEL > 4)
{
$html[]='<select name="zone" id="zone" onchange="'.$redirect.'">';
if($all == true) $html[]='<option value="ALL" >** tous **</option>';
if($portail == true)
if($portail == true)
{
if($id_zone_selected=="PORTAIL" or !$id_zone_selected) $sel = ' selected="selected"'; else $sel = "";
$html[]='<option value="PORTAIL"'.$sel.'>Portail</option>';
$html[]='<option value="PORTAIL"'.$sel.'>' . $this->_('Portail') . '</option>';
}
}
// Si l'user est admin_bib
else $html[]='<select name="zone" id="zone" disabled="disabled">';
foreach ($zone_array as $zone) {
if($id_zone_selected == $zone->ID_ZONE and $id_zone_selected !="PORTAIL") $sel = 'selected="selected"'; else $sel="";
......@@ -149,7 +149,7 @@ class ZendAfi_View_Helper_Admin_ProfileSelect extends ZendAfi_View_Helper_BaseHe
$html[]='</select>';
return (implode('',$html));
}
//----------------------------------------------------------------------------------
// Combo des bibliotheques
//----------------------------------------------------------------------------------
......@@ -158,23 +158,23 @@ class ZendAfi_View_Helper_Admin_ProfileSelect extends ZendAfi_View_Helper_BaseHe
$class_bib = new Class_Bib();
$bib_array = $class_bib->getBibs($id_zone);
$redirect = "location='".BASE_URL."/admin/".$url."?z=".$id_zone."&amp;b='+ this.value";
if ($this->user->ROLE_LEVEL > 4) // Si l'user est minimum modo_portail
{
$html[]='<select name="bib" id="bib" onchange="'.$redirect.'">';
if($id_zone != "PORTAIL")
{
{
if($id_bib == "ALL") $sel = 'selected="selected"'; else $sel="";
if($all == true) $html[]='<option value="ALL" '.$sel.'>** '.$this->translate()->_('toutes').' **</option>';
}
if($portail == true and (!$id_zone or $id_zone=="PORTAIL" or $id_zone=="ALL"))
if($portail == true and (!$id_zone or $id_zone=="PORTAIL" or $id_zone=="ALL"))
{
if($id_bib == "PORTAIL") $sel = 'selected="selected"'; else $sel="";
$html[]='<option value="PORTAIL" '.$sel.'>'.$this->translate()->_('Portail').'</option>';
}
}
else $html[]='<select name="bib" id="bib" style="width:100%" disabled="disabled">';
if($bib_array)
{
foreach ($bib_array as $bib)
......@@ -194,7 +194,7 @@ class ZendAfi_View_Helper_Admin_ProfileSelect extends ZendAfi_View_Helper_BaseHe
$html[]='</select>';
return implode('',$html);
}
//----------------------------------------------------------------------------------
// Combo des profils
//----------------------------------------------------------------------------------
......@@ -205,8 +205,8 @@ class ZendAfi_View_Helper_Admin_ProfileSelect extends ZendAfi_View_Helper_BaseHe
$html[]='<select name="id_profil" id="id_profil" onchange="'.$redirect.'">';
foreach ($profil_array as $profil) {
if ($id_profil == $profil->getId())
$selected='selected="selected"';
else
$selected='selected="selected"';
else
$selected='';
$html[]='<option value="'.$profil->getId().'" '.$selected.'>'.$profil->getLibelle().'</option>';
}
......
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