Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into socialnetworks
Browse files Browse the repository at this point in the history
  • Loading branch information
frederic34 committed Oct 7, 2019
2 parents f80fa08 + 99da69f commit b78187c
Show file tree
Hide file tree
Showing 88 changed files with 1,746 additions and 519 deletions.
10 changes: 9 additions & 1 deletion dev/namespacemig/aaa.class.php
Expand Up @@ -2,10 +2,14 @@

namespace Dolibarr;


global $globalaaa;
$globalaaa = 'globalaaa';

/**
* faaa
*
* @return string
*/
function faaa()
{
return 'faaa';
Expand All @@ -15,6 +19,10 @@ class Aaa
{
const AAA='aaa';

/**
* do
* @return void
*/
public function do()
{
echo 'doaaa'."\n";
Expand Down
12 changes: 9 additions & 3 deletions dev/namespacemig/bbb.class.php
@@ -1,11 +1,12 @@
<?php




global $globalbbb;
$globalbbb = 'globalbbb';

/**
* fbbb
* @return string
*/
function fbbb()
{
return 'fbbb';
Expand All @@ -14,6 +15,11 @@ function fbbb()
class Bbb
{
const BBB='bbb';

/**
* do
* @return void
*/
public function do()
{
global $globalaaa, $globalbbb;
Expand Down
13 changes: 6 additions & 7 deletions htdocs/accountancy/admin/index.php
Expand Up @@ -82,7 +82,6 @@
}
}

// TO DO Mutualize code for yes/no constants
if ($action == 'setlistsorttodo') {
$setlistsorttodo = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_TODO", $setlistsorttodo, 'yesno', 0, '', $conf->entity);
Expand Down Expand Up @@ -212,7 +211,7 @@
{
// TO DO Mutualize code for yes/no constants
print '<tr class="oddeven">';
print '<td>' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . '</td>';
print '<td>' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . '</td>';
if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) {
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setlistsorttodo&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
Expand All @@ -224,7 +223,7 @@
}
print '</tr>';

print '<tr class="oddeven">';
print '<tr>';
print '<td>' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE") . '</td>';
if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) {
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setlistsortdone&value=0">';
Expand All @@ -237,7 +236,7 @@
}
print '</tr>';

print '<tr class="oddeven">';
print '<tr>';
print '<td>' . $langs->trans("ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL") . '</td>';
if (! empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) {
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setenabledraftexport&value=0">';
Expand All @@ -250,7 +249,7 @@
}
print '</tr>';

print '<tr class="oddeven">';
print '<tr>';
print '<td>' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . '</td>';
if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setdisabledirectinput&value=0">';
Expand All @@ -263,7 +262,7 @@
}
print '</tr>';

print '<tr class="oddeven">';
print '<tr>';
print '<td>' . $langs->trans("ACCOUNTANCY_COMBO_FOR_AUX") . '</td>';
if (! empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setenablesubsidiarylist&value=0">';
Expand All @@ -276,7 +275,7 @@
}
print '</tr>';

print '<tr class="oddeven">';
print '<tr>';
print '<td>' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . '</td>';
if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=setmanagezero&value=0">';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/class/accountingjournal.class.php
Expand Up @@ -235,7 +235,7 @@ public function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle
{
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$label=$langs->trans("ShowAccoutingJournal");
$label=$langs->trans("ShowAccountingJournal");
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
Expand Down
16 changes: 8 additions & 8 deletions htdocs/accountancy/class/bookkeeping.class.php
Expand Up @@ -406,7 +406,7 @@ public function create(User $user, $notrigger = false)
}

/**
* Return a link to the object card (with optionaly the picto)
* Return a link to the object card (with optionally the picto)
*
* @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
* @param string $option On what the link point to ('nolink', ...)
Expand Down Expand Up @@ -1309,7 +1309,7 @@ public function delete(User $user, $notrigger = false, $mode = '')
}

/**
* Delete bookkepping by importkey
* Delete bookkeeping by importkey
*
* @param string $importkey Import key
* @return int Result
Expand Down Expand Up @@ -1337,7 +1337,7 @@ public function deleteByImportkey($importkey)
}

/**
* Delete bookkepping by year
* Delete bookkeeping by year
*
* @param string $delyear Year to delete
* @param string $journal Journal to delete
Expand Down Expand Up @@ -1379,7 +1379,7 @@ public function deleteByYearAndJournal($delyear = '', $journal = '', $mode = '')
}

/**
* Delete bookkepping by piece number
* Delete bookkeeping by piece number
*
* @param int $piecenum Piecenum to delete
* @return int Result
Expand Down Expand Up @@ -1624,12 +1624,12 @@ public function fetchAllPerMvt($piecenum, $mode = '')

// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Export bookkeping
* Export bookkeeping
*
* @param string $model Model
* @return int Result
*/
public function export_bookkeping($model = 'ebp')
public function export_bookkeeping($model = 'ebp')
{
// phpcs:enable
global $conf;
Expand All @@ -1641,7 +1641,7 @@ public function export_bookkeping($model = 'ebp')
$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element;
$sql .= " WHERE entity IN (" . getEntity('accountancy') . ")";

dol_syslog(get_class($this) . "::export_bookkeping", LOG_DEBUG);
dol_syslog(get_class($this) . "::export_bookkeeping", LOG_DEBUG);

$resql = $this->db->query($sql);

Expand Down Expand Up @@ -1679,7 +1679,7 @@ public function export_bookkeping($model = 'ebp')
return $num;
} else {
$this->error = "Error " . $this->db->lasterror();
dol_syslog(get_class($this) . "::export_bookkeping " . $this->error, LOG_ERR);
dol_syslog(get_class($this) . "::export_bookkeeping " . $this->error, LOG_ERR);
return - 1;
}
}
Expand Down
96 changes: 85 additions & 11 deletions htdocs/accountancy/index.php
@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
*
* 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
Expand All @@ -26,6 +26,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';

// Load translation files required by the page
$langs->loadLangs(array("compta","bills","other","accountancy","loans","banks","admin","dict"));
Expand All @@ -41,23 +42,57 @@
* Actions
*/

// None
if (GETPOST('addbox')) // Add box (when submit is done from a form when ajax disabled)
{
require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
$zone=GETPOST('areacode', 'aZ09');
$userid=GETPOST('userid', 'int');
$boxorder=GETPOST('boxorder', 'aZ09');
$boxorder.=GETPOST('boxcombo', 'aZ09');

$result=InfoBox::saveboxorder($db, $zone, $boxorder, $userid);
if ($result > 0) setEventMessages($langs->trans("BoxAdded"), null);
}

/*
* View
*/

llxHeader('', $langs->trans("AccountancyArea"));

print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy');
//dol_fiche_head();

$step = 0;

if ($conf->accounting->enabled)
{
print '<span class="opacitymedium">'.$langs->trans("AccountancyAreaDescIntro")."</span><br>\n";
$step = 0;

$resultboxes=FormOther::getBoxesArea($user, "27"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb)

$helpisexpanded = empty($resultboxes['boxactivated']); // If there is no widget, the tooltip help is expanded by default.
$showtutorial = '';

if (! $helpisexpanded)
{
$showtutorial = '<div align="right"><a href="#" id="show_hide">';
$showtutorial .= img_picto('', 'chevron-down');
$showtutorial .= ' ' . $langs->trans("ShowTutorial");
$showtutorial .= '</a></div>';

$showtutorial .= '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
jQuery("#show_hide").click(function () {
jQuery( "#idfaq" ).toggle({
duration: 400,
});
});
});
</script>';
}


print load_fiche_titre($langs->trans("AccountancyArea"), $showtutorial . $resultboxes['selectboxlist'], 'accountancy');

print '<div class="'.($helpisexpanded ? '' : 'hideobject').'" id="idfaq">'; // hideobject is to start hidden
print "<br>\n";
print '<span class="opacitymedium">'.$langs->trans("AccountancyAreaDescIntro")."</span><br>\n";
print "<br>\n";print "<br>\n";

print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."\n";
Expand Down Expand Up @@ -172,12 +207,51 @@
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", chr(64+$step))."<br>\n";
print "<br>\n";

print '<br>';

print '</div>';

print '<div class="clearboth"></div>';

print '<div class="fichecenter fichecenterbis">';

/*
* Show boxes
*/
$boxlist.='<div class="twocolumns">';

$boxlist.='<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
if(!empty($nbworkboardcount))
{
$boxlist.=$boxwork;
}

$boxlist.=$resultboxes['boxlista'];

$boxlist.= '</div>';

$boxlist.= '<div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';

$boxlist.=$boxstat;
$boxlist.=$resultboxes['boxlistb'];

$boxlist.= '</div>';
$boxlist.= "\n";

$boxlist.='</div>';


print $boxlist;

print '</div>';
}
else
{
print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy');

print $langs->trans("Module10Desc")."<br>\n";
}
//dol_fiche_end();

// End of page
llxFooter();
Expand Down
2 changes: 1 addition & 1 deletion htdocs/adherents/admin/website.php
Expand Up @@ -225,7 +225,7 @@ function initfields()
{
print '<br>';
//print $langs->trans('FollowingLinksArePublic').'<br>';
print img_picto('', 'object_globe.png').' '.$langs->trans('BlankSubscriptionForm').':<br>';
print img_picto('', 'globe').' '.$langs->trans('BlankSubscriptionForm').':<br>';
if ($conf->multicompany->enabled) {
$entity_qr='?entity='.$conf->entity;
} else {
Expand Down
6 changes: 3 additions & 3 deletions htdocs/admin/agenda_xcal.php
Expand Up @@ -161,13 +161,13 @@
// Show message
$message='';
$urlvcal='<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'...').'" target="_blank">'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').'</a>';
$message.=img_picto('', 'object_globe.png').' '.$langs->trans("WebCalUrlForVCalExport", 'vcal', $urlvcal);
$message.=img_picto('', 'globe').' '.$langs->trans("WebCalUrlForVCalExport", 'vcal', $urlvcal);
$message.='<br>';
$urlical='<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'...').'" target="_blank">'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').'</a>';
$message.=img_picto('', 'object_globe.png').' '.$langs->trans("WebCalUrlForVCalExport", 'ical/ics', $urlical);
$message.=img_picto('', 'globe').' '.$langs->trans("WebCalUrlForVCalExport", 'ical/ics', $urlical);
$message.='<br>';
$urlrss='<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'...').'" target="_blank">'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').'</a>';
$message.=img_picto('', 'object_globe.png').' '.$langs->trans("WebCalUrlForVCalExport", 'rss', $urlrss);
$message.=img_picto('', 'globe').' '.$langs->trans("WebCalUrlForVCalExport", 'rss', $urlrss);
$message.='<br>';
$message.='<br>';
print $message;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/admin/boxes.php
Expand Up @@ -29,7 +29,7 @@
include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';

// Load translation files required by the page
$langs->loadLangs(array('admin', 'boxes'));
$langs->loadLangs(array('admin', 'boxes', 'accountancy'));

if (! $user->admin) accessforbidden();

Expand Down
8 changes: 5 additions & 3 deletions htdocs/admin/dav.php
Expand Up @@ -123,7 +123,9 @@
{
print '<tr class="oddeven"><td>';
$tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
print $form->textwithpicto($langs->trans($key), $tooltiphelp);
$label = $langs->trans($key);
if ($key == 'DAV_RESTICT_ON_IP') $label = $langs->trans("RESTRICT_ON_IP");
print $form->textwithpicto($label, $tooltiphelp);
print '</td><td>';
if ($key == 'DAV_ALLOW_PRIVATE_DIR')
{
Expand Down Expand Up @@ -172,13 +174,13 @@
// Show message
$message='';
$url='<a href="'.$urlwithroot.'/dav/fileserver.php" target="_blank">'.$urlwithroot.'/dav/fileserver.php</a>';
$message.=img_picto('', 'object_globe.png').' '.$langs->trans("WebDavServer", 'WebDAV', $url);
$message.=img_picto('', 'globe').' '.$langs->trans("WebDavServer", 'WebDAV', $url);
$message.='<br>';
if (! empty($conf->global->DAV_ALLOW_PUBLIC_DIR))
{
$urlEntity = (! empty($conf->multicompany->enabled)?'?entity='.$conf->entity:'');
$url='<a href="'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'" target="_blank">'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'</a>';
$message.=img_picto('', 'object_globe.png').' '.$langs->trans("WebDavServer", 'WebDAV public', $url);
$message.=img_picto('', 'globe').' '.$langs->trans("WebDavServer", 'WebDAV public', $url);
$message.='<br>';
}
print $message;
Expand Down

0 comments on commit b78187c

Please sign in to comment.