Skip to content

Commit

Permalink
Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into develop
Browse files Browse the repository at this point in the history
Conflicts:
	htdocs/core/class/hookmanager.class.php
  • Loading branch information
eldy committed Jan 21, 2017
2 parents 9a56707 + 6ab9ba3 commit 5362d10
Show file tree
Hide file tree
Showing 1,018 changed files with 134 additions and 82,984 deletions.
19 changes: 6 additions & 13 deletions README-FR.md
Expand Up @@ -54,19 +54,10 @@ Pour mettre a jour Dolibarr depuis une vieille version vers celle ci:
- Ecraser les vieux fichiers dans le vieux repertoire 'dolibarr' par les fichiers
fournis dans ce nouveau package.

- Si vous venez d'une version x.y.z vers x.y.w (seul le 3eme chiffre varie),
il n'y a pas besoin de migration de données.

- Si vous venez d'une beta ou d'un version x.y.z vers une autre ou les numeros x
ou y varient, vous devez appelez la page "install/" de migration dans votre
navigateur (ceci doit se faire automatiquement au premier accès de l'application).
Ce sera une URL du genre:
http://localhost/dolibarr/htdocs/install/index.php
ou
http://yourdolibarrhost/install/index.php
- Au prochain accès, Dolibarr proposera la page de "mise a jour" des données (si necessaire).
Si un fichier install.lock existe pour vérouiller le processus de mise à jour, il sera demandé de le supprimer manuellement (vous devriez trouver le fichier install.lock dans le répertoire utilisé pour stocker les documents générés ou transféré sur le serveur. Dans la plupart des cas, c'est le répertoire appelé "documents")

Ensuite, choisir l'option de "mise a jour" en rapport avec votre cas.
Note: Le processus de migration peut etre lance plusieurs fois sans risque.
*Note: Le processus de migration peut etre lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/*


## CE QUI EST NOUVEAU
Expand All @@ -86,11 +77,13 @@ Voir fichier ChangeLog.
- Gestion des factures clients/fournisseurs et paiements
- Gestion des virements bancaires SEPA
- Gestion des comptes bancaires
- Agenda partagé
- Calendrier/Agenda partagé (avec export ical, vcal)
- Suivi des opportunités et/ou projets (suivi de rentabilité incluant les factures, notes de frais, temps consommé valorisé, ...)
- Gestion de contrats de services
- Gestion de stock
- Gestion des expéditions
- Gestion des demandes de congès
- Gestion des notes de frais
- GED (Gestion Electronique de Documents)
- EMailings de masse
- Réalisation de sondages
Expand Down
12 changes: 6 additions & 6 deletions README.md
Expand Up @@ -60,10 +60,10 @@ You can use a Web server and a supported database (MariaDb, MySql or Postgresql)
## UPGRADING

- Overwrite all old files from 'dolibarr' directory with files provided into the new version's package.
- If you're upgrading from version x.y.z to x.y.w (only third number differs), there is no need to run any migration process.
- If you're upgrading from a beta version or from any version x.y.z to any other where x or y number differs, you must call the Dolibarr "install/" page in your browser (this should be done automatically at first dolibarr access) and follow the upgrade process.
- At first next access, Dolibarr will redirect your to the "install/" page to make the upgrade process.
If a file install.lock exists to lock any run of upgrade process, the application will ask you to remove the file manually (you should find the install.lock file into the directory used to store generated and uploaded documents, in most cases, it is the directory called "documents").

*Note: migration process can safely be done multiple times.*
*Note: migration process can safely be done multiple times by calling the page /install/index.php*

## WHAT'S NEW

Expand All @@ -80,17 +80,17 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
- Invoices and payment management
- Standing orders management (European SEPA)
- Bank accounts management
- Shared calendar
- Shared calendar/agenda (with ical and vcal export for third party tools integration)
- Opportunities and/or project management (following project benefit including invoices, expense reports, time spent, ...)
- Projects management
- Contracts management
- Stock management
- Shipping management
- Interventions management
- Agenda with ical and vcal export for third party tools integration
- Employee's leave requests management
- Expense report management
- Electronic Document Management (EDM)
- Foundations members management
- Employee's holidays management
- Mass emailing
- Surveys
- Point of Sale
Expand Down
6 changes: 5 additions & 1 deletion dev/tools/fixaltlanguages.sh
Expand Up @@ -42,11 +42,15 @@ then
then
aaupper="US"
fi
if [ $aaupper = "EL" ]
then
aaupper="GR"
fi
bblower=`echo $dirshort | nawk -F"_" '{ print tolower($2) }'`
if [ "$aa" != "$bblower" -a "$dirshort" != "en_US" ]
then
reflang="htdocs/langs/"$aa"_"$aaupper
if [ -d $reflang ]
if [ -d $reflang -a $aa"_"$bb != $aa"_"$aaupper ]
then
echo "***** Process language "$aa"_"$bb" - Search original into "$reflang
echo $dirshort is an alternative language of $reflang
Expand Down
6 changes: 3 additions & 3 deletions htdocs/core/class/commonobject.class.php
Expand Up @@ -2565,9 +2565,9 @@ function fetchObjectLinked($sourceid=null,$sourcetype='',$targetid=null,$targett

if (! empty($this->linkedObjectsIds))
{
foreach($this->linkedObjectsIds as $objecttype => $objectids)
foreach($this->linkedObjectsIds as $objecttype => $objectids) // $objecttype is a module name ('facture', 'mymodule', ...) or a module name with a suffix ('project_task', 'mymodule_myobj', ...)
{
// Parse element/subelement (ex: project_task)
// Parse element/subelement (ex: project_task, cabinetmed_consultation, ...)
$module = $element = $subelement = $objecttype;
if ($objecttype != 'supplier_proposal' && $objecttype != 'order_supplier' && $objecttype != 'invoice_supplier'
&& preg_match('/^([^_]+)_([^_]+)/i',$objecttype,$regs))
Expand Down Expand Up @@ -2632,7 +2632,7 @@ function fetchObjectLinked($sourceid=null,$sourcetype='',$targetid=null,$targett
if ($conf->$module->enabled && (($element != $this->element) || $alsosametype))
{
dol_include_once('/'.$classpath.'/'.$classfile.'.class.php');
//print '/'.$classpath.'/'.$classfile.'.class.php';
//print '/'.$classpath.'/'.$classfile.'.class.php '.class_exists($classname);
if (class_exists($classname))
{
foreach($objectids as $i => $objectid) // $i is rowid into llx_element_element
Expand Down
10 changes: 5 additions & 5 deletions htdocs/core/class/hookmanager.class.php
Expand Up @@ -117,8 +117,8 @@ function initHooks($arraycontext)
* @param Object $object Object to use hooks on
* @param string $action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...)
* @return mixed For 'addreplace' hooks (doActions,formObjectOptions,pdf_xxx,...): Return 0 if we want to keep standard actions, >0 if we want to stop standard actions, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results by hook and set into ->resArray for caller.
* For 'output' hooks (printLeftBlock, formAddObjectLine, formBuilddocOptions, ...): Return 0, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results bu hook and set into ->resArray for caller.
* All types can also return some values into an array ->results.
* For 'output' hooks (printLeftBlock, formAddObjectLine, formBuilddocOptions, ...): Return 0, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results by hook and set into ->resArray for caller.
* All types can also return some values into an array ->results that will be finaly merged into this->resArray for caller.
* $this->error or this->errors are also defined by class called by this function if error.
*/
function executeHooks($method, $parameters=false, &$object='', &$action='')
Expand Down Expand Up @@ -173,11 +173,11 @@ function executeHooks($method, $parameters=false, &$object='', &$action='')
'printObjectSubLine',
'createDictionaryFieldList',
'editDictionaryFieldlist',
'getFormMail'
'getFormMail',
'showLinkToObjectBlock'
)
)) $hooktype='addreplace';
// Deprecated hook types ('returnvalue')
//if (preg_match('/^pdf_/',$method) && $method != 'pdf_writelinedesc') $hooktype='returnvalue'; // pdf_xxx except pdf_writelinedesc are 'returnvalue' hooks. When there is 2 hooks of this type, only last one win. TODO Move them into 'output' or 'addreplace' hooks.

if ($method == 'insertExtraFields')
{
$hooktype='returnvalue'; // deprecated. TODO Remove all code with "executeHooks('insertExtraFields'" as soon as there is a trigger available.
Expand Down
28 changes: 25 additions & 3 deletions htdocs/core/class/html.form.class.php
Expand Up @@ -5391,6 +5391,7 @@ function showLinkedObjectBlock($object, $morehtmlright='')
global $noMoreLinkedObjectBlockAfter;
$noMoreLinkedObjectBlockAfter=1;
}

$res=@include dol_buildpath($reldir.'/'.$tplname.'.tpl.php');
if ($res)
{
Expand Down Expand Up @@ -5439,7 +5440,27 @@ function showLinkToObjectBlock($object, $restrictlinksto=array(), $excludelinkst
'order_supplier'=>array('enabled'=>$conf->fournisseur->commande->enabled , 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id),
'invoice_supplier'=>array('enabled'=>$conf->fournisseur->facture->enabled , 'perms'=>1, 'label'=>'LinkToSupplierInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc = ".$object->thirdparty->id)
);


global $action;

// Can complet the possiblelink array
$hookmanager->initHooks(array('commonobject'));
$parameters=array();
$reshook=$hookmanager->executeHooks('showLinkToObjectBlock',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook))
{
if (is_array($hookmanager->resArray) && count($hookmanager->resArray))
{
$possiblelinks=array_merge($possiblelinks, $hookmanager->resArray);
}
}
else if ($reshook > 0)
{
if (is_array($hookmanager->resArray) && count($hookmanager->resArray))
{
$possiblelinks=$hookmanager->resArray;
}
}

foreach($possiblelinks as $key => $possiblelink)
{
Expand All @@ -5451,6 +5472,7 @@ function showLinkToObjectBlock($object, $restrictlinksto=array(), $excludelinkst
{
print '<div id="'.$key.'list"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display:none"':'').'>';
$sql = $possiblelink['sql'];

$resqllist = $this->db->query($sql);
if ($resqllist)
{
Expand All @@ -5466,7 +5488,7 @@ function showLinkToObjectBlock($object, $restrictlinksto=array(), $excludelinkst
print '<td class="nowrap"></td>';
print '<td align="center">' . $langs->trans("Ref") . '</td>';
print '<td align="left">' . $langs->trans("RefCustomer") . '</td>';
print '<td align="left">' . $langs->trans("AmountHTShort") . '</td>';
print '<td align="right">' . $langs->trans("AmountHTShort") . '</td>';
print '<td align="left">' . $langs->trans("Company") . '</td>';
print '</tr>';
while ($i < $num)
Expand All @@ -5480,7 +5502,7 @@ function showLinkToObjectBlock($object, $restrictlinksto=array(), $excludelinkst
print '</td>';
print '<td align="center">' . $objp->ref . '</td>';
print '<td>' . $objp->ref_client . '</td>';
print '<td>' . price($objp->total_ht) . '</td>';
print '<td align="right">' . price($objp->total_ht) . '</td>';
print '<td>' . $objp->name . '</td>';
print '</tr>';
$i++;
Expand Down
27 changes: 13 additions & 14 deletions htdocs/core/class/translate.class.php
Expand Up @@ -29,17 +29,16 @@
*/
class Translate
{
var $dir; // Directories that contains /langs subdirectory
public $dir; // Directories that contains /langs subdirectory

var $defaultlang; // Current language for current user
var $direction = 'ltr'; // Left to right or Right to left
var $charset_output='UTF-8'; // Codage used by "trans" method outputs
public $defaultlang; // Current language for current user
public $charset_output='UTF-8'; // Codage used by "trans" method outputs

var $tab_translate=array(); // Array of all translations key=>value
private $_tab_loaded=array(); // Array to store result after loading each language file
public $tab_translate=array(); // Array of all translations key=>value
private $_tab_loaded=array(); // Array to store result after loading each language file

var $cache_labels=array(); // Cache for labels return by getLabelFromKey method
var $cache_currencies=array(); // Cache to store currency symbols
public $cache_labels=array(); // Cache for labels return by getLabelFromKey method
public $cache_currencies=array(); // Cache to store currency symbols



Expand Down Expand Up @@ -197,7 +196,7 @@ function load($domain,$alt=0,$stopafterdirection=0,$forcelangdir='',$loadfromfil

// Redefine alt
$langarray=explode('_',$langofdir);
if ($alt < 1 && isset($langarray[1]) && strtolower($langarray[0]) == strtolower($langarray[1])) $alt=1;
if ($alt < 1 && isset($langarray[1]) && (strtolower($langarray[0]) == strtolower($langarray[1]) || in_array(strtolower($langofdir), array('el_gr')))) $alt=1;
if ($alt < 2 && strtolower($langofdir) == 'en_us') $alt=2;

if (empty($langofdir)) // This may occurs when load is called without setting the language and without providing a value for forcelangdir
Expand Down Expand Up @@ -308,31 +307,31 @@ function load($domain,$alt=0,$stopafterdirection=0,$forcelangdir='',$loadfromfil
}
}

// Now we complete with next file
// Now we complete with next file (fr_CA->fr_FR, es_MX->ex_ES, ...)
if ($alt == 0)
{
// This function MUST NOT contains call to syslog
//dol_syslog("Translate::Load loading alternate translation file (to complete ".$this->defaultlang."/".$newdomain.".lang file)", LOG_DEBUG);
$langofdir=strtolower($langarray[0]).'_'.strtoupper($langarray[0]);
if ($langofdir == 'el_EL') $langofdir = 'el_GR'; // main parent for el_CY is not el_EL but el_GR
$this->load($domain,$alt+1,$stopafterdirection,$langofdir);
}

// Now we complete with reference en_US/fr_FR/es_ES file
// Now we complete with reference file (en_US)
if ($alt == 1)
{
// This function MUST NOT contains call to syslog
//dol_syslog("Translate::Load loading alternate translation file (to complete ".$this->defaultlang."/".$newdomain.".lang file)", LOG_DEBUG);
$langofdir='en_US';
//if (preg_match('/^fr/i',$langarray[0])) $langofdir='fr_FR';
//if (preg_match('/^es/i',$langarray[0])) $langofdir='es_ES';
$this->load($domain,$alt+1,$stopafterdirection,$langofdir);
}

// We already are the reference file. No more files to scan to complete.
if ($alt == 2)
{
if ($fileread) $this->_tab_loaded[$newdomain]=1; // Set domain file as loaded

if (empty($this->_tab_loaded[$newdomain])) $this->_tab_loaded[$newdomain]=2; // Marque ce fichier comme non trouve
if (empty($this->_tab_loaded[$newdomain])) $this->_tab_loaded[$newdomain]=2; // Set this file as found
}

// This part is deprecated and replaced with table llx_overwrite_trans
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/lib/functions.lib.php
Expand Up @@ -2507,7 +2507,7 @@ function img_edit($titlealt = 'default', $float = 0, $other = '')

if ($titlealt == 'default') $titlealt = $langs->trans('Modify');

return img_picto($titlealt, 'edit.png', ($float ? 'style="float: right"' : $other));
return img_picto($titlealt, 'edit.png', ($float ? 'style="float: '.($langs->tab_translate["DIRECTION"] == 'rtl'?'left':'right').'"' : $other));
}

/**
Expand Down

0 comments on commit 5362d10

Please sign in to comment.