mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
Merge remote-tracking branch 'refs/remotes/Dolibarr/develop' into develop
This commit is contained in:
@@ -165,7 +165,7 @@ if ($action == 'edit')
|
||||
$var=true;
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("DelaysOfToleranceBeforeWarning").'</td><td width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("DelaysOfToleranceBeforeWarning").'</td><td class="center" width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
foreach($modules as $module => $delays)
|
||||
{
|
||||
@@ -173,12 +173,12 @@ if ($action == 'edit')
|
||||
{
|
||||
foreach($delays as $delay)
|
||||
{
|
||||
|
||||
|
||||
$value=(! empty($conf->global->{$delay['code']})?$conf->global->{$delay['code']}:0);
|
||||
print '<tr class="oddeven">';
|
||||
print '<td width="20px">'.img_object('',$delay['img']).'</td>';
|
||||
print '<td>'.$langs->trans('Delays_'.$delay['code']).'</td><td>';
|
||||
print '<input size="5" name="'.$delay['code'].'" value="'.$value.'"> '.$langs->trans("days").'</td></tr>';
|
||||
print '<input class="right maxwidth75" type="number" name="'.$delay['code'].'" value="'.$value.'"> '.$langs->trans("days").'</td></tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -189,11 +189,11 @@ if ($action == 'edit')
|
||||
|
||||
// Show if meteo is enabled
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td class="center" width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
$var=false;
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td>' .$form->selectyesno('MAIN_DISABLE_METEO',(empty($conf->global->MAIN_DISABLE_METEO)?0:1),1) . '</td></tr>';
|
||||
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td class="center">' .$form->selectyesno('MAIN_DISABLE_METEO',(empty($conf->global->MAIN_DISABLE_METEO)?0:1),1) . '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@@ -211,7 +211,7 @@ else
|
||||
*/
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("DelaysOfToleranceBeforeWarning").'</td><td width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("DelaysOfToleranceBeforeWarning").'</td><td class="center" width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||
$var=true;
|
||||
|
||||
foreach($modules as $module => $delays)
|
||||
@@ -220,12 +220,12 @@ else
|
||||
{
|
||||
foreach($delays as $delay)
|
||||
{
|
||||
|
||||
|
||||
$value=(! empty($conf->global->{$delay['code']})?$conf->global->{$delay['code']}:0);
|
||||
print '<tr class="oddeven">';
|
||||
print '<td width="20px">'.img_object('',$delay['img']).'</td>';
|
||||
print '<td>'.$langs->trans('Delays_'.$delay['code']).'</td>';
|
||||
print '<td>'.$value.' '.$langs->trans("days").'</td></tr>';
|
||||
print '<td class="right">'.$value.' '.$langs->trans("days").'</td></tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -236,11 +236,11 @@ else
|
||||
|
||||
// Show if meteo is enabled
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td class="center" width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
$var=false;
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td>' . yn($conf->global->MAIN_DISABLE_METEO) . '</td></tr>';
|
||||
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td class="center">' . yn($conf->global->MAIN_DISABLE_METEO) . '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
@@ -88,6 +88,7 @@ if (!empty($ExecTimeLimit))
|
||||
@set_time_limit($ExecTimeLimit); // Need more than 240 on Windows 7/64
|
||||
error_reporting($err);
|
||||
}
|
||||
$MemoryLimit=0;
|
||||
if (!empty($MemoryLimit))
|
||||
{
|
||||
@ini_set('memory_limit', $MemoryLimit);
|
||||
@@ -120,10 +121,10 @@ $utils = new Utils($db);
|
||||
// MYSQL
|
||||
if ($what == 'mysql')
|
||||
{
|
||||
|
||||
|
||||
$cmddump=GETPOST("mysqldump"); // Do not sanitize here with 'alpha', will be sanitize later by dol_sanitizePathName and escapeshellarg
|
||||
$cmddump=dol_sanitizePathName($cmddump);
|
||||
|
||||
|
||||
if (! empty($dolibarr_main_restrict_os_commands))
|
||||
{
|
||||
$arrayofallowedcommand=explode(',', $dolibarr_main_restrict_os_commands);
|
||||
@@ -142,13 +143,13 @@ if ($what == 'mysql')
|
||||
$errormsg=$langs->trans('CommandIsNotInsideAllowedCommands');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (! $errormsg && $cmddump)
|
||||
{
|
||||
dolibarr_set_const($db, 'SYSTEMTOOLS_MYSQLDUMP', $cmddump,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
|
||||
if (! $errormsg)
|
||||
if (! $errormsg)
|
||||
{
|
||||
$utils->dumpDatabase(GETPOST('compression','alpha'), $what, 0, $file);
|
||||
$errormsg=$utils->error;
|
||||
@@ -172,13 +173,13 @@ if ($what == 'postgresql')
|
||||
{
|
||||
$cmddump=GETPOST("postgresqldump"); // Do not sanitize here with 'alpha', will be sanitize later by dol_sanitizePathName and escapeshellarg
|
||||
$cmddump=dol_sanitizePathName($cmddump);
|
||||
|
||||
|
||||
if (! $errormsg && $cmddump)
|
||||
{
|
||||
dolibarr_set_const($db, 'SYSTEMTOOLS_POSTGRESQLDUMP', $cmddump,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
|
||||
if (! $errormsg)
|
||||
if (! $errormsg)
|
||||
{
|
||||
$utils->dumpDatabase(GETPOST('compression','alpha'), $what, 0, $file);
|
||||
$errormsg=$utils->error;
|
||||
|
||||
@@ -40,7 +40,26 @@ function printBookmarksList($aDb, $aLangs)
|
||||
|
||||
$langs->load("bookmarks");
|
||||
|
||||
$url= $_SERVER["PHP_SELF"].(dol_escape_htmltag($_SERVER["QUERY_STRING"])?'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]):'');
|
||||
$url= $_SERVER["PHP_SELF"];
|
||||
|
||||
if (! empty($_SERVER["QUERY_STRING"]))
|
||||
{
|
||||
$url.=(dol_escape_htmltag($_SERVER["QUERY_STRING"])?'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]):'');
|
||||
}
|
||||
else
|
||||
{
|
||||
global $sortfield,$sortorder;
|
||||
$tmpurl='';
|
||||
// No urlencode, all param $url will be urlencoded later
|
||||
if ($sortfield) $tmpurl.=($tmpurl?'&':'').'sortfield='.$sortfield;
|
||||
if ($sortorder) $tmpurl.=($tmpurl?'&':'').'sortorder='.$sortorder;
|
||||
foreach($_POST as $key => $val)
|
||||
{
|
||||
if (preg_match('/^search_/', $key) && $val != '') $tmpurl.=($tmpurl?'&':'').$key.'='.$val;
|
||||
}
|
||||
|
||||
$url.=($tmpurl?'?'.$tmpurl:'');
|
||||
}
|
||||
|
||||
$ret = '';
|
||||
|
||||
@@ -55,7 +74,8 @@ function printBookmarksList($aDb, $aLangs)
|
||||
// Url to go on create new bookmark page
|
||||
if ($user->rights->bookmark->creer)
|
||||
{
|
||||
$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url);
|
||||
//$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url);
|
||||
$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url);
|
||||
$ret.= '<option value="newbookmark" class="optionblue" rel="'.dol_escape_htmltag($urltoadd).'">'.dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).'...</option>';
|
||||
}
|
||||
// Menu with all bookmarks
|
||||
|
||||
@@ -39,6 +39,7 @@ $id=GETPOST("id");
|
||||
$action=GETPOST("action","alpha");
|
||||
$title=GETPOST("title","alpha");
|
||||
$url=GETPOST("url","alpha");
|
||||
$urlsource=GETPOST("urlsource","alpha");
|
||||
$target=GETPOST("target","alpha");
|
||||
$userid=GETPOST("userid","int");
|
||||
$position=GETPOST("position","int");
|
||||
@@ -64,7 +65,7 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
|
||||
|
||||
if (GETPOST("cancel"))
|
||||
{
|
||||
if (empty($backtopage)) $backtopage=(GETPOST("urlsource")?GETPOST("urlsource"):((! empty($url))?$url:DOL_URL_ROOT.'/bookmarks/list.php'));
|
||||
if (empty($backtopage)) $backtopage=($urlsource?$urlsource:((! empty($url))?$url:DOL_URL_ROOT.'/bookmarks/list.php'));
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
}
|
||||
@@ -97,7 +98,7 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
|
||||
|
||||
if ($res > 0)
|
||||
{
|
||||
if (empty($backtopage)) $backtopage=(GETPOST("urlsource")?GETPOST("urlsource"):DOL_URL_ROOT.'/bookmarks/list.php');
|
||||
if (empty($backtopage)) $backtopage=($urlsource?$urlsource:((! empty($url))?$url:DOL_URL_ROOT.'/bookmarks/list.php'));
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
}
|
||||
@@ -121,6 +122,7 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@@ -153,15 +155,15 @@ if ($action == 'create')
|
||||
|
||||
print load_fiche_titre($langs->trans("NewBookmark"));
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("Bookmark"),0,'bookmark');
|
||||
dol_fiche_head($head, $hselected, $langs->trans("Bookmark"), 0, 'bookmark');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("BookmarkTitle").'</td><td><input id="titlebookmark" class="flat minwidth100" name="title" value="'.$title.'"></td><td class="hideonsmartphone">'.$langs->trans("SetHereATitleForLink").'</td></tr>';
|
||||
dol_set_focus('#titlebookmark');
|
||||
|
||||
|
||||
// Url
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("UrlOrLink").'</td><td><input class="flat quatrevingtpercent" name="url" value="'.$url.'"></td><td class="hideonsmartphone">'.$langs->trans("UseAnExternalHttpLinkOrRelativeDolibarrLink").'</td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("UrlOrLink").'</td><td><input class="flat quatrevingtpercent" name="url" value="'.dol_escape_htmltag($url).'"></td><td class="hideonsmartphone">'.$langs->trans("UseAnExternalHttpLinkOrRelativeDolibarrLink").'</td></tr>';
|
||||
|
||||
// Target
|
||||
print '<tr><td>'.$langs->trans("BehaviourOnClick").'</td><td>';
|
||||
@@ -219,14 +221,14 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
||||
}
|
||||
|
||||
|
||||
dol_fiche_head($head, $hselected, $langs->trans("Bookmark"),0,'bookmark');
|
||||
dol_fiche_head($head, $hselected, $langs->trans("Bookmark"), -1, 'bookmark');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/bookmarks/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', '', 0);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
@@ -304,7 +306,7 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
if ($action == 'edit')
|
||||
|
||||
@@ -338,6 +338,17 @@ if ($resql)
|
||||
if ($usergroup) $nav.='<input type="hidden" name="usergroup" value="'.$usergroup.'">';
|
||||
print $nav;
|
||||
|
||||
if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create)
|
||||
{
|
||||
$newparam.='&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year;
|
||||
|
||||
//$param='month='.$monthshown.'&year='.$year;
|
||||
$hourminsec='100000';
|
||||
$link = '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d",$year,$month,$day).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam?'?'.$newparam:'')).'">';
|
||||
$link.= $langs->trans("NewAction");
|
||||
$link.= '</a>';
|
||||
}
|
||||
|
||||
print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $link, $num, -1 * $nbtotalofrecords, '', 0, $nav, '', $limit);
|
||||
|
||||
$moreforfilter='';
|
||||
|
||||
@@ -85,7 +85,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT . '/resource/class/html.formresource.class.php';
|
||||
$formresource=new FormResource($db);
|
||||
|
||||
|
||||
// Resource
|
||||
print '<tr>';
|
||||
print '<td class="nowrap" style="padding-bottom: 2px; padding-right: 4px;">';
|
||||
@@ -94,7 +94,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
|
||||
print $formresource->select_resource_list($resourceid, "resourceid", '', 1, 0, 0, null, '', 2);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||
$formactions=new FormActions($db);
|
||||
|
||||
@@ -251,7 +251,7 @@ function show_array_actions_to_do($max=5)
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@@ -347,7 +347,7 @@ function show_array_last_actions_done($max=5)
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@@ -458,7 +458,7 @@ function actions_prepare_head($object)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php';
|
||||
$resource=new DolResource($db);
|
||||
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=action&element_id='.$object->id;
|
||||
$listofresourcelinked = $resource->getElementResources($object->element, $object->id);
|
||||
$nbResources=count($listofresourcelinked);
|
||||
@@ -506,6 +506,11 @@ function calendars_prepare_head($param)
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/comm/action/listactions.php'.($param?'?'.$param:'');
|
||||
$head[$h][1] = $langs->trans("ViewList");
|
||||
$head[$h][2] = 'cardlist';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/comm/action/index.php?action=show_day'.($param?'&'.$param:'');
|
||||
$head[$h][1] = $langs->trans("ViewDay");
|
||||
$head[$h][2] = 'cardday';
|
||||
@@ -529,16 +534,12 @@ function calendars_prepare_head($param)
|
||||
$head[$h][2] = 'cardpertype';
|
||||
$h++;
|
||||
}
|
||||
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/comm/action/peruser.php'.($param?'?'.$param:'');
|
||||
$head[$h][1] = $langs->trans("ViewPerUser");
|
||||
$head[$h][2] = 'cardperuser';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/comm/action/listactions.php'.($param?'?'.$param:'');
|
||||
$head[$h][1] = $langs->trans("ViewList");
|
||||
$head[$h][2] = 'cardlist';
|
||||
$h++;
|
||||
|
||||
$object=new stdClass();
|
||||
|
||||
|
||||
@@ -434,6 +434,8 @@ function currency_name($code_iso, $withcode='', $outputlangs=null)
|
||||
|
||||
if (empty($outputlangs)) $outputlangs=$langs;
|
||||
|
||||
$outputlangs->load("dict");
|
||||
|
||||
// If there is a translation, we can send immediatly the label
|
||||
if ($outputlangs->trans("Currency".$code_iso)!="Currency".$code_iso)
|
||||
{
|
||||
|
||||
@@ -1068,10 +1068,10 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
|
||||
// Show page nb only on iso languages (so default Helvetica font)
|
||||
if (strtolower(pdf_getPDFFont($outputlangs)) == 'helvetica')
|
||||
{
|
||||
$pdf->SetXY(-20,-$posy);
|
||||
$pdf->SetXY($dims['wk']-$dims['rm']-15, -$posy);
|
||||
//print 'xxx'.$pdf->PageNo().'-'.$pdf->getAliasNbPages().'-'.$pdf->getAliasNumPage();exit;
|
||||
if (empty($conf->global->MAIN_USE_FPDF)) $pdf->MultiCell(13, 2, $pdf->PageNo().'/'.$pdf->getAliasNbPages(), 0, 'R', 0);
|
||||
else $pdf->MultiCell(13, 2, $pdf->PageNo().'/{nb}', 0, 'R', 0);
|
||||
if (empty($conf->global->MAIN_USE_FPDF)) $pdf->MultiCell(15, 2, $pdf->PageNo().'/'.$pdf->getAliasNbPages(), 0, 'R', 0);
|
||||
else $pdf->MultiCell(15, 2, $pdf->PageNo().'/{nb}', 0, 'R', 0);
|
||||
}
|
||||
|
||||
return $marginwithfooter;
|
||||
|
||||
@@ -81,10 +81,10 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$m
|
||||
$url = $shorturl = $tmp[0];
|
||||
$param = (isset($tmp[1])?$tmp[1]:'');
|
||||
|
||||
// Complete param to force leftmenu to '' to closed opend menu when we click on a link with no leftmenu defined.
|
||||
// Complete param to force leftmenu to '' to close open menu when we click on a link with no leftmenu defined.
|
||||
if ((! preg_match('/mainmenu/i',$param)) && (! preg_match('/leftmenu/i',$param)) && ! empty($newTabMenu[$i]['url']))
|
||||
{
|
||||
$param.=($param?'&':'').'mainmenu='.$newTabMenu[$i]['url'].'&leftmenu=';
|
||||
$param.=($param?'&':'').'mainmenu='.$newTabMenu[$i]['mainmenu'].'&leftmenu=';
|
||||
}
|
||||
if ((! preg_match('/mainmenu/i',$param)) && (! preg_match('/leftmenu/i',$param)) && empty($newTabMenu[$i]['url']))
|
||||
{
|
||||
@@ -94,6 +94,7 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$m
|
||||
$url = dol_buildpath($url,1).($param?'?'.$param:'');
|
||||
//$shorturl = $shorturl.($param?'?'.$param:'');
|
||||
$shorturl = $url;
|
||||
|
||||
if (DOL_URL_ROOT) $shorturl = preg_replace('/^'.preg_quote(DOL_URL_ROOT,'/').'/','',$shorturl);
|
||||
}
|
||||
|
||||
@@ -126,7 +127,7 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$m
|
||||
// Output menu entries
|
||||
foreach($menu->liste as $menkey => $menuval)
|
||||
{
|
||||
if (empty($noout)) print_start_menu_entry_auguria($menuval['idsel'],$menuval['classname'],$menuval['enabled']);
|
||||
if (empty($noout)) print_start_menu_entry_auguria($menuval['idsel'],$menuval['classname'],$menuval['enabled']);
|
||||
if (empty($noout)) print_text_menu_entry_auguria($menuval['titre'], $menuval['enabled'], ($menuval['url']!='#'?DOL_URL_ROOT:'').$menuval['url'], $menuval['id'], $menuval['idsel'], $menuval['classname'], ($menuval['target']?$menuval['target']:$atarget));
|
||||
if (empty($noout)) print_end_menu_entry_auguria($menuval['enabled']);
|
||||
}
|
||||
@@ -300,6 +301,16 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
|
||||
print "<!-- End SearchForm -->\n";
|
||||
}
|
||||
|
||||
if (is_array($moredata) && ! empty($moredata['bookmarks']))
|
||||
{
|
||||
print "\n";
|
||||
print "<!-- Begin Bookmarks -->\n";
|
||||
print '<div id="blockvmenubookmarks" class="blockvmenubookmarks">'."\n";
|
||||
print $moredata['bookmarks'];
|
||||
print '</div>'."\n";
|
||||
print "<!-- End Bookmarks -->\n";
|
||||
}
|
||||
|
||||
// We update newmenu with entries found into database
|
||||
$menuArbo = new Menubase($db,'auguria');
|
||||
$newmenu = $menuArbo->menuLeftCharger($newmenu,$mainmenu,$leftmenu,($user->societe_id?1:0),'auguria',$tabMenu);
|
||||
@@ -563,16 +574,6 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
|
||||
if ($altok) print '<div class="blockvmenuend"></div>'; // End menu block
|
||||
}
|
||||
|
||||
if (is_array($moredata) && ! empty($moredata['bookmarks']))
|
||||
{
|
||||
print "\n";
|
||||
print "<!-- Begin Bookmarks -->\n";
|
||||
print '<div id="blockvmenubookmarks" class="blockvmenubookmarks">'."\n";
|
||||
print $moredata['bookmarks'];
|
||||
print '</div>'."\n";
|
||||
print "<!-- End Bookmarks -->\n";
|
||||
}
|
||||
|
||||
return count($menu_array);
|
||||
}
|
||||
|
||||
|
||||
@@ -1583,7 +1583,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
$url = $shorturl = $tmp[0];
|
||||
$param = (isset($tmp[1])?$tmp[1]:''); // params in url of the menu link
|
||||
|
||||
// Complete param to force leftmenu to '' to closed opend menu when we click on a link with no leftmenu defined.
|
||||
// Complete param to force leftmenu to '' to close open menu when we click on a link with no leftmenu defined.
|
||||
if ((! preg_match('/mainmenu/i',$param)) && (! preg_match('/leftmenu/i',$param)) && ! empty($menu_array[$i]['mainmenu']))
|
||||
{
|
||||
$param.=($param?'&':'').'mainmenu='.$menu_array[$i]['mainmenu'].'&leftmenu=';
|
||||
|
||||
@@ -235,7 +235,7 @@ class modAgenda extends DolibarrModules
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda',
|
||||
'langs'=>'agenda',
|
||||
'position'=>102,
|
||||
'position'=>140,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
@@ -247,7 +247,7 @@ class modAgenda extends DolibarrModules
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine',
|
||||
'langs'=>'agenda',
|
||||
'position'=>103,
|
||||
'position'=>141,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
@@ -259,7 +259,7 @@ class modAgenda extends DolibarrModules
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=done&filter=mine',
|
||||
'langs'=>'agenda',
|
||||
'position'=>104,
|
||||
'position'=>142,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
@@ -271,7 +271,7 @@ class modAgenda extends DolibarrModules
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1',
|
||||
'langs'=>'agenda',
|
||||
'position'=>105,
|
||||
'position'=>143,
|
||||
'perms'=>'$user->rights->agenda->allactions->read',
|
||||
'enabled'=>'$user->rights->agenda->allactions->read',
|
||||
'target'=>'',
|
||||
@@ -283,7 +283,7 @@ class modAgenda extends DolibarrModules
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1',
|
||||
'langs'=>'agenda',
|
||||
'position'=>106,
|
||||
'position'=>144,
|
||||
'perms'=>'$user->rights->agenda->allactions->read',
|
||||
'enabled'=>'$user->rights->agenda->allactions->read',
|
||||
'target'=>'',
|
||||
@@ -296,7 +296,7 @@ class modAgenda extends DolibarrModules
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda',
|
||||
'langs'=>'agenda',
|
||||
'position'=>112,
|
||||
'position'=>110,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
@@ -308,7 +308,7 @@ class modAgenda extends DolibarrModules
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine',
|
||||
'langs'=>'agenda',
|
||||
'position'=>113,
|
||||
'position'=>111,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
@@ -320,7 +320,7 @@ class modAgenda extends DolibarrModules
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=done&filter=mine',
|
||||
'langs'=>'agenda',
|
||||
'position'=>114,
|
||||
'position'=>112,
|
||||
'perms'=>'$user->rights->agenda->myactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
@@ -332,7 +332,7 @@ class modAgenda extends DolibarrModules
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1',
|
||||
'langs'=>'agenda',
|
||||
'position'=>115,
|
||||
'position'=>113,
|
||||
'perms'=>'$user->rights->agenda->allactions->read',
|
||||
'enabled'=>'$user->rights->agenda->allactions->read',
|
||||
'target'=>'',
|
||||
@@ -344,7 +344,7 @@ class modAgenda extends DolibarrModules
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1',
|
||||
'langs'=>'agenda',
|
||||
'position'=>116,
|
||||
'position'=>114,
|
||||
'perms'=>'$user->rights->agenda->allactions->read',
|
||||
'enabled'=>'$user->rights->agenda->allactions->read',
|
||||
'target'=>'',
|
||||
@@ -357,7 +357,7 @@ class modAgenda extends DolibarrModules
|
||||
'mainmenu'=>'agenda',
|
||||
'url'=>'/comm/action/rapport/index.php?mainmenu=agenda&leftmenu=agenda',
|
||||
'langs'=>'agenda',
|
||||
'position'=>120,
|
||||
'position'=>160,
|
||||
'perms'=>'$user->rights->agenda->allactions->read',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
|
||||
@@ -271,3 +271,8 @@ ALTER TABLE llx_product_fournisseur_price ADD COLUMN default_vat_code varchar(10
|
||||
|
||||
|
||||
ALTER TABLE llx_events MODIFY COLUMN ip varchar(250);
|
||||
|
||||
|
||||
UPDATE llx_bank SET label= '(SupplierInvoicePayment)' WHERE label= 'Règlement fournisseur';
|
||||
UPDATE llx_bank SET label= '(CustomerInvoicePayment)' WHERE label= 'Règlement client';
|
||||
|
||||
|
||||
143
test/phpunit/CompanyLibTest.php
Normal file
143
test/phpunit/CompanyLibTest.php
Normal file
@@ -0,0 +1,143 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* or see http://www.gnu.org/
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file test/phpunit/CompanyLibTest.php
|
||||
* \ingroup test
|
||||
* \brief PHPUnit test
|
||||
* \remarks To run this script as CLI: phpunit filename.php
|
||||
*/
|
||||
|
||||
global $conf,$user,$langs,$db;
|
||||
//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
|
||||
//require_once 'PHPUnit/Autoload.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
|
||||
require_once dirname(__FILE__).'/../../htdocs/core/lib/company.lib.php';
|
||||
|
||||
if (empty($user->id)) {
|
||||
print "Load permissions for admin user nb 1\n";
|
||||
$user->fetch(1);
|
||||
$user->getrights();
|
||||
}
|
||||
$conf->global->MAIN_DISABLE_ALL_MAILS=1;
|
||||
|
||||
|
||||
/**
|
||||
* Class for PHPUnit tests
|
||||
*
|
||||
* @backupGlobals disabled
|
||||
* @backupStaticAttributes enabled
|
||||
* @remarks backupGlobals must be disabled to have db,conf,user and lang not erased.
|
||||
*/
|
||||
class CompanyLibTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $savconf;
|
||||
protected $savuser;
|
||||
protected $savlangs;
|
||||
protected $savdb;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* We save global variables into local variables
|
||||
*
|
||||
* @return AdminLibTest
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
//$this->sharedFixture
|
||||
global $conf,$user,$langs,$db;
|
||||
$this->savconf=$conf;
|
||||
$this->savuser=$user;
|
||||
$this->savlangs=$langs;
|
||||
$this->savdb=$db;
|
||||
|
||||
print __METHOD__." db->type=".$db->type." user->id=".$user->id;
|
||||
//print " - db ".$db->db;
|
||||
print "\n";
|
||||
}
|
||||
|
||||
// Static methods
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
|
||||
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
|
||||
// tear down after class
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
$db->rollback();
|
||||
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Init phpunit tests
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
$conf=$this->savconf;
|
||||
$user=$this->savuser;
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
/**
|
||||
* End phpunit tests
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown()
|
||||
{
|
||||
print __METHOD__."\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* testNameCurrency
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testNameCurrency()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
$conf=$this->savconf;
|
||||
$user=$this->savuser;
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
|
||||
$result=currency_name('USD');
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals('US Dollars',$result,'Test to get currency name USD in default language '.$langs->defaultlang);
|
||||
|
||||
$outputlangs=new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang('fr_FR');
|
||||
|
||||
$result=currency_name('USD', 1, $outputlangs);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals('USD - Dollars US',$result,'Test to get currency name USD in default language '.$outputlangs->getDefaultLang());
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user