Fix translation

Fix permission not managed into get_menudiv.php
This commit is contained in:
Laurent Destailleur 2015-03-24 11:19:51 +01:00
parent dc0d3504dd
commit f75c115140
6 changed files with 91 additions and 46 deletions

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This file is a modified version of datepicker.php from phpBSM to fix some * This file is a modified version of datepicker.php from phpBSM to fix some
* bugs, to add new features and to dramatically increase speed. * bugs, to add new features and to dramatically increase speed.

View File

@ -218,18 +218,42 @@ class MenuManager
} }
foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu' foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
{ {
$relurl2=dol_buildpath($val2['url'],1); $showmenu=true;
$relurl2=preg_replace('/__LOGIN__/',$user->login,$relurl2); if (! empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) && empty($val2['enabled'])) $showmenu=false;
$relurl2=preg_replace('/__USERID__/',$user->id,$relurl2);
$canonurl2=preg_replace('/\?.*$/','',$val2['url']); if ($showmenu) // Visible (option to hide when not allowed is off or allowed)
//var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']); {
if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2=''; $relurl2=dol_buildpath($val2['url'],1);
if ($val2['level']==0) print str_pad('',$val2['level']+1).'<li'.($val2['level']==0?' data-role="list-dividerxxx"':'').' class="lilevel'.($val2['level']+1).' ui-btn-icon-right ui-btn">'; // ui-btn to highlight on clic $relurl2=preg_replace('/__LOGIN__/',$user->login,$relurl2);
else print str_pad('',$val2['level']+1).'<li class="lilevel'.($val2['level']+1).'">'; // ui-btn to highlight on clic $relurl2=preg_replace('/__USERID__/',$user->id,$relurl2);
if ($relurl2) print '<a href="'.$relurl2.'">'; $canonurl2=preg_replace('/\?.*$/','',$val2['url']);
print $val2['titre']; //var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']);
if ($relurl2) print '</a>'; if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2='';
print '</li>'."\n"; if ($val2['level']==0) print str_pad('',$val2['level']+1).'<li'.($val2['level']==0?' data-role="list-dividerxxx"':'').' class="lilevel'.($val2['level']+1).' ui-btn-icon-right ui-btn">'; // ui-btn to highlight on clic
else print str_pad('',$val2['level']+1).'<li class="lilevel'.($val2['level']+1).'">'; // ui-btn to highlight on clic
if ($relurl2)
{
if ($val2['enabled']) // Allowed
{
print '<a href="'.$relurl2.'"';
//print ' data-ajax="false"';
print '>';
}
else // Not allowed but visible (greyed)
{
print '<a href="#" class="vsmenudisabled">';
}
}
print $val2['titre'];
if ($relurl2)
{
if ($val2['enabled']) // Allowed
print '</a>';
else
print '</a>';
}
print '</li>'."\n";
}
} }
//var_dump($submenu); //var_dump($submenu);
print '</ul>'; print '</ul>';

View File

@ -150,6 +150,7 @@ class MenuManager
{ {
print '<ul class="ulmenu" data-role="listview" data-inset="true">'; print '<ul class="ulmenu" data-role="listview" data-inset="true">';
print '<li data-role="list-dividerxxx" class="lilevel0">'; print '<li data-role="list-dividerxxx" class="lilevel0">';
if ($val['enabled'] == 1) if ($val['enabled'] == 1)
{ {
$relurl=dol_buildpath($val['url'],1); $relurl=dol_buildpath($val['url'],1);
@ -184,23 +185,42 @@ class MenuManager
} }
foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'] foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu']
{ {
$relurl2=dol_buildpath($val2['url'],1); $showmenu=true;
$relurl2=preg_replace('/__LOGIN__/',$user->login,$relurl2); if (! empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) && empty($val2['enabled'])) $showmenu=false;
$relurl2=preg_replace('/__USERID__/',$user->id,$relurl2);
$canonurl2=preg_replace('/\?.*$/','',$val2['url']); if ($showmenu) // Visible (option to hide when not allowed is off or allowed)
//var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']); {
if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2=''; $relurl2=dol_buildpath($val2['url'],1);
if ($val2['level']==0) print str_pad('',$val2['level']+1).'<li'.($val2['level']==0?' data-role="list-dividerxxx"':'').' class="lilevel'.($val2['level']+1).' ui-btn-icon-right ui-btn">'; // ui-btn to highlight on clic $relurl2=preg_replace('/__LOGIN__/',$user->login,$relurl2);
else print str_pad('',$val2['level']+1).'<li class="lilevel'.($val2['level']+1).'">'; // ui-btn to highlight on clic $relurl2=preg_replace('/__USERID__/',$user->id,$relurl2);
if ($relurl2) $canonurl2=preg_replace('/\?.*$/','',$val2['url']);
{ //var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']);
print '<a href="'.$relurl2.'"'; if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2='';
//print ' data-ajax="false"'; if ($val2['level']==0) print str_pad('',$val2['level']+1).'<li'.($val2['level']==0?' data-role="list-dividerxxx"':'').' class="lilevel'.($val2['level']+1).' ui-btn-icon-right ui-btn">'; // ui-btn to highlight on clic
print '>'; else print str_pad('',$val2['level']+1).'<li class="lilevel'.($val2['level']+1).'">'; // ui-btn to highlight on clic
} if ($relurl2)
print $val2['titre']; {
if ($relurl2) print '</a>'; if ($val2['enabled']) // Allowed
print '</li>'."\n"; {
print '<a href="'.$relurl2.'"';
//print ' data-ajax="false"';
print '>';
}
else // Not allowed but visible (greyed)
{
print '<a href="#" class="vsmenudisabled">';
}
}
print $val2['titre'];
if ($relurl2)
{
if ($val2['enabled']) // Allowed
print '</a>';
else
print '</a>';
}
print '</li>'."\n";
}
} }
//var_dump($submenu); //var_dump($submenu);
print '</ul>'; print '</ul>';

View File

@ -100,7 +100,7 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex
if ($result < 0) { if ($result < 0) {
setEventMessage($object->error,'errors'); setEventMessage($object->error,'errors');
} }
else else
{ {
$res = $object->reprogram_jobs($user->login); $res = $object->reprogram_jobs($user->login);
if ($res > 0) if ($res > 0)
@ -314,11 +314,11 @@ print "\n<div class=\"tabsAction\">\n";
if (! $user->rights->cron->create) if (! $user->rights->cron->create)
{ {
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("New").'</a>'; print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("CronCreateJob").'</a>';
} }
else else
{ {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/cron/card.php?action=create">'.$langs->trans("New").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/cron/card.php?action=create">'.$langs->trans("CronCreateJob").'</a>';
} }
print '</div>'; print '</div>';

View File

@ -497,7 +497,7 @@ Module1780Desc=Category management (products, suppliers and customers)
Module2000Name=WYSIWYG editor Module2000Name=WYSIWYG editor
Module2000Desc=Allow to edit some text area using an advanced editor Module2000Desc=Allow to edit some text area using an advanced editor
Module2300Name=Cron Module2300Name=Cron
Module2300Desc=Scheduled task management Module2300Desc=Scheduled job management
Module2400Name=Agenda Module2400Name=Agenda
Module2400Desc=Events/tasks and agenda management Module2400Desc=Events/tasks and agenda management
Module2500Name=Electronic Content Management Module2500Name=Electronic Content Management
@ -733,10 +733,10 @@ Permission1237=Export supplier orders and their details
Permission1251=Run mass imports of external data into database (data load) Permission1251=Run mass imports of external data into database (data load)
Permission1321=Export customer invoices, attributes and payments Permission1321=Export customer invoices, attributes and payments
Permission1421=Export customer orders and attributes Permission1421=Export customer orders and attributes
Permission23001 = Read Scheduled task Permission23001=Read Scheduled job
Permission23002 = Create/update Scheduled task Permission23002=Create/update Scheduled job
Permission23003 = Delete Scheduled task Permission23003=Delete Scheduled job
Permission23004 = Execute Scheduled task Permission23004=Execute Scheduled job
Permission2401=Read actions (events or tasks) linked to his account Permission2401=Read actions (events or tasks) linked to his account
Permission2402=Create/modify actions (events or tasks) linked to his account Permission2402=Create/modify actions (events or tasks) linked to his account
Permission2403=Delete actions (events or tasks) linked to his account Permission2403=Delete actions (events or tasks) linked to his account

View File

@ -26,15 +26,15 @@ CronLastOutput=Last run output
CronLastResult=Last result code CronLastResult=Last result code
CronListOfCronJobs=List of scheduled jobs CronListOfCronJobs=List of scheduled jobs
CronCommand=Command CronCommand=Command
CronList=Jobs list CronList=Scheduled job
CronDelete= Delete cron jobs CronDelete=Delete scheduled jobs
CronConfirmDelete= Are you sure you want to delete this cron job ? CronConfirmDelete=Are you sure you want to delete this scheduled jobs ?
CronExecute=Launch job CronExecute=Launch scheduled jobs
CronConfirmExecute= Are you sure to execute this job now CronConfirmExecute=Are you sure to execute this scheduled jobs now ?
CronInfo= Jobs allow to execute task that have been planned CronInfo=Scheduled job module allow to execute job that have been planned
CronWaitingJobs=Wainting jobs CronWaitingJobs=Waiting jobs
CronTask=Job CronTask=Job
CronNone= None CronNone=None
CronDtStart=Start date CronDtStart=Start date
CronDtEnd=End date CronDtEnd=End date
CronDtNextLaunch=Next execution CronDtNextLaunch=Next execution
@ -75,6 +75,7 @@ CronObjectHelp=The object name to load. <BR> For exemple to fetch method of Doli
CronMethodHelp=The object method to launch. <BR> For exemple to fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of method is is <i>fecth</i> CronMethodHelp=The object method to launch. <BR> For exemple to fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of method is is <i>fecth</i>
CronArgsHelp=The method arguments. <BR> For exemple to fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of paramters can be <i>0, ProductRef</i> CronArgsHelp=The method arguments. <BR> For exemple to fetch method of Dolibarr Product object /htdocs/product/class/product.class.php, the value of paramters can be <i>0, ProductRef</i>
CronCommandHelp=The system command line to execute. CronCommandHelp=The system command line to execute.
CronCreateJob=Create new Scheduled Job
# Info # Info
CronInfoPage=Information CronInfoPage=Information
# Common # Common