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

Conflicts:
	htdocs/compta/facture.php
	htdocs/contrat/class/contrat.class.php
	htdocs/core/lib/company.lib.php
	htdocs/core/lib/functions.lib.php
	htdocs/main.inc.php
This commit is contained in:
Laurent Destailleur 2015-01-09 23:09:10 +01:00
commit fc78d632d3
39 changed files with 522 additions and 317 deletions

View File

@ -186,6 +186,8 @@ Dolibarr better:
- If you used warehouse/stock module, recheck setup of stock increase/decrease rules of the
warehouse module and your Point Of Sale module if you use one.
***** ChangeLog for 3.6.3 compared to 3.6.2 *****
- Fix: ref_ext was not saved when recording a customer order from web service
***** ChangeLog for 3.6.2 compared to 3.6.1 *****
- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice.

1
htdocs/.gitignore vendored
View File

@ -1,5 +1,4 @@
/test.php
/custom*
/extensions*
/nltechno*
/ancot*

View File

@ -520,17 +520,17 @@ else
$var=!$var;
print "<tr ".$bc[$var].">\n";
$url='http://www.dolistore.com';
print '<td align="left"><a href="'.$url.'" target="_blank"><img border="0" width="180" src="'.DOL_URL_ROOT.'/theme/dolistore_logo.png"></a></td>';
print '<td align="left"><a href="'.$url.'" target="_blank" rel="external"><img border="0" width="180" src="'.DOL_URL_ROOT.'/theme/dolistore_logo.png"></a></td>';
print '<td>'.$langs->trans("DoliStoreDesc").'</td>';
print '<td><a href="'.$url.'" target="_blank">'.$url.'</a></td>';
print '<td><a href="'.$url.'" target="_blank" rel="external">'.$url.'</a></td>';
print '</tr>';
$var=!$var;
print "<tr ".$bc[$var].">\n";
$url='http://partners.dolibarr.org';
print '<td align="left"><a href="'.$url.'" target="_blank"><img border="0" width="180" src="'.DOL_URL_ROOT.'/theme/dolibarr_preferred_partner_int.png"></a></td>';
print '<td align="left"><a href="'.$url.'" target="_blank" rel="external"><img border="0" width="180" src="'.DOL_URL_ROOT.'/theme/dolibarr_preferred_partner_int.png"></a></td>';
print '<td>'.$langs->trans("DoliPartnersDesc").'</td>';
print '<td><a href="'.$url.'" target="_blank">'.$url.'</a></td>';
print '<td><a href="'.$url.'" target="_blank" rel="external">'.$url.'</a></td>';
print '</tr>';
print "</table>\n";

View File

@ -51,8 +51,8 @@ print '</ul>';
print $langs->trans("Developpers").':';
print '<ul>';
print '<li>'.$langs->trans("SeeWikiForAllTeam").': <a href="http://wiki.dolibarr.org/index.php/Dolibarr_Project" target="_blank">http://wiki.dolibarr.org/index.php/Dolibarr_Project</a></li>';
print '<li>'.$langs->trans("DoliForge").': <a href="http://www.doliforge.org" target="_blank">http://wwww.doliforge.org</a></li>';
print '<li>'.$langs->trans("SeeWikiForAllTeam").': <a href="http://wiki.dolibarr.org/index.php/Dolibarr_Project" target="_blank" rel="external">http://wiki.dolibarr.org/index.php/Dolibarr_Project</a></li>';
print '<li>'.$langs->trans("DoliForge").': <a href="http://www.doliforge.org" target="_blank" rel="external">http://wwww.doliforge.org</a></li>';
print '</ul>';
//print "<br>\n";
@ -61,31 +61,31 @@ print $langs->trans("OtherInformations").':';
print '<ul>';
print '<li>';
print '<a target="_blank" href="http://www.dolibarr.org/">'.$langs->trans("OfficialWebSite").'</a>';
print '<a target="_blank" href="http://www.dolibarr.org/" rel="external">'.$langs->trans("OfficialWebSite").'</a>';
print '</li>';
// If the French language, it displays French website
if (preg_match('/^fr_/i',$langs->getDefaultLang()))
{
print '<li>';
print '<a target="_blank" href="http://www.dolibarr.fr/">'.$langs->trans("OfficialWebSiteFr").'</a>';
print '<a target="_blank" href="http://www.dolibarr.fr/" rel="external">'.$langs->trans("OfficialWebSiteFr").'</a>';
print '</li>';
}
print '<li>';
print '<a target="_blank" href="http://wiki.dolibarr.org/">'.$langs->trans("OfficialWiki").'</a>';
print '<a target="_blank" href="http://wiki.dolibarr.org/" rel="external">'.$langs->trans("OfficialWiki").'</a>';
print '</li>';
print '</ul>';
print $langs->trans("Demo").':';
print '<ul>';
print '<li>';
print '<a target="_blank" href="http://www.dolibarr.org/onlinedemo/">'.$langs->trans("OfficialDemo").'</a>';
print '<a target="_blank" href="http://www.dolibarr.org/onlinedemo/" rel="external">'.$langs->trans("OfficialDemo").'</a>';
print '</li>';
print '</ul>';
print $langs->trans("ModulesMarketPlaces").':';
print '<ul>';
print '<li>';
print '<a target="_blank" href="http://www.dolistore.com">'.$langs->trans("OfficialMarketPlace").'</a>';
print '<a target="_blank" href="http://www.dolistore.com" rel="external">'.$langs->trans("OfficialMarketPlace").'</a>';
print '</li>';
print '</ul>';
@ -94,7 +94,7 @@ print $langs->trans("HelpCenter").':';
print '<ul>';
print '<li>';
//print $langs->trans("SeeWikiPage",'http://wiki.dolibarr.org/index.php/List_of_OpenSource_Software_companies_and_freelancers');
print '<a target="_blank" href="'.DOL_URL_ROOT.'/support/index.php">'.$langs->trans("HelpCenter").'</a>';
print '<a target="_blank" href="'.DOL_URL_ROOT.'/support/index.php" data-ajax="false">'.$langs->trans("HelpCenter").'</a>';
print '</li>';
print '</ul>';
@ -104,11 +104,11 @@ print '<ul>';
$url='http://wiki.dolibarr.org/index.php/Subscribe';
if (preg_match('/^fr_/i',$langs->getDefaultLang())) $url='http://wiki.dolibarr.org/index.php/Adh%C3%A9rer';
if (preg_match('/^es_/i',$langs->getDefaultLang())) $url='http://wiki.dolibarr.org/index.php/Subscribirse';
print '<li><a href="'.$url.'" target="_blank">'.$langs->trans("SubscribeToFoundation").'</a></li>';
print '<li><a href="'.$url.'" target="_blank" rel="external">'.$langs->trans("SubscribeToFoundation").'</a></li>';
print '<li><a href="http://facebook.com/dolibarr" target="_blank">FaceBook</a></li>';
print '<li><a href="http://twitter.com/dolibarr" target="_blank">Twitter</a></li>';
print '<li><a href="http://plus.google.com/+DolibarrOrg" target="_blank">Google Plus page</a></li>';
print '<li><a href="http://facebook.com/dolibarr" target="_blank" rel="external">FaceBook</a></li>';
print '<li><a href="http://twitter.com/dolibarr" target="_blank" rel="external">Twitter</a></li>';
print '<li><a href="http://plus.google.com/+DolibarrOrg" target="_blank" rel="external">Google Plus page</a></li>';
print '</ul>';
@ -120,11 +120,11 @@ $url='http://saas.dolibarr.org'; $title=$langs->trans("OfficialWebHostingService
if (preg_match('/^fr_/i',$langs->getDefaultLang())) $url='http://wiki.dolibarr.org/index.php/Solutions_de_Cloud';
if (preg_match('/^es_/i',$langs->getDefaultLang())) $url='http://wiki.dolibarr.org/index.php/Soluciones_en_la_Nube';
print '<li>';
print '<a target="_blank" href="'.$url.'">'.$title.'</a>';
print '<a target="_blank" href="'.$url.'" rel="external">'.$title.'</a>';
print '</li>';
$url='http://partners.dolibarr.org'; $title=$langs->trans("ReferencedPreferredPartners");
print '<li>';
print '<a target="_blank" href="'.$url.'">'.$title.'</a>';
print '<a target="_blank" href="'.$url.'" rel="external">'.$title.'</a>';
print '</li>';
print '</ul>';

View File

@ -485,7 +485,7 @@ function backup_tables($outputfile, $tables='*')
$row[$j] = "''";
} elseif(is_numeric($row[$j]) and !strcmp($row[$j], $row[$j]+0) ) { // test if it's a numeric type and the numeric version ($nb+0) == string version (eg: if we have 01, it's probably not a number but rather a string, else it would not have any leading 0)
// if it's a number, we return it as-is
$row[$j] = $row[$j];
// $row[$j] = $row[$j];
} else { // else for all other cases we escape the value and put quotes around
$row[$j] = addslashes($row[$j]);
$row[$j] = preg_replace("#\n#", "\\n", $row[$j]);

View File

@ -193,9 +193,9 @@ $langs->load("cashdesk");
if (empty($_SESSION['CASHDESK_ID_BANKACCOUNT_CB']) || $_SESSION['CASHDESK_ID_BANKACCOUNT_CB'] < 0)
{
$langs->load("errors");
print '<input class="bouton_mode_reglement_disabled" type="button" name="btnModeReglement" value="'.$langs->trans("Cheque").'" title="'.dol_escape_htmltag($langs->trans("ErrorModuleSetupNotComplete")).'" />';
print '<input class="bouton_mode_reglement_disabled" type="button" name="btnModeReglement" value="'.$langs->trans("CheckBank").'" title="'.dol_escape_htmltag($langs->trans("ErrorModuleSetupNotComplete")).'" />';
}
else print '<input class="button bouton_mode_reglement" type="submit" name="btnModeReglement" value="'.$langs->trans("Cheque").'" onclick="javascript: verifClic(\'CHQ\');" />';
else print '<input class="button bouton_mode_reglement" type="submit" name="btnModeReglement" value="'.$langs->trans("CheckBank").'" onclick="javascript: verifClic(\'CHQ\');" />';
print '</td>';
?>
</tr>

View File

@ -350,7 +350,7 @@ class ActionComm extends CommonObject
$this->label = $obj->label;
$this->datep = $this->db->jdate($obj->datep);
$this->datef = $this->db->jdate($obj->datep2);
$this->durationp = $this->durationp; // deprecated
// $this->durationp = $this->durationp; // deprecated
$this->datec = $this->db->jdate($obj->datec);
$this->datem = $this->db->jdate($obj->datem);

View File

@ -136,6 +136,17 @@ $form=new Form($db);
$nav='';
$nav.=' &nbsp; <form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">';
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $nav.='<input type="hidden" name="actioncode" value="'.$actioncode.'">';
if ($status || isset($_GET['status']) || isset($_POST['status'])) $nav.='<input type="hidden" name="status" value="'.$status.'">';
if ($filter) $nav.='<input type="hidden" name="filter" value="'.$filter.'">';
if ($filtera) $nav.='<input type="hidden" name="filtera" value="'.$filtera.'">';
if ($filtert) $nav.='<input type="hidden" name="filtert" value="'.$filtert.'">';
if ($filterd) $nav.='<input type="hidden" name="filterd" value="'.$filterd.'">';
if ($socid) $nav.='<input type="hidden" name="socid" value="'.$socid.'">';
if ($showbirthday) $nav.='<input type="hidden" name="showbirthday" value="1">';
if ($pid) $nav.='<input type="hidden" name="projectid" value="'.$pid.'">';
if ($type) $nav.='<input type="hidden" name="type" value="'.$type.'">';
if ($usergroup) $nav.='<input type="hidden" name="usergroup" value="'.$usergroup.'">';
$nav.=$form->select_date($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1);
$nav.=' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">';
$nav.='</form>';
@ -159,6 +170,7 @@ if ($socid) $param.="&socid=".$socid;
if ($showbirthday) $param.="&showbirthday=1";
if ($pid) $param.="&projectid=".$pid;
if ($type) $param.="&type=".$type;
if ($usergroup) $param.="&usergroup=".$usergroup;
$sql = "SELECT s.nom as societe, s.rowid as socid, s.client,";
$sql.= " a.id, a.datep as dp, a.datep2 as dp2,";
@ -203,11 +215,13 @@ if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0)
if ($usergroup > 0) $sql.= ($filtera>0||$filtert>0||$filterd>0?" OR ":"")." ugu.fk_usergroup = ".$usergroup;
$sql.= ")";
}
if ($dateselect > 0) $sql.= " AND a.datep2 >= '".$db->idate($dateselect)."' AND a.datep <= '".$db->idate($dateselect+3600*24-1)."'";
// The second or of next test is to take event with no end date (we suppose duration is 1 hour in such case)
if ($dateselect > 0) $sql.= " AND ((a.datep2 >= '".$db->idate($dateselect)."' AND a.datep <= '".$db->idate($dateselect+3600*24-1)."') OR (a.datep2 IS NULL AND a.datep > '".$db->idate($dateselect-3600)."' AND a.datep <= '".$db->idate($dateselect+3600*24-1)."'))";
if ($datestart > 0) $sql.= " AND a.datep BETWEEN '".$db->idate($datestart)."' AND '".$db->idate($datestart+3600*24-1)."'";
if ($dateend > 0) $sql.= " AND a.datep2 BETWEEN '".$db->idate($dateend)."' AND '".$db->idate($dateend+3600*24-1)."'";
$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit + 1, $offset);
//print $sql;
dol_syslog("comm/action/listactions.php", LOG_DEBUG);

View File

@ -602,16 +602,15 @@ else if ($action == 'addline' && $user->rights->propal->creer) {
// Set if we used free entry or predefined product
$predef='';
$product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):'');
$price_ht = GETPOST('price_ht');
if (GETPOST('prod_entry_mode') == 'free')
{
$idprod=0;
$price_ht = GETPOST('price_ht');
$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);
}
else
{
$idprod=GETPOST('idprod', 'int');
$price_ht = '';
$tva_tx = '';
}

View File

@ -523,16 +523,15 @@ else if ($action == 'addline' && $user->rights->commande->creer) {
// Set if we used free entry or predefined product
$predef='';
$product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):'');
$price_ht = GETPOST('price_ht');
if (GETPOST('prod_entry_mode') == 'free')
{
$idprod=0;
$price_ht = GETPOST('price_ht');
$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);
}
else
{
$idprod=GETPOST('idprod', 'int');
$price_ht = '';
$tva_tx = '';
}
@ -1391,7 +1390,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
print '</td></tr>';
}
// Delivery delay
print '<tr><td>' . $langs->trans('AvailabilityPeriod') . '</td><td colspan="2">';
$form->selectAvailabilityDelay($availability_id, 'availability_id', '', 1);
@ -1993,7 +1992,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
// Bank Account
if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER) && ! empty($conf->banque->enabled))
{
{
print '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans('BankAccount');
@ -2010,7 +2009,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
print '</td>';
print '</tr>';
}
// Total HT
print '<tr><td>' . $langs->trans('AmountHT') . '</td>';
print '<td align="right">' . price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency) . '</td>';

View File

@ -676,12 +676,13 @@ class Commande extends CommonOrder
$sql.= ", entity";
$sql.= ")";
$sql.= " VALUES ('(PROV)',".$this->socid.", '".$this->db->idate($now)."', ".$user->id;
$sql.= ", ".($this->fk_project?$this->fk_project:"null");
$sql.= ", ".($this->fk_project>0?$this->fk_project:"null");
$sql.= ", '".$this->db->idate($date)."'";
$sql.= ", ".($this->source>=0 && $this->source != '' ?$this->source:'null');
$sql.= ", '".$this->db->escape($this->note_private)."'";
$sql.= ", '".$this->db->escape($this->note_public)."'";
$sql.= ", '".$this->db->escape($this->ref_client)."'";
$sql.= ", ".($this->ref_ext?"'".$this->db->escape($this->ref_ext)."'":"null");
$sql.= ", ".($this->ref_client?"'".$this->db->escape($this->ref_client)."'":"null");
$sql.= ", ".($this->ref_int?"'".$this->db->escape($this->ref_int)."'":"null");
$sql.= ", '".$this->modelpdf."'";
$sql.= ", ".($this->cond_reglement_id>0?"'".$this->cond_reglement_id."'":"null");

View File

@ -1115,16 +1115,15 @@ else if ($action == 'addline' && $user->rights->facture->creer)
// Set if we used free entry or predefined product
$predef='';
$product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):'');
$price_ht = GETPOST('price_ht');
if (GETPOST('prod_entry_mode') == 'free')
{
$idprod=0;
$price_ht = GETPOST('price_ht');
$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);
}
else
{
$idprod=GETPOST('idprod', 'int');
$price_ht = '';
$tva_tx = '';
}
@ -1766,8 +1765,8 @@ if ($action == 'create')
$projectid = (! empty($objectsrc->fk_project) ? $objectsrc->fk_project : '');
$ref_client = (! empty($objectsrc->ref_client) ? $objectsrc->ref_client : '');
$ref_int = (! empty($objectsrc->ref_int) ? $objectsrc->ref_int : '');
// only if socid is not filled
// only if socid not filled else it's allready done upper
if (empty($socid))
$soc = $objectsrc->thirdparty;

View File

@ -422,7 +422,6 @@ class Paiement extends CommonObject
$totalamount=$this->amount;
if (empty($totalamount)) $totalamount=$this->total; // For backward compatibility
if ($mode == 'payment') $totalamount=$totalamount;
if ($mode == 'payment_supplier') $totalamount=-$totalamount;
// Insert payment into llx_bank

View File

@ -60,7 +60,7 @@ if (isset($_GET["modetax"])) $modetax=$_GET["modetax"];
*
* @param DoliDB $db Database handler
* @param string $sql SQL Request
* @param date $date Date
* @param string $date Date
* @return void
*/
function pt ($db, $sql, $date)

View File

@ -43,10 +43,10 @@ $dolibarr_main_document_root='';
// You can put several values, separated by a coma, but number of entries must match
// number of entries into $dolibarr_main_document_root_alt.
// Examples:
// $dolibarr_main_url_root_alt='/extensions';
// $dolibarr_main_url_root_alt='/custom';
// $dolibarr_main_url_root_alt='/extensions1,/extensions2';
//
$dolibarr_main_url_root_alt='';
//$dolibarr_main_url_root_alt='/custom';
// dolibarr_main_document_root_alt
@ -55,10 +55,10 @@ $dolibarr_main_url_root_alt='';
// You can put several values, separated by a coma, but number of entries must match
// number of entries into $dolibarr_main_url_root_alt.
// Examples:
// $dolibarr_main_document_root_alt='/var/www/dolibarr/htdocs/extensions';
// $dolibarr_main_document_root_alt='/var/www/dolibarr/htdocs/custom';
// $dolibarr_main_document_root_alt='C:/My web sites/dolibarr/htdocs/extensions1,C:/My web sites/dolibarr/htdocs/extensions2';
//
$dolibarr_main_document_root_alt='';
//$dolibarr_main_document_root_alt='/var/www/dolibarr/htdocs/custom';
// dolibarr_main_data_root

View File

@ -7,6 +7,7 @@
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* 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
@ -718,19 +719,25 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra
setEventMessage($object->error,'errors');
}
} elseif ($action=='setref_supplier') {
$result = $object->fetch($id);
if ($result < 0) {
setEventMessage($object->errors,'errors');
}
$object->ref_supplier=GETPOST('ref_supplier','alpha');
$result = $object->update($user);
if ($result < 0) {
setEventMessage($object->errors,'errors');
$action='editref_supplier';
} else {
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
$cancelbutton = GETPOST('cancel');
if (!$cancelbutton) {
$result = $object->fetch($id);
if ($result < 0) {
setEventMessage($object->errors, 'errors');
}
$object->ref_supplier = GETPOST('ref_supplier', 'alpha');
$result = $object->update($user);
if ($result < 0) {
setEventMessage($object->errors, 'errors');
$action = 'editref_supplier';
} else {
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
}
} elseif ($action=='setref') {
$object->ref=GETPOST('ref','alpha');
@ -1229,8 +1236,10 @@ else
/*
* Lines of contracts
*/
$productstatic=new Product($db);
if ($conf->product->enabled) {
$productstatic=new Product($db);
}
$usemargins=0;
if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) $usemargins=1;
@ -1672,7 +1681,7 @@ else
}
// Form to add new line
if ($user->rights->contrat->creer && ($object->statut >= 0))
if ($user->rights->contrat->creer && ($object->statut == 0))
{
$dateSelector=1;

View File

@ -49,34 +49,144 @@ class Contrat extends CommonObject
*/
protected $table_ref_field = 'ref';
/**
* Id of the contract
* @var int
*/
var $id;
/**
* Reference of the contract
* @var string
*/
var $ref;
/**
* External reference of the contract.
* Used by 3rd party services
* @var string
*/
var $ref_ext;
/**
* Supplier reference of the contract
* @var string
*/
var $ref_supplier;
/**
* Client id linked to the contract
* @var int
*/
var $socid;
var $societe; // Objet societe
/**
* Status of the contract
* @var int
*/
var $statut=0; // 0=Draft,
var $product;
/**
* TODO: Which is the correct one?
* Author of the contract
* @var
*/
var $user_author;
var $date_creation; // date of creation
var $date_validation; // date of last update
var $date_contrat; // date when contract was signed
var $date_cloture; // deprecated (we close contract lines, not a contract)
/**
* TODO: Which is the correct one?
* Author of the contract
* @var User
*/
public $user_creation;
/**
* TODO: Which is the correct one?
* Author of the contract
* @var int
*/
public $fk_user_author;
/**
* TODO: Which is the correct one?
* Author of the contract
* @var int
*/
public $user_author_id;
/**
* @var User
*/
public $user_cloture;
/**
* Date of creation
* @var int
*/
var $date_creation;
/**
* Date of last modification
* Not filled until you call ->info()
* @var int
*/
public $date_modification;
/**
* Date of validation
* @var int
*/
var $date_validation;
/**
* Date when contract was signed
* @var int
*/
var $date_contrat;
/**
* Date of contract closure
* @var int
* @deprecated we close contract lines, not a contract
*/
var $date_cloture;
var $commercial_signature_id;
var $commercial_suivi_id;
var $note; // deprecated
/**
* @deprecated Use note_private or note_public instead
*/
var $note;
/**
* Private note
* @var string
*/
var $note_private;
/**
* Public note
* @var string
*/
var $note_public;
var $modelpdf;
/**
* @deprecated Use fk_project instead
*/
var $fk_projet;
public $fk_project;
var $extraparams=array();
/**
* Contract lines
* @var ContratLigne[]
*/
var $lines=array();
@ -143,8 +253,8 @@ class Contrat extends CommonObject
*
* @param User $user Objet User qui active le contrat
* @param int $line_id Id de la ligne de detail a activer
* @param timestamp $date Date d'ouverture
* @param timestamp $date_end Date fin prevue
* @param int $date Date d'ouverture
* @param int|string $date_end Date fin prevue
* @param string $comment A comment typed by user
* @return int <0 if KO, >0 if OK
*/
@ -190,7 +300,7 @@ class Contrat extends CommonObject
*
* @param User $user Objet User qui active le contrat
* @param int $line_id Id de la ligne de detail a activer
* @param timestamp $date_end Date fin
* @param int $date_end Date fin
* @param string $comment A comment typed by user
* @return int <0 if KO, >0 if OK
*/
@ -441,7 +551,9 @@ class Contrat extends CommonObject
$this->ref_ext = $result["ref_ext"];
$this->statut = $result["statut"];
$this->mise_en_service = $this->db->jdate($result["datemise"]);
$this->date_contrat = $this->db->jdate($result["datecontrat"]);
$this->date_creation = $this->db->jdate($result["datecontrat"]);
$this->user_author_id = $result["fk_user_author"];
@ -470,6 +582,18 @@ class Contrat extends CommonObject
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
$this->fetch_optionals($this->id,$extralabels);
/*
* Lines
*/
$this->lines = array();
$result=$this->fetch_lines();
if ($result < 0)
{
$this->error=$this->db->error();
return -3;
}
return $this->id;
}
@ -492,7 +616,7 @@ class Contrat extends CommonObject
/**
* Load lignes array into this->lines
*
* @return Array Return array of contract lines
* @return ContratLigne[] Return array of contract lines
*/
function fetch_lines()
{
@ -1097,16 +1221,16 @@ class Contrat extends CommonObject
* @param float $txlocaltax2 Local tax 2 rate
* @param int $fk_product Id produit
* @param float $remise_percent Pourcentage de remise de la ligne
* @param timestamp $date_start Date de debut prevue
* @param timestamp $date_end Date de fin prevue
* @param float $price_base_type HT or TTC
* @param int $date_start Date de debut prevue
* @param int $date_end Date de fin prevue
* @param string $price_base_type HT or TTC
* @param float $pu_ttc Prix unitaire TTC
* @param int $info_bits Bits de type de lignes
* @param int $fk_fournprice Fourn price id
* @param int $pa_ht Buying price HT
* @return int <0 si erreur, >0 si ok
*/
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $date_start, $date_end, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $fk_fournprice=null, $pa_ht = 0)
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $date_start, $date_end, $price_base_type='HT', $pu_ttc=0.0, $info_bits=0, $fk_fournprice=null, $pa_ht = 0)
{
global $user, $langs, $conf, $mysoc;
@ -1254,20 +1378,20 @@ class Contrat extends CommonObject
* @param float $pu Prix unitaire
* @param int $qty Quantite
* @param float $remise_percent Pourcentage de remise de la ligne
* @param timestamp $date_start Date de debut prevue
* @param timestamp $date_end Date de fin prevue
* @param int $date_start Date de debut prevue
* @param int $date_end Date de fin prevue
* @param float $tvatx Taux TVA
* @param float $localtax1tx Local tax 1 rate
* @param float $localtax2tx Local tax 2 rate
* @param timestamp $date_debut_reel Date de debut reelle
* @param timestamp $date_fin_reel Date de fin reelle
* @param float $price_base_type HT or TTC
* @param int|string $date_debut_reel Date de debut reelle
* @param int|string $date_fin_reel Date de fin reelle
* @param string $price_base_type HT or TTC
* @param int $info_bits Bits de type de lignes
* @param int $fk_fournprice Fourn price id
* @param int $pa_ht Buying price HT
* @return int < 0 si erreur, > 0 si ok
*/
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $tvatx, $localtax1tx=0, $localtax2tx=0, $date_debut_reel='', $date_fin_reel='', $price_base_type='HT', $info_bits=0, $fk_fournprice=null, $pa_ht = 0)
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $tvatx, $localtax1tx=0.0, $localtax2tx=0.0, $date_debut_reel='', $date_fin_reel='', $price_base_type='HT', $info_bits=0, $fk_fournprice=null, $pa_ht = 0)
{
global $user, $conf, $langs, $mysoc;
@ -1304,7 +1428,7 @@ class Contrat extends CommonObject
$localtaxes_type=getLocalTaxesFromRate($tvatx, 0, $this->societe, $mysoc);
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $tvatx, $localtaxtx1, $txlocaltaxtx2, 0, $price_base_type, $info_bits, 1, '', $localtaxes_type);
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $tvatx, $localtax1tx, $localtax2tx, 0, $price_base_type, $info_bits, 1, '', $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];
$total_ttc = $tabprice[2];
@ -1317,19 +1441,19 @@ class Contrat extends CommonObject
// TODO A virer
// Anciens indicateurs: $price, $remise (a ne plus utiliser)
$remise = 0;
$price = price2num(round($pu_ht, 2));
$price = price2num(round($pu, 2));
if (dol_strlen($remise_percent) > 0)
{
$remise = round(($pu_ht * $remise_percent / 100), 2);
$price = $pu_ht - $remise;
$remise = round(($pu * $remise_percent / 100), 2);
$price = $pu - $remise;
}
if (empty($pa_ht)) $pa_ht=0;
// si prix d'achat non renseigne et utilise pour calcul des marges alors prix achat = prix vente
if ($pa_ht == 0) {
if ($pu_ht > 0 && (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1))
$pa_ht = $pu_ht * (1 - $remise_percent / 100);
if ($pu > 0 && (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1))
$pa_ht = $pu * (1 - $remise_percent / 100);
}
$sql = "UPDATE ".MAIN_DB_PREFIX."contratdet set description='".$this->db->escape($desc)."'";
@ -1445,6 +1569,7 @@ class Contrat extends CommonObject
*
* @param User $user Object user
* @return int <0 if KO, >0 if OK
* @deprecated This function will never be used. Status of a contract is status of its lines.
*/
function update_statut($user)
{
@ -1862,7 +1987,6 @@ class Contrat extends CommonObject
while ($xnbp < $nbp)
{
$line=new ContratLigne($this->db);
$line->desc=$langs->trans("Description")." ".$xnbp;
$line->qty=1;
$line->subprice=100;
$line->price=100;
@ -1932,6 +2056,13 @@ class ContratLigne extends CommonObject
var $fk_product;
var $statut; // 0 inactive, 4 active, 5 closed
var $label;
/**
* @var string
* @deprecated Use $label instead
*/
public $libelle;
var $description;
var $date_commande;
var $date_ouverture_prevue; // date start planned
@ -1949,6 +2080,13 @@ class ContratLigne extends CommonObject
var $fk_remise_except;
var $subprice; // Unit price HT
/**
* @var float
* @deprecated Use $price_ht instead
*/
public $price;
var $price_ht;
var $total_ht;
@ -2331,7 +2469,7 @@ class ContratLigne extends CommonObject
$sql.= ",total_localtax1=".price2num($this->total_localtax1,'MT')."";
$sql.= ",total_localtax2=".price2num($this->total_localtax2,'MT')."";
$sql.= ",total_ttc=".price2num($this->total_ttc,'MT')."";
$sql.= " WHERE rowid = ".$this->rowid;
$sql.= " WHERE rowid = ".$this->id;
dol_syslog(get_class($this)."::update_total", LOG_DEBUG);

View File

@ -131,7 +131,6 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
$from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>';
$replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>';
$message = $_POST['message'];
$sendtocc = $sendtocc;
$sendtobcc= GETPOST('sendtoccc');
if ($mode == 'emailfromproposal') $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO);
if ($mode == 'emailfromorder') $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO);

View File

@ -388,7 +388,7 @@ abstract class CommonDocGenerator
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey,true);
$object->fetch_optionals($object->id,$extralabels);
$resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key=$array_key,$outputlangs);
$resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key,$outputlangs);
}
return $resarray;
}

View File

@ -57,6 +57,9 @@ abstract class CommonObject
public $array_options=array();
/**
* @var Societe
*/
public $thirdparty;
public $linkedObjectsIds; // Loaded by ->fetchObjectLinked
@ -2119,24 +2122,23 @@ abstract class CommonObject
dol_syslog(get_class($this)."::setStatut", LOG_DEBUG);
if ($this->db->query($sql))
{
if (! $error)
{
$trigkey='';
if ($this->element == 'fichinter' && $status == 2) $trigkey='FICHINTER_CLASSIFY_BILLED';
if ($this->element == 'fichinter' && $status == 1) $trigkey='FICHINTER_CLASSIFY_UNBILLED';
$error = 0;
if ($trigkey)
{
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($this->db);
$result=$interface->run_triggers($trigkey,$this,$user,$langs,$conf);
if ($result < 0) {
$error++; $this->errors=$interface->errors;
}
// Fin appel triggers
}
}
$trigkey='';
if ($this->element == 'fichinter' && $status == 2) $trigkey='FICHINTER_CLASSIFY_BILLED';
if ($this->element == 'fichinter' && $status == 1) $trigkey='FICHINTER_CLASSIFY_UNBILLED';
if ($trigkey)
{
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($this->db);
$result=$interface->run_triggers($trigkey,$this,$user,$langs,$conf);
if ($result < 0) {
$error++; $this->errors=$interface->errors;
}
// Fin appel triggers
}
if (! $error)
{

View File

@ -4351,7 +4351,7 @@ class Form
* @param string $morehtmlref Code html supplementaire a afficher apres ref
* @param string $moreparam More param to add in nav link url.
* @param int $nodbprefix Do not include DB prefix to forge table name
* @return tring Portion HTML avec ref + boutons nav
* @return string Portion HTML avec ref + boutons nav
*/
function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0)
{

View File

@ -169,7 +169,7 @@ function convertTime2Seconds($iHours=0,$iMinutes=0,$iSeconds=0)
* @param string $format Output format (all: total delay days hour:min like "2 days 12:30"", allhourmin: total delay hours:min like "60:30", allhour: total delay hours without min/sec like "60:30", fullhour: total delay hour decimal like "60.5" for 60:30, hour: only hours part "12", min: only minutes part "30", sec: only seconds part, month: only month part, year: only year part);
* @param int $lengthOfDay Length of day (default 86400 seconds for 1 day, 28800 for 8 hour)
* @param int $lengthOfWeek Length of week (default 7)
* @return sTime Formated text of duration
* @return string Formated text of duration
* Example: 0 return 00:00, 3600 return 1:00, 86400 return 1d, 90000 return 1 Day 01:00
*/
function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengthOfWeek=7)

View File

@ -1342,11 +1342,11 @@ function dol_print_email($email,$cid=0,$socid=0,$addlink=0,$max=64,$showinvalid=
* Show Skype link
*
* @param string $skype Skype to show (only skype, without 'Name of recipient' before)
* @param int $cid Id of contact if known
* @param int $socid Id of third party if known
* @param int $addlink 0=no link to create action
* @param int $max Max number of characters to show
* @return string HTML Link
* @param int $cid Id of contact if known
* @param int $socid Id of third party if known
* @param int $addlink 0=no link to create action
* @param int $max Max number of characters to show
* @return string HTML Link
*/
function dol_print_skype($skype,$cid=0,$socid=0,$addlink=0,$max=64)
{
@ -1361,12 +1361,12 @@ function dol_print_skype($skype,$cid=0,$socid=0,$addlink=0,$max=64)
$newskype='<a href="skype:';
$newskype.=dol_trunc($skype,$max);
$newskype.='?call" alt="'.$langs->trans("Call").'&nbsp;'.$skype.'" title="'.$langs->trans("Call").'&nbsp;'.$skype.'">';
$newskype.='<img src="../theme/common/skype_callbutton.png" border="0">';
$newskype.='</a>&nbsp; &nbsp;<a href="skype:';
$newskype.='<img src="../theme/common/skype_callbutton.png" border="0">';
$newskype.='</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="skype:';
$newskype.=dol_trunc($skype,$max);
$newskype.='?chat" alt="'.$langs->trans("Chat").'&nbsp;'.$skype.'" title="'.$langs->trans("Chat").'&nbsp;'.$skype.'">';
$newskype.='<img src="../theme/common/skype_chatbutton.png" border="0">';
$newskype.='</a>&nbsp;';
$newskype.='<img src="../theme/common/skype_chatbutton.png" border="0">';
$newskype.='</a>';
if (($cid || $socid) && ! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
{

View File

@ -187,26 +187,28 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2303__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/clients.php?leftmenu=tax_vat', 'ReportByCustomers', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2304__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/quadri_detail.php?leftmenu=tax_vat', 'ReportByQuarter', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__);
-- Ventilation (accounting)
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'ventil', 6__+MAX_llx_menu__, '/compta/ventilation/index.php?leftmenu=ventil', 'Ventilation', 0, 'companies', '$user->rights->compta->ventilation->lire', '', 0, 8, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '/compta/ventilation/list.php', 'ToDispatch', 1, 'companies', '$user->rights->compta->ventilation->lire', '', 0, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '/compta/ventilation/lignes.php', 'Dispatched', 1, 'companies', '$user->rights->compta->ventilation->lire', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2403__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '/compta/param/', 'Setup', 1, 'companies', '$user->rights->compta->ventilation->parametrer', '', 0, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2404__+MAX_llx_menu__, 'accountancy', '', 2403__+MAX_llx_menu__, '/compta/param/comptes/list.php', 'List', 2, 'companies', '$user->rights->compta->ventilation->parametrer', '', 0, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2405__+MAX_llx_menu__, 'accountancy', '', 2403__+MAX_llx_menu__, '/compta/param/comptes/card.php?action=create', 'New', 2, 'companies', '$user->rights->compta->ventilation->parametrer', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2406__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '/compta/export/', 'Export', 1, 'companies', '$user->rights->compta->ventilation->lire', '', 0, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2407__+MAX_llx_menu__, 'accountancy', '', 2406__+MAX_llx_menu__, '/compta/export/index.php', 'New', 2, 'companies', '$user->rights->compta->ventilation->lire', '', 0, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2408__+MAX_llx_menu__, 'accountancy', '', 2406__+MAX_llx_menu__, '/compta/export/list.php', 'List', 2, 'companies', '$user->rights->compta->ventilation->lire', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'ventil_customer', 6__+MAX_llx_menu__, '/accountancy/customer/index.php?leftmenu=ventil_customer', 'CustomersVentilation', 0, 'accountancy', '$user->rights->accounting->ventilation->read', '', 0, 8, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="ventil_customer"', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '/accountancy/customer/list.php', 'ToDispatch', 1, 'accountancy', '$user->rights->accounting->ventilation->dispatch', '', 0, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="ventil_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '/accountancy/customer/lines.php', 'Dispatched', 1, 'accountancy', '$user->rights->accounting->ventilation->read', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 2410__+MAX_llx_menu__, 'accountancy', 'ventil_supplier', 6__+MAX_llx_menu__, '/accountancy/supplier/index.php?leftmenu=ventil_supplier', 'SuppliersVentilation', 0, 'accountancy', '$user->rights->accounting->ventilation->read', '', 0, 9, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->fournisseur->enabled && $leftmenu=="ventil_supplier"', __HANDLER__, 'left', 2411__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/list.php', 'ToDispatch', 1, 'accountancy', '$user->rights->accounting->ventilation->dispatch', '', 0, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->fournisseur->enabled && $leftmenu=="ventil_supplier"', __HANDLER__, 'left', 2412__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/lines.php', 'Dispatched', 1, 'accountancy', '$user->rights->accounting->ventilation->read', '', 0, 1, __ENTITY__);
-- Rapports
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2700__+MAX_llx_menu__, 'accountancy', 'ca', 6__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca&amp;mainmenu=accountancy', 'Reportings', 0, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 11, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2701__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca', 'ReportInOut', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2702__+MAX_llx_menu__, 'accountancy', '', 2701__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2703__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/stats/index.php?leftmenu=ca', 'ReportTurnover', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2704__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/casoc.php?leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2705__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyuser.php?leftmenu=ca', 'ByUsers', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2708__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?leftmenu=ca', 'ByProductsAndServices', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2706__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/journal/sellsjournal.php?leftmenu=ca', 'SellsJournal', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2707__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/journal/purchasesjournal.php?leftmenu=ca', 'PurchasesJournal', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__);
-- Fiscal year
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2701__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca', 'ReportInOut', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2702__+MAX_llx_menu__, 'accountancy', '', 2701__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2703__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/stats/index.php?leftmenu=ca', 'ReportTurnover', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2704__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/casoc.php?leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2705__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyuser.php?leftmenu=ca', 'ByUsers', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2708__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?leftmenu=ca', 'ByProductsAndServices', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2706__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/journal/sellsjournal.php?leftmenu=ca', 'SellsJournal', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2707__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/journal/purchasesjournal.php?leftmenu=ca', 'PurchasesJournal', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__);
-- Book Keeping
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2720__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 6__+MAX_llx_menu__, '/accountancy/bookkeeping/list.php?leftmenu=bookkeeping', 'Bookkeeping', 0, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 12, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="bookkeeping"', __HANDLER__, 'left', 2721__+MAX_llx_menu__, 'accountancy', '', 2720__+MAX_llx_menu__, '/accountancy/bookkeeping/listbyyear.php', 'ByYear', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="bookkeeping"', __HANDLER__, 'left', 2722__+MAX_llx_menu__, 'accountancy', '', 2720__+MAX_llx_menu__, '/accountancy/bookkeeping/balancebymonth.php', 'AccountBalanceByMonth', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 1, __ENTITY__);
-- Fiscal year & Chart of accounts
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled"', __HANDLER__, 'left', 2750__+MAX_llx_menu__, 'home', '', 6__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?leftmenu=setup', 'Fiscalyear', 1, 'main', '$user->rights->accounting->fiscalyear', '', 2, 20, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled"', __HANDLER__, 'left', 2751__+MAX_llx_menu__, 'home', '', 6__+MAX_llx_menu__, '/accountancy/admin/account.php?mainmenu=accountancy', 'Chartofaccounts', 1, 'main', '$user->rights->accounting->chartofaccount', '', 2, 21, __ENTITY__);
-- Check deposit

View File

@ -273,6 +273,42 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
else dol_print_error($db);
$db->free($resql);
}
if (! empty($conf->accounting->enabled) && !empty($user->rights->accounting->mouvements->lire) && $mainmenu == 'accountancy') // Entry in accountancy journal for each bank account
{
$newmenu->add('/accountancy/journal/index.php?leftmenu=journal',$langs->trans("Journaux"),0,$user->rights->banque->lire);
if ($leftmenu == 'journal')
{
$sql = "SELECT rowid, label, accountancy_journal";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
$sql.= " WHERE entity = ".$conf->entity;
$sql.= " AND clos = 0";
$sql.= " ORDER BY label";
$resql = $db->query($sql);
if ($resql)
{
$numr = $db->num_rows($resql);
$i = 0;
if ($numr > 0)
while ($i < $numr)
{
$objp = $db->fetch_object($resql);
$newmenu->add('/accountancy/journal/bankjournal.php?id_account='.$objp->rowid,$langs->trans("Journal").' - '.$objp->label,1,$user->rights->accounting->comptarapport->lire);
$i++;
}
}
else dol_print_error($db);
$db->free($resql);
// Add other journal
$newmenu->add("/accountancy/journal/sellsjournal.php?leftmenu=journal",$langs->trans("SellsJournal"),1,$user->rights->accounting->comptarapport->lire);
$newmenu->add("/accountancy/journal/purchasesjournal.php?leftmenu=journal",$langs->trans("PurchasesJournal"),1,$user->rights->accounting->comptarapport->lire);
}
}
if ($conf->ftp->enabled && $mainmenu == 'ftp') // Entry for FTP
{

View File

@ -239,29 +239,9 @@ class pdf_strato extends ModelePDFContract
$iniY = $tab_top + 7;
$curY = $tab_top + 7;
$nexY = $tab_top + 7;
$nexY = $tab_top + 2;
$pdf->SetXY($this->marge_gauche, $tab_top);
$pdf->MultiCell(190,8,$outputlangs->transnoentities("Description"),0,'L',0);
$pdf->line($this->marge_gauche, $tab_top + 8, $this->page_largeur-$this->marge_droite, $tab_top + 8);
$pdf->SetFont('', '', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetXY($this->marge_gauche, $tab_top + 8);
$text=$object->description;
if ($object->duree > 0)
{
$totaltime=convertSecondToTime($object->duree,'all',$conf->global->MAIN_DURATION_OF_WORKDAY);
$text.=($text?' - ':'').$langs->trans("Total").": ".$totaltime;
}
$desc=dol_htmlentitiesbr($text,1);
//print $outputlangs->convToOutputCharset($desc); exit;
$pdf->writeHTMLCell(180, 3, 10, $tab_top + 8, $outputlangs->convToOutputCharset($desc), 0, 1);
$nexY = $pdf->GetY();
$pdf->line($this->marge_gauche, $nexY, $this->page_largeur-$this->marge_droite, $nexY);
$pdf->MultiCell(0, 2, ''); // Set interline to 3. Then writeMultiCell must use 3 also.
@ -285,7 +265,20 @@ class pdf_strato extends ModelePDFContract
$pageposbefore=$pdf->getPage();
// Description of product line
$txt='<strong>'.dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true)." - ".$outputlangs->transnoentities("Duration")." : ".convertSecondToTime($objectligne->duration),1,$outputlangs->charset_output).'</strong>';
if ($objectligne->datei) {
$datei = dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true);
} else {
$datei = $langs->trans("Unknown");
}
if ($objectligne->duration) {
$durationi = convertSecondToTime($objectligne->duration);
} else {
$durationi = $langs->trans("Unknown");
}
$txt='<strong>'.dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".$datei." - ".$outputlangs->transnoentities("Duration")." : ".$durationi,1,$outputlangs->charset_output).'</strong>';
$desc=dol_htmlentitiesbr($objectligne->desc,1);
$pdf->writeHTMLCell(0, 0, $curX, $curY, dol_concatdesc($txt,$desc), 0, 1, 0);
@ -533,7 +526,7 @@ class pdf_strato extends ModelePDFContract
$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->datec,"day",false,$outputlangs,true), '', 'R');
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date_creation,"day",false,$outputlangs,true), '', 'R');
if ($object->client->code_client)
{

View File

@ -138,7 +138,7 @@ class doc_generic_project_odt extends ModelePDFProjects
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey,true);
$object->fetch_optionals($object->id,$extralabels);
$resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key=$array_key,$outputlangs);
$resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key,$outputlangs);
}
return $resarray;

View File

@ -139,7 +139,7 @@ class doc_generic_task_odt extends ModelePDFTask
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey,true);
$object->fetch_optionals($object->id,$extralabels);
$resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key=$array_key,$outputlangs);
$resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key,$outputlangs);
}
return $resarray;

View File

@ -1145,5 +1145,5 @@ ALTER TABLE llx_facturedet_rec ADD COLUMN fk_contract_line integer NULL;
ALTER TABLE llx_resource MODIFY COLUMN entity integer DEFAULT 1 NOT NULL;
-- This request make mysql drop (mysql bug, so we add it at end):
--ALTER TABLE llx_product ADD CONSTRAINT fk_product_barcode_type FOREIGN KEY (fk_barcode_type) REFERENCES llx_c_barcode_type(rowid);
ALTER TABLE llx_product ADD CONSTRAINT fk_product_barcode_type FOREIGN KEY (fk_barcode_type) REFERENCES llx_c_barcode_type(rowid);

View File

@ -115,7 +115,7 @@ ALTER TABLE llx_product_fournisseur_price DROP FOREIGN KEY fk_product_fournisseu
-- Fix: deprecated tag to new one
update llx_opensurvey_sondage set format = 'D' where format = 'D+';
update llx_opensurvey_sondage set format = 'A' where format = 'A+';
update llx_opensurvey_sondage set tms = now();
-- ALTER TABLE llx_facture_fourn ALTER COLUMN fk_cond_reglement DROP NOT NULL;

View File

@ -21,5 +21,8 @@ ALTER TABLE llx_c_departements ADD UNIQUE uk_departements (code_departement,fk_r
ALTER TABLE llx_c_departements ADD INDEX idx_departements_fk_region (fk_region);
-- NOTE: We duplicate creation of unique keys on llx_c_regions NOW to be able to create foreign keys.
ALTER TABLE llx_c_regions ADD UNIQUE INDEX uk_code_region (code_region);
ALTER TABLE llx_c_departements ADD CONSTRAINT fk_departements_fk_region FOREIGN KEY (fk_region) REFERENCES llx_c_regions (code_region);

View File

@ -1523,7 +1523,7 @@ function migrate_price_contrat($db,$langs,$conf)
// On met a jour les 3 nouveaux champs
$contratligne= new ContratLigne($db);
//$contratligne->fetch($rowid); Non requis car le update_total ne met a jour que chp redefinis
$contratligne->rowid=$rowid;
$contratligne->id=$rowid;
$result=calcul_price_total($qty,$pu,$remise_percent,$txtva,0,0,0,'HT',$info_bits,0,$tmpmysoc);
$total_ht = $result[0];
@ -3634,137 +3634,170 @@ function migrate_delete_old_dir($db,$langs,$conf)
* We must do this when internal menu of module or permissions has changed
* or when triggers have moved.
*
* @param DoliDB $db Database handler
* @param Translate $langs Object langs
* @param Conf $conf Object conf
* @param DoliDB $db Database handler
* @param Translate $langs Object langs
* @param Conf $conf Object conf
* @param array $listofmodule List of modules
* @return void
*/
function migrate_reload_modules($db,$langs,$conf)
function migrate_reload_modules($db,$langs,$conf,$listofmodule=array())
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules");
if (! empty($conf->global->MAIN_MODULE_AGENDA))
// Module to reload if no info is provided
if (count($listofmodule) == 0)
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Agenda");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modAgenda.class.php';
if ($res) {
$mod=new modAgenda($db);
$mod->remove('noboxes');
$mod->init('newboxdefonly');
}
}
if (! empty($conf->global->MAIN_MODULE_SOCIETE))
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Societe");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modSociete.class.php';
if ($res) {
$mod=new modSociete($db);
$mod->remove('noboxes');
$mod->init('newboxdefonly');
}
}
if (! empty($conf->global->MAIN_MODULE_PRODUIT)) // Permission has changed into 2.7
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Produit");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modProduct.class.php';
if ($res) {
$mod=new modProduct($db);
//$mod->remove('noboxes');
$mod->init('newboxdefonly');
}
}
if (! empty($conf->global->MAIN_MODULE_SERVICE)) // Permission has changed into 2.7
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Service");
if ($res) {
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php';
$mod=new modService($db);
//$mod->remove('noboxes');
$mod->init('newboxdefonly');
}
}
if (! empty($conf->global->MAIN_MODULE_COMMANDE)) // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Commande");
if ($res) {
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php';
$mod=new modCommande($db);
//$mod->remove('noboxes');
$mod->init('newboxdefonly');
}
}
if (! empty($conf->global->MAIN_MODULE_FACTURE)) // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Facture");
if ($res) {
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFacture.class.php';
$mod=new modFacture($db);
//$mod->remove('noboxes');
$mod->init('newboxdefonly');
}
}
if (! empty($conf->global->MAIN_MODULE_FOURNISSEUR)) // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Fournisseur");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php';
if ($res) {
$mod=new modFournisseur($db);
//$mod->remove('noboxes');
$mod->init('newboxdefonly');
}
$listofmodule=array(
'MAIN_MODULE_AGENDA',
'MAIN_MODULE_SOCIETE',
'MAIN_MODULE_PRODUIT',
'MAIN_MODULE_SERVICE',
'MAIN_MODULE_COMMANDE',
'MAIN_MODULE_FACTURE',
'MAIN_MODULE_FOURNISSEUR',
'MAIN_MODULE_USER',
'MAIN_MODULE_DEPLACEMENT',
'MAIN_MODULE_DON',
'MAIN_MODULE_ECM',
'MAIN_MODULE_PAYBOX',
'MAIN_MODULE_OPENSURVEY'
);
}
if (! empty($conf->global->MAIN_MODULE_USER)) // Permission has changed into 3.0
foreach($listofmodule as $moduletoreload)
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module User");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modUser.class.php';
if ($res) {
$mod=new modUser($db);
//$mod->remove('noboxes'); // We need to remove because id of module has changed
$mod->init('newboxdefonly');
}
}
if (! empty($conf->global->MAIN_MODULE_DEPLACEMENT)) // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Deplacement");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modDeplacement.class.php';
if ($res) {
$mod=new modDeplacement($db);
//$mod->remove('noboxes'); // We need to remove because a permission id has been removed
$mod->init('newboxdefonly');
}
}
if (! empty($conf->global->MAIN_MODULE_DON)) // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Don");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modDon.class.php';
if ($res) {
$mod=new modDon($db);
//$mod->remove('noboxes'); // We need to remove because a permission id has been removed
$mod->init('newboxdefonly');
}
}
if (! empty($conf->global->MAIN_MODULE_ECM)) // Permission has changed into 3.0 and 3.1
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module ECM");
if ($res) {
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modECM.class.php';
$mod=new modECM($db);
$mod->remove('noboxes'); // We need to remove because a permission id has been removed
$mod->init('newboxdefonly');
}
}
if (! empty($conf->global->MAIN_MODULE_PAYBOX)) // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Paybox");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modPaybox.class.php';
if ($res) {
$mod=new modPaybox($db);
$mod->remove('noboxes'); // We need to remove because id of module has changed
$mod->init('newboxdefonly');
}
}
if (! empty($conf->global->MAIN_MODULE_AGENDA))
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Agenda");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modAgenda.class.php';
if ($res) {
$mod=new modAgenda($db);
$mod->remove('noboxes');
$mod->init('newboxdefonly');
}
}
if (! empty($conf->global->MAIN_MODULE_SOCIETE))
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Societe");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modSociete.class.php';
if ($res) {
$mod=new modSociete($db);
$mod->remove('noboxes');
$mod->init('newboxdefonly');
}
}
if (! empty($conf->global->MAIN_MODULE_PRODUIT)) // Permission has changed into 2.7
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Produit");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modProduct.class.php';
if ($res) {
$mod=new modProduct($db);
//$mod->remove('noboxes');
$mod->init('newboxdefonly');
}
}
if (! empty($conf->global->MAIN_MODULE_SERVICE)) // Permission has changed into 2.7
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Service");
if ($res) {
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php';
$mod=new modService($db);
//$mod->remove('noboxes');
$mod->init('newboxdefonly');
}
}
if (! empty($conf->global->MAIN_MODULE_COMMANDE)) // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Commande");
if ($res) {
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php';
$mod=new modCommande($db);
//$mod->remove('noboxes');
$mod->init('newboxdefonly');
}
}
if (! empty($conf->global->MAIN_MODULE_FACTURE)) // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Facture");
if ($res) {
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFacture.class.php';
$mod=new modFacture($db);
//$mod->remove('noboxes');
$mod->init('newboxdefonly');
}
}
if (! empty($conf->global->MAIN_MODULE_FOURNISSEUR)) // Permission has changed into 2.9
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Fournisseur");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php';
if ($res) {
$mod=new modFournisseur($db);
//$mod->remove('noboxes');
$mod->init('newboxdefonly');
}
}
if (! empty($conf->global->MAIN_MODULE_USER)) // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module User");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modUser.class.php';
if ($res) {
$mod=new modUser($db);
//$mod->remove('noboxes'); // We need to remove because id of module has changed
$mod->init('newboxdefonly');
}
}
if (! empty($conf->global->MAIN_MODULE_DEPLACEMENT)) // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Deplacement");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modDeplacement.class.php';
if ($res) {
$mod=new modDeplacement($db);
//$mod->remove('noboxes'); // We need to remove because a permission id has been removed
$mod->init('newboxdefonly');
}
}
if (! empty($conf->global->MAIN_MODULE_DON)) // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Don");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modDon.class.php';
if ($res) {
$mod=new modDon($db);
//$mod->remove('noboxes'); // We need to remove because a permission id has been removed
$mod->init('newboxdefonly');
}
}
if (! empty($conf->global->MAIN_MODULE_ECM)) // Permission has changed into 3.0 and 3.1
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module ECM");
if ($res) {
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modECM.class.php';
$mod=new modECM($db);
$mod->remove('noboxes'); // We need to remove because a permission id has been removed
$mod->init('newboxdefonly');
}
}
if (! empty($conf->global->MAIN_MODULE_PAYBOX)) // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Paybox");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modPaybox.class.php';
if ($res) {
$mod=new modPaybox($db);
$mod->remove('noboxes'); // We need to remove because id of module has changed
$mod->init('newboxdefonly');
}
}
if (! empty($conf->global->MAIN_MODULE_OPENSURVEY)) // Permission has changed into 3.0
{
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Opensurvey");
$res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modOpenSurvey.class.php';
if ($res) {
$mod=new modOpenSurvey($db);
$mod->remove('noboxes'); // We need to remove because menu entries has changed
$mod->init('newboxdefonly');
}
}
}
}

View File

@ -61,6 +61,7 @@ ErrorFailedToSaveFile=Error, failed to save file.
SetDate=Set date
SelectDate=Select a date
SeeAlso=See also %s
SeeHere=See here
BackgroundColorByDefault=Default background color
FileNotUploaded=The file was not uploaded
FileUploaded=The file was successfully uploaded

View File

@ -1,19 +1,15 @@
<?php
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2014 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2008 Matteli
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
<<<<<<< HEAD
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
=======
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
>>>>>>> refs/remotes/origin/3.7
*
* 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

View File

@ -373,7 +373,7 @@ print '<br>';
if ($object->allow_comments) {
print $langs->trans("AddACommentForPoll") . '<br>';
print '<textarea name="comment" rows="2" cols="80"></textarea><br>'."\n";
print $langs->trans("Name") .': <input type="text" name="commentuser" value="'.$user->getFullName($langs).'"><br>'."\n";
print $langs->trans("Name") .': <input type="text" size="50" name="commentuser" value="'.$user->getFullName($langs).'"><br>'."\n";
print '<input type="submit" class="button" name="ajoutcomment" value="'.dol_escape_htmltag($langs->trans("AddComment")).'"><br>'."\n";
if (isset($erreur_commentaire_vide) && $erreur_commentaire_vide=="yes") {
print "<font color=#FF0000>" . $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Name")) . "</font>";

View File

@ -496,7 +496,7 @@ class Opensurveysondage extends CommonObject
*/
public function deleteComment($id_comment)
{
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'opensurvey_comments WHERE id_comment = '.$id_comment.' AND id_sondage = '.$this->id_sondage;
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'opensurvey_comments WHERE id_comment = '.$id_comment.' AND id_sondage = "'.$this->db->escape($this->id_sondage).'"';
$resql = $this->db->query($sql);
if (!$resql) {

View File

@ -870,7 +870,12 @@ if (GETPOST("source") == 'membersubscription' && $valid)
// Amount
$var=!$var;
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Amount");
if (empty($amount)) print ' ('.$langs->trans("ToComplete").')';
if (empty($amount))
{
print ' ('.$langs->trans("ToComplete");
if (! empty($conf->global->MEMBER_EXT_URL_SUBSCRIPTION_INFO)) print ' - <a href="'.$conf->global->MEMBER_EXT_URL_SUBSCRIPTION_INFO.'" rel="external" target="_blank">'.$langs->trans("SeeHere").'</a>';
print ')';
}
print '</td><td class="CTableRow'.($var?'1':'2').'">';
if (empty($amount) || ! is_numeric($amount))
{

View File

@ -1662,7 +1662,7 @@ class User extends CommonObject
/**
* Add user into a group
*
* @param Group $group Id of group
* @param int $group Id of group
* @param int $entity Entity
* @param int $notrigger Disable triggers
* @return int <0 if KO, >0 if OK
@ -1721,7 +1721,7 @@ class User extends CommonObject
/**
* Remove a user from a group
*
* @param Group $group Id of group
* @param int $group Id of group
* @param int $entity Entity
* @param int $notrigger Disable triggers
* @return int <0 if KO, >0 if OK

View File

@ -164,37 +164,13 @@ class ContratTest extends PHPUnit_Framework_TestCase
return $localobject;
}
/**
* testContratValid
*
* @param Contrat $localobject Contract
* @return int
*
* @depends testContratFetch
* The depends says test is run only if previous is ok
*/
public function testContratValid($localobject)
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
$user=$this->savuser;
$langs=$this->savlangs;
$db=$this->savdb;
$result=$localobject->update_statut($user);
print __METHOD__." id=".$localobject->id." result=".$result."\n";
$this->assertLessThan($result, 0);
return $localobject;
}
/**
* testContratValid
* testContratOther
*
* @param Object $localobject Object contract
* @return int
*
* @depends testContratValid
* @depends testContratFetch
* The depends says test is run only if previous is ok
*/
public function testContratOther($localobject)