Merge remote-tracking branch 'origin/3.6' into 3.7

Conflicts:
	ChangeLog
	htdocs/adherents/fiche.php
	htdocs/comm/fiche.php
	htdocs/comm/mailing/fiche.php
	htdocs/comm/propal.php
	htdocs/comm/propal/class/propal.class.php
	htdocs/commande/class/commande.class.php
	htdocs/commande/fiche.php
	htdocs/compta/facture.php
	htdocs/compta/paiement.php
	htdocs/core/class/html.formcompany.class.php
	htdocs/core/tpl/login.tpl.php
	htdocs/expedition/fiche.php
	htdocs/fourn/commande/fiche.php
	htdocs/fourn/facture/fiche.php
	htdocs/fourn/facture/paiement.php
	htdocs/fourn/fiche.php
	htdocs/main.inc.php
	htdocs/product/fournisseurs.php
	htdocs/resource/card.php
This commit is contained in:
Laurent Destailleur 2015-01-18 17:13:42 +01:00
commit 5c5ff72ecd
36 changed files with 5525 additions and 5420 deletions

View File

@ -52,6 +52,9 @@ http://www.fsf.org/licensing/licenses/index_html
Copyright
---------
Copyright (C) 2015
- Marcos García <marcosgdf@gmail.com>
Copyright (C) 2014
- Laurent Destailleur <eldy@users.sourceforge.net>
- Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>

View File

@ -174,6 +174,18 @@ Dolibarr better:
- Fix: ref_ext was not saved when recording a customer order from web service
- Fix: amarok is a bugged theme making dolidroid failed. We swith to eldy automatically with dolidroid.
- Fix: withdrawal create error if in the same month are deleted previus withdrawals.
- Fix: [ bug #1788 ] Duplicated doActions hook in product/fournisseurs.php
- Fix: withdrawal create error if in the same month are deleted previus withdrawals.
- Fix: [ bug #1801 ] FAC_FORCE_DATE_VALIDATION constant alters supplier invoice date given to numeration modules
- Fix: [ bug #1802 ] SQL error when updating a task with PostgreSQL database
- Fix: [ bug #1785 ] Start date is lost in Project > Linked objects
- Fix: [ bug #1804 ] SQL error when sending email without addresee
- Fix: [ bug #1803 ] AJAX company contact input is not aligned
- Fix: [ bug #1787 ] Incorrect behaviour of doActions hook
- Fix: [ bug #1796 ] Unable to use numeration modules from an external module
- Fix: [ bug #1783 ] SQL error when enabling 3rd party module with PostgreSQL and MySQL strict mode ON
- Fix: [ bug #1717 ] Sorting unpaid invoices by amount received brings due amount
- Fix: [ bug #1784 ] MOTD doesn't show up in Amarok theme
***** ChangeLog for 3.6.2 compared to 3.6.1 *****
- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice.
@ -338,6 +350,8 @@ Fix: Paypal link were broken dur to SSL v3 closed.
Fix: [ bug #1769 ] Error when installing to a PostgreSQL DB that contains numbers
Fix: [ bug #1752 ] Date filter of margins module, filters since 12H instead of 00H
Fix: [ bug #1757 ] Sorting breaks product/service statistics
Fix: [ bug #1797 ] Tulip supplier invoice module takes creation date instead of invoice date
Fix: [ bug #1792 ] Users are not allowed to see margins module index page when no product view permission is enabled
***** ChangeLog for 3.5.6 compared to 3.5.5 *****
Fix: Avoid missing class error for fetch_thirdparty method #1973

View File

@ -119,6 +119,8 @@ $parameters=array('rowid'=>$rowid, 'objcanvas'=>$objcanvas);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights->user->user->creer))
{
$error=0;
@ -682,7 +684,7 @@ if ($user->rights->adherent->creer && $action == 'confirm_add_spip' && $confirm
}
}
}
}
/*

View File

@ -66,6 +66,7 @@ $pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="nom";
$cancelbutton = GETPOST('cancel');
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('commcard','globalcard'));
@ -80,9 +81,8 @@ $parameters = array('socid' => $id);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
//Some actions show a "cancel" input submit button with name="cancel"
$cancelbutton = GETPOST('cancel');
if (empty($reshook))
{
if ($action == 'setcustomeraccountancycode')
{
if (! $cancelbutton)
@ -153,6 +153,7 @@ if ($action == 'setOutstandingBill')
if ($result < 0) setEventMessage($object->error,'errors');
}
}
}
/*

View File

@ -110,6 +110,8 @@ $parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
// Action clone object
if ($action == 'confirm_clone' && $confirm == 'yes')
{
@ -649,20 +651,19 @@ if (! empty($_POST["cancel"]))
{
$action = '';
}
}
/*
* View
*/
$form = new Form($db);
$htmlother = new FormOther($db);
$help_url='EN:Module_EMailing|FR:Module_Mailing|ES:M&oacute;dulo_Mailing';
llxHeader('',$langs->trans("Mailing"),$help_url);
$form = new Form($db);
$htmlother = new FormOther($db);
if ($action == 'create')
{
// EMailing in creation mode

View File

@ -108,6 +108,8 @@ $parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once
// Action clone object
@ -1146,6 +1148,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->propal->
}
}
}
}
/*
* View

View File

@ -2550,21 +2550,18 @@ class Propal extends CommonObject
{
$mybool=false;
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir)
{
$file = $conf->global->PROPALE_ADDON.".php";
$classname = $conf->global->PROPALE_ADDON;
// Include file with class
foreach ($conf->file->dol_document_root as $dirroot)
{
$dir = $dirroot.$reldir."/core/modules/propale/";
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$dir = dol_buildpath($reldir."core/modules/propale/");
// Load file with numbering class (if found)
$mybool|=@include_once $dir.$file;
}
}
if (! $mybool)
{

View File

@ -177,12 +177,14 @@ $parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook)) {
if ($action == 'cstc')
{
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm = ".$_GET["pstcomm"];
$sql .= " WHERE rowid = ".$_GET["socid"];
$result=$db->query($sql);
}
}
/*

View File

@ -102,6 +102,8 @@ $parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once
// Action clone object
@ -1198,6 +1200,8 @@ if (! $error && ! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->righ
}
}
}
}
/*
* View

View File

@ -141,20 +141,19 @@ class Commande extends CommonOrder
if (! empty($conf->global->COMMANDE_ADDON))
{
$mybool=false;
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir)
{
$file = $conf->global->COMMANDE_ADDON.".php";
$classname = $conf->global->COMMANDE_ADDON;
// Include file with class
foreach ($conf->file->dol_document_root as $dirroot)
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir)
{
$dir = $dirroot.$reldir."/core/modules/commande/";
$dir = dol_buildpath($reldir."core/modules/commande/");
// Load file with numbering class (if found)
$mybool|=@include_once $dir.$file;
}
}
if (! $mybool)
{

View File

@ -105,6 +105,7 @@ $hookmanager->initHooks(array('invoicecard','globalcard'));
$permissionnote = $user->rights->facture->creer; // Used by the include of actions_setnotes.inc.php
/*
* Actions
*/
@ -113,6 +114,8 @@ $parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once
// Action clone object
@ -1689,7 +1692,7 @@ if ($action == 'update_extras') {
if ($error)
$action = 'edit_extras';
}
}
/*

View File

@ -2497,14 +2497,20 @@ class Facture extends CommonInvoice
else if ($conf->global->FACTURE_ADDON=='terre') $conf->global->FACTURE_ADDON='mod_facture_terre';
else if ($conf->global->FACTURE_ADDON=='mercure') $conf->global->FACTURE_ADDON='mod_facture_mercure';
if (! empty($conf->global->FACTURE_ADDON))
{
$mybool=false;
$file = $conf->global->FACTURE_ADDON.".php";
$classname = $conf->global->FACTURE_ADDON;
// Include file with class
foreach ($conf->file->dol_document_root as $dirroot)
{
$dir = $dirroot."/core/modules/facture/";
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$dir = dol_buildpath($reldir."core/modules/facture/");
// Load file with numbering class (if found)
$mybool|=@include_once $dir.$file;
}
@ -2523,7 +2529,6 @@ class Facture extends CommonInvoice
$mybool|=@include_once $dir.$file;
}
}
//print "xx".$mybool.$dir.$file."-".$classname;
if (! $mybool)
{
@ -2533,7 +2538,7 @@ class Facture extends CommonInvoice
$obj = new $classname();
$numref = "";
$numref = $obj->getNumRef($soc,$this,$mode);
$numref = $obj->getNextValue($soc,$this,$mode);
if ($numref != "")
{
@ -2541,8 +2546,15 @@ class Facture extends CommonInvoice
}
else
{
//dol_print_error($db,get_class($this)."::getNextNumRef ".$obj->error);
return false;
dol_print_error($db,"Facture::getNextNumRef ".$obj->error);
return "";
}
}
else
{
$langs->load("errors");
print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete");
return "";
}
}

View File

@ -551,7 +551,7 @@ if ($resql)
print_liste_field_titre($langs->trans("Taxes"),$_SERVER["PHP_SELF"],"f.tva","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Received"),$_SERVER["PHP_SELF"],"am","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Rest"),$_SERVER["PHP_SELF"],"am","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Rest"),$_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye,am","",$param,'align="right"',$sortfield,$sortorder);
if (empty($mode))
{

View File

@ -69,15 +69,17 @@ if ($facid > 0)
// Initialize technical object to manage hooks of paiements. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('paiementcard','globalcard'));
$parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
/*
* Actions
*/
$parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='yes'))
{
$error = 0;
@ -249,6 +251,7 @@ if ($action == 'confirm_paiement' && $confirm == 'yes')
$db->rollback();
}
}
}
/*

View File

@ -211,23 +211,31 @@ class Contrat extends CommonObject
global $db, $langs, $conf;
$langs->load("contracts");
$dir = DOL_DOCUMENT_ROOT . "/core/modules/contract";
if (empty($conf->global->CONTRACT_ADDON))
if (!empty($conf->global->CONTRACT_ADDON))
{
$conf->global->CONTRACT_ADDON='mod_contract_serpis';
}
$mybool = false;
$file = $conf->global->CONTRACT_ADDON.".php";
// Chargement de la classe de numerotation
$classname = $conf->global->CONTRACT_ADDON;
$result=include_once $dir.'/'.$file;
if ($result)
{
$obj = new $classname();
// Include file with class
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$dir = dol_buildpath($reldir."core/modules/contract/");
// Load file with numbering class (if found)
$mybool|=@include_once $dir.$file;
}
if (! $mybool)
{
dol_print_error('',"Failed to include file ".$file);
return '';
}
$obj = new $classname();
$numref = "";
$numref = $obj->getNextValue($soc,$this);
@ -237,13 +245,15 @@ class Contrat extends CommonObject
}
else
{
$this->error = $obj->error;
dol_print_error($db,get_class($this)."::getNextValue ".$obj->error);
return "";
}
}
else
{
print $langs->trans("Error")." ".$langs->trans("Error_CONTRACT_ADDON_NotDefined");
$langs->load("errors");
print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete");
return "";
}
}

View File

@ -612,8 +612,7 @@ class FormCompany
}
print "\n".'<!-- Input text for third party with Ajax.Autocompleter (selectCompaniesForNewContact) -->'."\n";
//print '<table class="nobordernopadding"><tr class="nobordernopadding">';
//print '<td class="nobordernopadding">';
if ($obj->rowid == 0)
{
print '<input type="text" size="30" id="search_'.$htmlname.'" name="search_'.$htmlname.'" value="" '.$htmloption.' />';
@ -623,10 +622,9 @@ class FormCompany
print '<input type="text" size="30" id="search_'.$htmlname.'" name="search_'.$htmlname.'" value="'.$obj->name.'" '.$htmloption.' />';
}
print ajax_autocompleter(($socid?$socid:-1),$htmlname,DOL_URL_ROOT.'/societe/ajaxcompanies.php','',$minLength);
//print '</td>';
//print '</tr>';
//print '</table>';
//print "\n";
print "\n";
return $socid;
}
else

View File

@ -152,7 +152,7 @@ class Menubase
$sql.= " '".$this->fk_menu."',";
$sql.= " ".($this->fk_mainmenu?"'".$this->fk_mainmenu."'":"null").",";
$sql.= " ".($this->fk_leftmenu?"'".$this->fk_leftmenu."'":"null").",";
$sql.= " '".$this->position."',";
$sql.= " '".(int) $this->position."',";
$sql.= " '".$this->db->escape($this->url)."',";
$sql.= " '".$this->db->escape($this->target)."',";
$sql.= " '".$this->db->escape($this->titre)."',";

View File

@ -883,6 +883,8 @@ abstract class DolibarrModules
$err=0;
if (empty($this->const)) return 0;
foreach ($this->const as $key => $value)
{
$name = $this->const[$key][0];
@ -950,6 +952,8 @@ abstract class DolibarrModules
$err=0;
if (empty($this->const)) return 0;
foreach ($this->const as $key => $value)
{
$name = $this->const[$key][0];

View File

@ -125,7 +125,8 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices
return 0;
}
$numFinal=get_next_value($db,$mask,'facture_fourn','ref','',$objsoc->code_fournisseur,$object->datef);
//Supplier invoices take invoice date instead of creation date for the mask
$numFinal=get_next_value($db,$mask,'facture_fourn','ref','',$objsoc->code_fournisseur,$object->date);
return $numFinal;
}

View File

@ -353,16 +353,20 @@ if (($action=="create") || ($action=="edit"))
print "<tr><td>";
print $langs->trans('CronEvery')."</td>";
print "<td><select name=\"nbfrequency\">";
for($i=1; $i<=60; $i++){
if(($object->frequency/$object->unitfrequency) == $i){
for($i=1; $i<=60; $i++)
{
if (! empty($object->unitfrequency) && ($object->frequency/$object->unitfrequency) == $i)
{
print "<option value='".$i."' selected='selected'>".$i."</option>";
}
else{
else
{
print "<option value='".$i."'>".$i."</option>";
}
}
$input = "<input type=\"radio\" name=\"unitfrequency\" value=\"60\" id=\"frequency_minute\" ";
if($object->unitfrequency=="60"){
if($object->unitfrequency=="60")
{
$input .= ' checked="checked" />';
}
else{

View File

@ -108,6 +108,8 @@ $parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
if ($action == 'add')
{
$error=0;
@ -436,11 +438,6 @@ if ($action == 'send' && ! GETPOST('addfile','alpha') && ! GETPOST('removedfile'
{
$langs->load('mails');
// $ref = dol_sanitizeFileName($object->ref);
// $file = $conf->expedition->dir_output . '/sending/' . $ref . '/' . $ref . '.pdf';
// if (is_readable($file))
// {
if (GETPOST('sendto','alpha'))
{
// Le destinataire a ete fourni via le champ libre
@ -566,13 +563,6 @@ if ($action == 'send' && ! GETPOST('addfile','alpha') && ! GETPOST('removedfile'
$action='presend';
dol_syslog('Recipient email is empty');
}
/* }
else
{
$langs->load("errors");
$mesg='<div class="error">'.$langs->trans('ErrorCantReadFile',$file).'</div>';
dol_syslog('Failed to read file: '.$file);
}*/
}
else if ($action == 'classifybilled')
@ -580,6 +570,7 @@ else if ($action == 'classifybilled')
$object->fetch($id);
$object->set_billed();
}
}
/*

View File

@ -121,21 +121,30 @@ class Expedition extends CommonObject
global $db, $langs, $conf;
$langs->load("sendings");
$dir = DOL_DOCUMENT_ROOT . "/core/modules/expedition";
if (empty($conf->global->EXPEDITION_ADDON_NUMBER))
if (!empty($conf->global->EXPEDITION_ADDON_NUMBER))
{
$conf->global->EXPEDITION_ADDON_NUMBER='mod_expedition_safor';
}
$mybool = false;
$file = $conf->global->EXPEDITION_ADDON_NUMBER.".php";
// Chargement de la classe de numerotation
$classname = $conf->global->EXPEDITION_ADDON_NUMBER;
$result=include_once $dir.'/'.$file;
if ($result)
// Include file with class
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$dir = dol_buildpath($reldir."core/modules/expedition/");
// Load file with numbering class (if found)
$mybool|=@include_once $dir.$file;
}
if (! $mybool)
{
dol_print_error('',"Failed to include file ".$file);
return '';
}
$obj = new $classname();
$numref = "";
$numref = $obj->getNextValue($soc,$this);

View File

@ -585,25 +585,33 @@ class Fichinter extends CommonObject
global $conf, $db, $langs;
$langs->load("interventions");
$dir = DOL_DOCUMENT_ROOT . "/core/modules/fichinter/";
if (! empty($conf->global->FICHEINTER_ADDON))
{
$file = $conf->global->FICHEINTER_ADDON.".php";
$classname = $conf->global->FICHEINTER_ADDON;
if (! file_exists($dir.$file))
{
$file='mod_'.$file;
$classname='mod_'.$classname;
$mybool = false;
$file = "mod_".$conf->global->FICHEINTER_ADDON.".php";
$classname = "mod_".$conf->global->FICHEINTER_ADDON;
// Include file with class
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$dir = dol_buildpath($reldir."core/modules/fichinter/");
// Load file with numbering class (if found)
$mybool|=@include_once $dir.$file;
}
// Chargement de la classe de numerotation
require_once $dir.$file;
if (! $mybool)
{
dol_print_error('',"Failed to include file ".$file);
return '';
}
$obj = new $classname();
$numref = "";
$numref = $obj->getNumRef($soc,$this);
$numref = $obj->getNextValue($soc,$this);
if ( $numref != "")
{
@ -617,6 +625,7 @@ class Fichinter extends CommonObject
}
else
{
$langs->load("errors");
print $langs->trans("Error")." ".$langs->trans("Error_FICHEINTER_ADDON_NotDefined");
return "";
}

View File

@ -60,6 +60,8 @@ $parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
if ($action == 'setsupplieraccountancycode')
{
$cancelbutton = GETPOST('cancel');
@ -89,6 +91,7 @@ if ($action == 'setmode' && $user->rights->societe->creer)
$result=$object->setPaymentMethods(GETPOST('mode_reglement_supplier_id','int'));
if ($result < 0) dol_print_error($db,$object->error);
}
}
/*

View File

@ -557,23 +557,32 @@ class CommandeFournisseur extends CommonOrder
global $db, $langs, $conf;
$langs->load("orders");
$dir = DOL_DOCUMENT_ROOT .'/core/modules/supplier_order/';
if (! empty($conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER))
{
$mybool = false;
$file = $conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER.'.php';
$classname=$conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER;
if (is_readable($dir.'/'.$file))
// Include file with class
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$dir = dol_buildpath($reldir."core/modules/supplier_order/");
// Load file with numbering class (if found)
$mybool|=@include_once $dir.$file;
}
if (! $mybool)
{
// Definition du nom de modele de numerotation de commande fournisseur
$modName=$conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER;
require_once $dir.'/'.$file;
dol_print_error('',"Failed to include file ".$file);
return '';
}
// Recuperation de la nouvelle reference
$objMod = new $modName($this->db);
$numref = "";
$numref = $objMod->commande_get_num($soc,$this);
$obj = new $classname();
$numref = $obj->getNextValue($soc,$this);
if ( $numref != "")
{
@ -581,22 +590,17 @@ class CommandeFournisseur extends CommonOrder
}
else
{
$this->error = $obj->error;
dol_print_error($db, get_class($this)."::getNextNumRef ".$obj->error);
return -1;
}
}
else
{
print $langs->trans("Error")." ".$langs->trans("Error_FailedToLoad_COMMANDE_SUPPLIER_ADDON_File",$conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER);
$this->error = "Error_COMMANDE_SUPPLIER_ADDON_NotDefined";
return -2;
}
}
else
{
print $langs->trans("Error")." ".$langs->trans("Error_COMMANDE_SUPPLIER_ADDON_NotDefined");
return -3;
}
}
/**
* Accept an order

View File

@ -1514,10 +1514,14 @@ class FactureFournisseur extends CommonInvoice
$file = $conf->global->INVOICE_SUPPLIER_ADDON_NUMBER.".php";
$classname = $conf->global->INVOICE_SUPPLIER_ADDON_NUMBER;
// Include file with class
foreach ($conf->file->dol_document_root as $dirroot)
{
$dir = $dirroot."/core/modules/supplier_invoice/";
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) {
$dir = dol_buildpath($reldir."core/modules/supplier_invoice/");
// Load file with numbering class (if found)
$mybool|=@include_once $dir.$file;
}

View File

@ -66,15 +66,18 @@ if ($user->societe_id > 0)
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('paymentsupplier'));
$parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
/*
* Actions
*/
$parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='yes'))
{
$error = 0;
@ -227,7 +230,7 @@ if ($action == 'confirm_paiement' && $confirm == 'yes')
}
}
}
}
/*

View File

@ -1033,7 +1033,7 @@ SendingMailSetup=Setup of sendings by email
SendmailOptionNotComplete=Warning, on some Linux systems, to send email from your email, sendmail execution setup must contains option -ba (parameter mail.force_extra_parameters into your php.ini file). If some recipients never receive emails, try to edit this PHP parameter with mail.force_extra_parameters = -ba).
PathToDocuments=Path to documents
PathDirectory=Directory
SendmailOptionMayHurtBuggedMTA=Feature to send mails using method "PHP mail direct" will generate a mail message that might be not correctly parsed by some receiving mail servers. Result is that some mails can't be read by people hosted by thoose bugged platforms. It's case for some Internet providers (Ex: Orange in France). This is not a problem into Dolibarr nor into PHP but onto receiving mail server. You can however add option MAIN_FIX_FOR_BUGGED_MTA to 1 into setup - other to modify Dolibarr to avoid this. However, you may experience problem with other servers that respect strictly the SMTP standard. The other solution (recommanded) is to use the method "SMTP socket library" that has no disadvantages.
SendmailOptionMayHurtBuggedMTA=Feature to send mails using method "PHP mail direct" will generate a mail message that might be not correctly parsed by some receiving mail servers. Result is that some mails can't be read by people hosted by those bugged platforms. It's case for some Internet providers (Ex: Orange in France). This is not a problem into Dolibarr nor into PHP but onto receiving mail server. You can however add option MAIN_FIX_FOR_BUGGED_MTA to 1 into setup - other to modify Dolibarr to avoid this. However, you may experience problem with other servers that respect strictly the SMTP standard. The other solution (recommended) is to use the method "SMTP socket library" that has no disadvantages.
TranslationSetup=Configuration de la traduction
TranslationDesc=Choice of language visible on screen can be modified:<br>* Globally from menu <strong>Home - Setup - Display</strong><br>* For user only from tab <strong>User display</strong> of user card (click on login on top of screen).
TotalNumberOfActivatedModules=Total number of activated feature modules: <b>%s</b>
@ -1410,7 +1410,7 @@ AdvancedEditor=Advanced editor
ActivateFCKeditor=Activate advanced editor for:
FCKeditorForCompany=WYSIWIG creation/edition of elements description and note (except products/services)
FCKeditorForProduct=WYSIWIG creation/edition of products/services description and note
FCKeditorForProductDetails=WYSIWIG creation/edition of products details lines for all entities (proposals, orders, invoices, etc...). <font class="warning">Warning: Using this option for this case is seriously not recommanded as it can create problems with special characters and page formating when building PDF files.</font>
FCKeditorForProductDetails=WYSIWIG creation/edition of products details lines for all entities (proposals, orders, invoices, etc...). <font class="warning">Warning: Using this option for this case is seriously not recommended as it can create problems with special characters and page formating when building PDF files.</font>
FCKeditorForMailing= WYSIWIG creation/edition for mass eMailings (Tools->eMailing)
FCKeditorForUserSignature=WYSIWIG creation/edition of user signature
FCKeditorForMail=WYSIWIG creation/edition for all mail (except Outils->eMailing)

View File

@ -260,6 +260,7 @@ days=days
Hours=Hours
Minutes=Minutes
Seconds=Seconds
Weeks=Weeks
Today=Today
Yesterday=Yesterday
Tomorrow=Tomorrow

View File

@ -736,7 +736,7 @@ if ((! empty($conf->browser->layout) && $conf->browser->layout == 'phone')
// If we force to use jmobile, then we reenable javascript
if (! empty($conf->dol_use_jmobile)) $conf->use_javascript_ajax=1;
// Replace themes bugged with jmobile with eldy
if (! empty($conf->dol_use_jmobile) && in_array($conf->theme,array('bureau2crea','cameleo')))
if (! empty($conf->dol_use_jmobile) && in_array($conf->theme,array('bureau2crea','cameleo','amarok')))
{
$conf->theme='eldy';
$conf->css = "/theme/".$conf->theme."/style.css.php";

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -21,5 +22,15 @@
* \brief Page d'index du module margin
*/
require 'productMargins.php';
require '../main.inc.php';
if ($user->rights->produit->lire) {
$page = 'productMargins';
} elseif ($user->rights->societe->lire) {
$page = 'customerMargins';
} else {
$page = 'agentMargins';
}
header('Location: '.dol_buildpath('/margin/'.$page.'.php', 1));

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -56,21 +57,25 @@ function marges_admin_prepare_head()
*/
function marges_prepare_head()
{
global $langs, $conf;
global $langs, $conf, $user;
$langs->load("marges@marges");
$h = 0;
$head = array();
if ($user->rights->produit->lire) {
$head[$h][0] = DOL_URL_ROOT."/margin/productMargins.php";
$head[$h][1] = $langs->trans("ProductMargins");
$head[$h][2] = 'productMargins';
$h++;
}
if ($user->rights->societe->lire) {
$head[$h][0] = DOL_URL_ROOT."/margin/customerMargins.php";
$head[$h][1] = $langs->trans("CustomerMargins");
$head[$h][2] = 'customerMargins';
$h++;
}
$head[$h][0] = DOL_URL_ROOT."/margin/agentMargins.php";
$head[$h][1] = $langs->trans("SalesRepresentativeMargins");

View File

@ -73,16 +73,20 @@ if ($id > 0 || ! empty($ref))
}
$modulepart='produit';
/*
* Actions
*/
$parameters=array('id'=>$id);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
/*
* Action envoie fichier
*/
if (empty($reshook))
{
// Action sending file
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_pre_headers.tpl.php';
}
/*

View File

@ -78,6 +78,7 @@ $parameters=array('socid'=>$socid, 'id_prod'=>$id);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$product,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook)) {
if ($action == 'remove_pf')
{
$product = new ProductFournisseur($db);
@ -194,7 +195,7 @@ if (GETPOST('cancel') == $langs->trans("Cancel"))
header("Location: fournisseurs.php?id=".$_GET["id"]);
exit;
}
}
/*

View File

@ -145,12 +145,12 @@ print '<tr><td>'.$langs->trans("Status").'</td><td>'.$project->getLibStatut(4).'
// Date start
print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
print dol_print_date($object->date_start,'day');
print dol_print_date($project->date_start,'day');
print '</td></tr>';
// Date end
print '<tr><td>'.$langs->trans("DateEnd").'</td><td>';
print dol_print_date($object->date_end,'day');
print dol_print_date($project->date_end,'day');
print '</td></tr>';
print '</table>';

View File

@ -62,11 +62,10 @@ $parameters=array('resource_id'=>$id);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
/*******************************************************************
* ACTIONS
*
* Put here all code to do according to value of "action" parameter
********************************************************************/
if ($action == 'update' && ! $_POST["cancel"] && $user->rights->resource->write )
@ -76,7 +75,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->resource->write
if (empty($ref))
{
$error++;
$mesg='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref")).'</div>';
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Ref")), 'errors');
}
if (! $error)
@ -96,7 +95,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->resource->write
}
else
{
setEventMessage('<div class="error">'.$object->error.'</div>');
setEventMessage($object->error, 'errors');
$action='edit';
}
@ -112,7 +111,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->resource->write
$action='edit';
}
}
}
/***************************************************
* VIEW