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
/* 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
* 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'
{
$relurl2=dol_buildpath($val2['url'],1);
$relurl2=preg_replace('/__LOGIN__/',$user->login,$relurl2);
$relurl2=preg_replace('/__USERID__/',$user->id,$relurl2);
$canonurl2=preg_replace('/\?.*$/','',$val2['url']);
//var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']);
if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2='';
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) print '<a href="'.$relurl2.'">';
print $val2['titre'];
if ($relurl2) print '</a>';
print '</li>'."\n";
$showmenu=true;
if (! empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) && empty($val2['enabled'])) $showmenu=false;
if ($showmenu) // Visible (option to hide when not allowed is off or allowed)
{
$relurl2=dol_buildpath($val2['url'],1);
$relurl2=preg_replace('/__LOGIN__/',$user->login,$relurl2);
$relurl2=preg_replace('/__USERID__/',$user->id,$relurl2);
$canonurl2=preg_replace('/\?.*$/','',$val2['url']);
//var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']);
if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2='';
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);
print '</ul>';

View File

@ -150,6 +150,7 @@ class MenuManager
{
print '<ul class="ulmenu" data-role="listview" data-inset="true">';
print '<li data-role="list-dividerxxx" class="lilevel0">';
if ($val['enabled'] == 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']
{
$relurl2=dol_buildpath($val2['url'],1);
$relurl2=preg_replace('/__LOGIN__/',$user->login,$relurl2);
$relurl2=preg_replace('/__USERID__/',$user->id,$relurl2);
$canonurl2=preg_replace('/\?.*$/','',$val2['url']);
//var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']);
if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2='';
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)
{
print '<a href="'.$relurl2.'"';
//print ' data-ajax="false"';
print '>';
}
print $val2['titre'];
if ($relurl2) print '</a>';
print '</li>'."\n";
$showmenu=true;
if (! empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) && empty($val2['enabled'])) $showmenu=false;
if ($showmenu) // Visible (option to hide when not allowed is off or allowed)
{
$relurl2=dol_buildpath($val2['url'],1);
$relurl2=preg_replace('/__LOGIN__/',$user->login,$relurl2);
$relurl2=preg_replace('/__USERID__/',$user->id,$relurl2);
$canonurl2=preg_replace('/\?.*$/','',$val2['url']);
//var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']);
if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2='';
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);
print '</ul>';

View File

@ -100,7 +100,7 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex
if ($result < 0) {
setEventMessage($object->error,'errors');
}
else
else
{
$res = $object->reprogram_jobs($user->login);
if ($res > 0)
@ -314,11 +314,11 @@ print "\n<div class=\"tabsAction\">\n";
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
{
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>';

View File

@ -497,7 +497,7 @@ Module1780Desc=Category management (products, suppliers and customers)
Module2000Name=WYSIWYG editor
Module2000Desc=Allow to edit some text area using an advanced editor
Module2300Name=Cron
Module2300Desc=Scheduled task management
Module2300Desc=Scheduled job management
Module2400Name=Agenda
Module2400Desc=Events/tasks and agenda 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)
Permission1321=Export customer invoices, attributes and payments
Permission1421=Export customer orders and attributes
Permission23001 = Read Scheduled task
Permission23002 = Create/update Scheduled task
Permission23003 = Delete Scheduled task
Permission23004 = Execute Scheduled task
Permission23001=Read Scheduled job
Permission23002=Create/update Scheduled job
Permission23003=Delete Scheduled job
Permission23004=Execute Scheduled job
Permission2401=Read 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

View File

@ -26,15 +26,15 @@ CronLastOutput=Last run output
CronLastResult=Last result code
CronListOfCronJobs=List of scheduled jobs
CronCommand=Command
CronList=Jobs list
CronDelete= Delete cron jobs
CronConfirmDelete= Are you sure you want to delete this cron job ?
CronExecute=Launch job
CronConfirmExecute= Are you sure to execute this job now
CronInfo= Jobs allow to execute task that have been planned
CronWaitingJobs=Wainting jobs
CronList=Scheduled job
CronDelete=Delete scheduled jobs
CronConfirmDelete=Are you sure you want to delete this scheduled jobs ?
CronExecute=Launch scheduled jobs
CronConfirmExecute=Are you sure to execute this scheduled jobs now ?
CronInfo=Scheduled job module allow to execute job that have been planned
CronWaitingJobs=Waiting jobs
CronTask=Job
CronNone= None
CronNone=None
CronDtStart=Start date
CronDtEnd=End date
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>
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.
CronCreateJob=Create new Scheduled Job
# Info
CronInfoPage=Information
# Common