Merge remote-tracking branch 'upstream/develop' into develop

This commit is contained in:
Juanjo Menent 2017-01-20 15:55:51 +01:00
commit 2374aa351e
196 changed files with 1295 additions and 1081 deletions

View File

@ -51,6 +51,7 @@ env:
matrix:
fast_finish: true
allow_failures:
- php: 7.1
- php: nightly
# FIXME
#- env: DB=postgresql

View File

@ -151,6 +151,9 @@ Dolibarr better:
no more required, were also removed. Use this new one if you were using one of them.
- The trigger that activate or close a contract line is run on a contract line, not on contract.
Dolibarr 5.0 was frozen before PHP 7.1 was released. Unit tests are successful on PHP 7.1 but we don't have enough
feedback to confirm all application is compatible. Current officiel supported PHP versions are PHP 5.3 to 7.0.
***** ChangeLog for 4.0.3 to 4.0.2 *****
FIX: #5853 $conf->global->$calc==0 || $conf->global->$calc==1

View File

@ -247,7 +247,7 @@ $sql.=$db->order($sortfield,$sortorder);
//$sql.= $db->plimit($conf->liste_limit+1, $offset);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -0,0 +1,14 @@
Term Dolibarr SAP Odoo ...
----------------------------------------------------------------------------
Thirdparty Contact partner Partner/Contact (company)
Contact/address Contact person Partner/Contact (individual)
Financial ?? Invoicing
Income / Expense ?? Profit / Loss
Balance Net profit

View File

@ -172,7 +172,7 @@ if (strlen(trim($search_pcgsubtype))) {
$sql .= $db->order($sortfield, $sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$resql = $db->query($sql);

View File

@ -90,7 +90,7 @@ $sql .= " WHERE f.entity = " . $conf->entity;
$sql.=$db->order($sortfield,$sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -248,7 +248,7 @@ if (strlen(trim($search_desc))) {
}
$sql .= $db->order($sortfield, $sortorder);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -143,7 +143,7 @@ else {
// List
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$nbtotalofrecords = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter);
if ($nbtotalofrecords < 0) {

View File

@ -293,7 +293,7 @@ llxHeader('', $title_page);
// List
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter);
if ($nbtotalofrecords < 0) {

View File

@ -162,7 +162,7 @@ llxHeader('', $title_page);
// List
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$nbtotalofrecords = $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter);
if ($nbtotalofrecords < 0) {

View File

@ -158,7 +158,7 @@ if (! empty($search_code_journal)) {
* Mode List
*/
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0);
if ($nbtotalofrecords < 0) {

View File

@ -200,7 +200,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't sha
$sql .= $db->order($sortfield, $sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -220,7 +220,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't sha
$sql .= $db->order($sortfield, $sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -178,7 +178,7 @@ $sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don'
$sql .= $db->order($sortfield, $sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -208,7 +208,7 @@ $sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don'
$sql .= $db->order($sortfield, $sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -182,7 +182,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't
$sql .= $db->order($sortfield, $sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -217,7 +217,7 @@ $sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't
$sql .= $db->order($sortfield, $sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -1818,18 +1818,16 @@ class Adherent extends CommonObject
$langs->load("orders");
// Positionne le modele sur le nom du modele a utiliser
if (! dol_strlen($modele))
{
if (! empty($conf->global->ADHERENT_ADDON_PDF))
{
$modele = $conf->global->ADHERENT_ADDON_PDF;
}
else
{
$modele = 'standard';
}
}
if (! dol_strlen($modele)) {
$modele = 'standard';
if ($this->modelpdf) {
$modele = $this->modelpdf;
} elseif (! empty($conf->global->ADHERENT_ADDON_PDF)) {
$modele = $conf->global->ADHERENT_ADDON_PDF;
}
}
$modelpath = "core/modules/member/doc/";

View File

@ -250,7 +250,7 @@ $sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
// Count total nb of records with no order and no limits
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$resql = $db->query($sql);
@ -375,7 +375,7 @@ if (! empty($moreforfilter))
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
print '<div class="div-table-responsive">';
print '<div class="div-table-responsive-no-min">';
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
print '<tr class="liste_titre">';
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER))

View File

@ -110,7 +110,7 @@ if ($search_account > 0) $sql.= " AND b.fk_account = ".$search_account;
if ($search_amount) $sql.= natural_search('c.subscription', $search_amount, 1);
$sql.= $db->order($sortfield,$sortorder);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -407,7 +407,7 @@ if ($rowid > 0)
$sql.=" AND datefin < '".$db->idate($now)."'";
}
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$resql = $db->query($sql);

View File

@ -329,7 +329,10 @@ print load_fiche_titre($langs->trans("BoxesAvailable"));
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'."\n";
print '<input type="hidden" name="action" value="add">'."\n";
print '<table class="noborder" width="100%">'."\n";
print '<div class="div-table-responsive-no-min">';
print '<table class="tagtable liste centpercent">'."\n";
print '<tr class="liste_titre">';
print '<td width="300">'.$langs->trans("Box").'</td>';
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
@ -375,6 +378,8 @@ foreach($boxtoadd as $box)
}
print '</table>'."\n";
print '</div>';
print '<div class="right">';
print '<input type="submit" class="button"'.(count($boxtoadd)?'':' disabled').' value="'.$langs->trans("Activate").'">';
print '</div>'."\n";
@ -388,7 +393,9 @@ $boxactivated=InfoBox::listBoxes($db,'activated',-1,null);
print "<br>\n\n";
print load_fiche_titre($langs->trans("BoxesActivated"));
print '<table class="noborder" width="100%">';
print '<div class="div-table-responsive-no-min">';
print '<table class="tagtable liste">'."\n";
print '<tr class="liste_titre">';
print '<td width="300">'.$langs->trans("Box").'</td>';
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
@ -441,7 +448,9 @@ foreach($boxactivated as $key => $box)
print '</tr>'."\n";
}
print '</table><br>';
print '</table>';
print '</div>';
print '<br>';
// Other parameters

View File

@ -182,6 +182,7 @@ print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && $debug)?'?
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" id="action" name="action" value="">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
@ -297,6 +298,7 @@ if ($result)
print '</table>';
print '</div>';
if ($conf->use_javascript_ajax)
{
@ -311,6 +313,7 @@ if ($conf->use_javascript_ajax)
print "</form>\n";
llxFooter();
$db->close();

View File

@ -557,6 +557,7 @@ if ($id == 25)
if ($conf->fournisseur->enabled) $elementList['order_supplier_send']=$langs->trans('MailToSendSupplierOrder');
if ($conf->fournisseur->enabled) $elementList['invoice_supplier_send']=$langs->trans('MailToSendSupplierInvoice');
if ($conf->societe->enabled) $elementList['thirdparty']=$langs->trans('MailToThirdparty');
if ($conf->contrat->enabled) $elementList['contract']=$langs->trans('MailToSendContract');
$parameters=array('elementList'=>$elementList);
$reshook=$hookmanager->executeHooks('emailElementlist',$parameters); // Note that $action and $object may have been modified by some hooks

View File

@ -203,7 +203,7 @@ foreach ($modulesdir as $dir)
}
ksort($arrayofnatures);
}
// Define array $categ with categ with at least one qualified module
if ($modulequalified > 0)
{
@ -319,7 +319,7 @@ if ($mode != 'marketplace')
$moreforfilter.= $langs->trans('Keyword') . ': <input type="text" name="search_keyword" value="'.dol_escape_htmltag($search_keyword).'">';
$moreforfilter.= '</div>';
$moreforfilter.='<div class="divsearchfield">';
$moreforfilter.= $langs->trans('Origin') . ': '.$form->selectarray('search_nature', $arrayofnatures, $search_nature, 1);
$moreforfilter.= $langs->trans('Origin') . ': '.$form->selectarray('search_nature', $arrayofnatures, dol_escape_htmltag($search_nature), 1);
$moreforfilter.= '</div>';
if (! empty($conf->global->MAIN_FEATURES_LEVEL))
{
@ -398,7 +398,7 @@ if ($mode != 'marketplace')
if ($search_keyword)
{
$qualified=0;
if (preg_match('/'.preg_quote($search_keyword).'/i', $modulename)
if (preg_match('/'.preg_quote($search_keyword).'/i', $modulename)
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesc)
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduledesclong)
|| preg_match('/'.preg_quote($search_keyword).'/i', $moduleauthor)
@ -417,7 +417,7 @@ if ($mode != 'marketplace')
{
//print $reg[1].'-'.dol_escape_htmltag($objMod->getPublisher());
$publisher=dol_escape_htmltag($objMod->getPublisher());
if ($reg[1] && $reg[1] != $publisher) continue;
if ($reg[1] && dol_escape_htmltag($reg[1]) != $publisher) continue;
if (! $reg[1] && ! empty($publisher)) continue;
}
if ($search_nature == 'core' && $objMod->isCoreOrExternalModule() == 'external') continue;
@ -496,11 +496,12 @@ if ($mode != 'marketplace')
// Help
print '<td align="center" valign="top" class="nowrap" style="width: 82px;">';
$text='';
if ($objMod->getDescLong()) $text.='<div class="titre">'.$objMod->getDesc().'</div><br>'.$objMod->getDescLong().'<br>';
else $text.='<div class="titre">'.$objMod->getDesc().'</div><br>';
$textexternal='';
$imginfo="info";
$imginfo="info";
if ($objMod->isCoreOrExternalModule() == 'external')
{
$imginfo="info_black";
@ -647,6 +648,7 @@ if ($mode != 'marketplace')
$text.='<br><strong>'.$langs->trans("AddOtherPagesOrServices").':</strong> ';
$text.=$langs->trans("DetectionNotPossible");
print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20');
print '</td>';

View File

@ -124,7 +124,7 @@ dol_fiche_head($head, 'default', $langs->trans("Security"));
// Show warning about external users
print info_admin(showModulesExludedForExternal($modules)).'<br>'."\n";
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
// Affiche lignes des permissions
@ -215,8 +215,9 @@ if ($result)
}
print '</table>';
print '</div>';
dol_fiche_end();
llxFooter();
$db->close();

View File

@ -86,12 +86,12 @@ if ($sfurl)
}
print ')';
}
print ' / <a href="http://www.gnu.org/copyleft/gpl.html">GNU-GPL v3+</a></li>';
}
else
{
print $langs->trans("LastStableVersion").' : <b>' .$langs->trans("UpdateServerOffline").'</b><br>';
print ' ('.$langs->trans("LastStableVersion").' : <b>' .$langs->trans("UpdateServerOffline").'</b>)<br>';
}
print ' / <a href="http://www.gnu.org/copyleft/gpl.html">GNU-GPL v3+</a></li>';
print '</ul>';

View File

@ -48,6 +48,7 @@ $tmp=getBrowserInfo($_SERVER["HTTP_USER_AGENT"]);
// Browser
$var=true;
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'."\n";
$var=!$var;
@ -71,10 +72,10 @@ print '<tr '.$bc[$var].'><td width="300">'.$langs->trans("Screen").'</td><td col
print $_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight'];
print '</td></tr>'."\n";
print '</table>';
print '</div>';
print '<br>';
llxFooter();
$db->close();

View File

@ -81,7 +81,8 @@ else
{
if ($base == 1)
{
print '<table class="noborder">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("TableName").'</td>';
print '<td colspan="2">'.$langs->trans("Type").'</td>';
@ -134,11 +135,13 @@ else
}
}
print '</table>';
print '</div>';
}
if ($base == 2)
{
print '<table class="noborder">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("TableName").'</td>';
print '<td>Nb of tuples</td>';
@ -173,12 +176,14 @@ else
}
}
print '</table>';
print '</div>';
}
if ($base == 4)
{
// Sqlite by PDO or by Sqlite3
print '<table class="noborder">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("TableName").'</td>';
print '<td>'.$langs->trans("NbOfRecord").'</td>';
@ -207,6 +212,8 @@ else
}
}
print '</table>';
print '</div>';
}
}

View File

@ -42,6 +42,7 @@ llxHeader();
print load_fiche_titre($langs->trans("InfoDatabase"),'','title_setup');
// Database
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Database").'</td></tr>'."\n";
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("Version").'</td><td>'.$db::LABEL.' '.$db->getVersion().'</td></tr>'."\n";
@ -54,14 +55,16 @@ print '<tr '.$bc[0].'><td width="300">'.$langs->trans("Password").'</td><td>'.pr
print '<tr '.$bc[1].'><td width="300">'.$langs->trans("DBStoringCharset").'</td><td>'.$db->getDefaultCharacterSetDatabase().'</td></tr>'."\n";
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("DBSortingCharset").'</td><td>'.$db->getDefaultCollationDatabase().'</td></tr>'."\n";
print '</table>';
print '</div>';
// Tables
print '<br>';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Tables").'</td></tr>'."\n";
print '<tr '.$bc[0].'><td width="300"><a href="'.DOL_URL_ROOT.'/admin/system/database-tables.php?mainmenu=home">'.$langs->trans("List").'</a></td></tr>'."\n";
print '</table>';
print '</div>';
$listofvars=$db->getServerParametersValues();
$listofstatus=$db->getServerStatusValues();
@ -76,6 +79,7 @@ else
foreach($arraylist as $listname)
{
print '<br>';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td width="300">'.$langs->trans("Parameters").'</td>';
@ -120,6 +124,7 @@ else
print '</tr>'."\n";
}
print '</table>'."\n";
print '</div>';
}
}

View File

@ -48,6 +48,7 @@ print load_fiche_titre($title,'','title_setup');
// Version
$var=true;
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Version").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
$var=!$var;
@ -69,10 +70,12 @@ else
}
print '</td></tr>'."\n";
print '</table>';
print '</div>';
print '<br>';
// Session
$var=true;
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Session").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'."\n";
$var=!$var;
@ -107,6 +110,7 @@ foreach($_SESSION as $key => $val)
}
print '</td></tr>'."\n";
print '</table>';
print '</div>';
print '<br>';
@ -116,6 +120,7 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S
$shmoparray=dol_listshmop();
$var=true;
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td class="titlefield">'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").'</td>';
@ -133,12 +138,14 @@ if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_S
}
print '</table>';
print '</div>';
print '<br>';
}
// Localisation
$var=true;
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("LocalisationDolibarrParameters").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
$var=!$var;
@ -234,6 +241,7 @@ if (! empty($conf->global->MAIN_FILESYSTEM_ENCODING)) $tmp=$conf->global->MAIN_F
print '<tr '.$bc[$var].'><td>&nbsp; => '.$langs->trans("File encoding").'</td><td>'.$tmp.'</td></tr>'."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
print '</table>';
print '</div>';
print '<br>';
@ -292,6 +300,7 @@ $configfileparameters=array(
);
$var=true;
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td class="titlefield">'.$langs->trans("Parameters").' ';
@ -353,11 +362,13 @@ foreach($configfileparameters as $key => $value)
}
}
print '</table>';
print '</div>';
print '<br>';
// Parameters in database
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder">';
print '<tr class="liste_titre">';
print '<td class="titlefield">'.$langs->trans("Parameters").' '.$langs->trans("Database").'</td>';
@ -407,7 +418,7 @@ if ($resql)
}
print '</table>';
print '</div>';
llxFooter();

View File

@ -102,6 +102,8 @@ foreach($modulesdir as $dir)
closedir($handle);
}
}
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Modules").'</td>';
@ -148,6 +150,7 @@ foreach($sortorder as $numero=>$name)
print "</tr>\n";
}
print '</table>';
print '</div>';
print '<br>';
sort($rights_ids);
$old='';

View File

@ -68,8 +68,8 @@ print '<br>';
$phparray=phpinfo_array();
foreach($phparray as $key => $value)
{
//print load_fiche_titre($key);
print '<table class="noborder">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder">';
print '<tr class="liste_titre">';
//print '<td width="220px">'.$langs->trans("Parameter").'</td>';
print '<td width="220px">'.$key.'</td>';
@ -114,7 +114,9 @@ foreach($phparray as $key => $value)
print '</tr>';
}
}
print '</table><br>';
print '</table>';
print '</div>';
print '<br>';
}

View File

@ -174,6 +174,15 @@ if ($search_user) { $usefilter++; $sql.=natural_search("u.login", $search_user,
if ($search_desc) { $usefilter++; $sql.=natural_search("e.description", $search_desc, 0); }
if ($search_ua) { $usefilter++; $sql.=natural_search("e.user_agent", $search_ua, 0); }
$sql.= $db->order($sortfield,$sortorder);
// Count total nb of records
$nbtotalofrecords = '';
/*if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
}*/
$sql.= $db->plimit($conf->liste_limit+1, $offset);
//print $sql;
$result = $db->query($sql);
@ -195,7 +204,7 @@ if ($result)
$center='<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=purge">'.$langs->trans("Purge").'</a>';
}
print_barre_liste($langs->trans("ListOfSecurityEvents").' ('.$num.')', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, 0, 'setup');
print_barre_liste($langs->trans("ListOfSecurityEvents"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $nbtotalofrecords, 'setup');
if ($action == 'purge')
{
@ -204,6 +213,8 @@ if ($result)
}
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
print '<div class="div-table-responsive">';
print '<table class="liste" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"e.dateevent","","",'align="left"',$sortfield,$sortorder);
@ -303,7 +314,10 @@ if ($result)
if ($usefilter) print '<tr><td colspan="6">'.$langs->trans("NoEventFoundWithCriteria").'</td></tr>';
else print '<tr><td colspan="6">'.$langs->trans("NoEventOrNoAuditSetup").'</td></tr>';
}
print "</table></form>";
print "</table>";
print "</div>";
print "</form>";
$db->free($result);
}
else

View File

@ -52,6 +52,7 @@ $template_dir = DOL_DOCUMENT_ROOT.'/core/tpl/';
$interfaces = new Interfaces($db);
$triggers = $interfaces->getTriggersList();
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder">
<tr class="liste_titre">
<td colspan="2">'.$langs->trans("File").'</td>
@ -78,6 +79,7 @@ foreach ($triggers as $trigger)
}
print '</table>';
print '</div>';
llxFooter();

View File

@ -34,7 +34,7 @@ class Login
/**
* Login
*
* Log user with username and password
* Log user with username and password. Using method POST is recommanded for security reasons (method GET is often logged by default by web servers with parameters so with login and pass)
*
* @param string $login Username
* @param string $password User password

View File

@ -34,6 +34,8 @@ if ( $_SESSION['uid'] <= 0 )
exit;
}
$langs->load("companies");
$langs->load("compta");
$langs->load("cashdesk");
@ -41,6 +43,8 @@ $langs->load("cashdesk");
* View
*/
$form = new Form($db);
//header("Content-type: text/html; charset=UTF-8");
//header("Content-type: text/html; charset=".$conf->file->character_set_client);

View File

@ -22,8 +22,21 @@
*/
?>
<!-- affPied.php -->
<div class="pied">
<?php
<?php
// Wrapper to show tooltips
if (! empty($conf->use_javascript_ajax) && empty($conf->dol_no_mouse_hover))
{
print "\n<!-- JS CODE TO ENABLE tipTip on all object with class classfortooltip -->\n";
print '<script type="text/javascript">
jQuery(document).ready(function () {
jQuery(".classfortooltip").tipTip({maxWidth: "'.dol_size(($conf->browser->layout == 'phone' ? 400 : 700),'width').'px", edgeOffset: 10, delay: 50, fadeIn: 50, fadeOut: 50});
});
</script>' . "\n";
}
printCommonFooter('private');
?>
</div>

View File

@ -19,7 +19,6 @@ body {
color: #333;
margin: 0;
padding: 0;
text-align: center;
}
p {
@ -214,6 +213,7 @@ p.titre {
.blocksellfinished {
min-width: 215px;
margin-top: 8px;
}
.titre1 {
font-weight: bold;

View File

@ -28,11 +28,13 @@ require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Facturation.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$action = GETPOST('action','alpha');
$obj_facturation = unserialize($_SESSION['serObjFacturation']);
unset ($_SESSION['serObjFacturation']);
switch ( $_GET['action'] )
switch($action)
{
default:
if ( $_POST['hdnSource'] != 'NULL' )
@ -162,6 +164,16 @@ switch ( $_GET['action'] )
break;
case 'change_thirdparty': // We have clicked on button "Modify" a thirdparty
$newthirdpartyid = GETPOST('CASHDESK_ID_THIRDPARTY','int');
if ($newthirdpartyid > 0)
{
$_SESSION["CASHDESK_ID_THIRDPARTY"] = $newthirdpartyid;
}
$redirection = DOL_URL_ROOT.'/cashdesk/affIndex.php?menutpl=facturation';
break;
case 'ajout_article': // We have clicked on button "Add product"
if (! empty($obj_facturation->id)) // A product was previously selected and stored in session, so we can add it

View File

@ -23,12 +23,12 @@ include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
if (!empty($_SESSION["CASHDESK_ID_THIRDPARTY"]))
/*if (!empty($_SESSION["CASHDESK_ID_THIRDPARTY"]))
{
$company=new Societe($db);
$company->fetch($_SESSION["CASHDESK_ID_THIRDPARTY"]);
$companyLink = $company->getNomUrl(1);
}
}*/
if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"]))
{
$bankcash=new Account($db);
@ -59,6 +59,7 @@ if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled)
$langs->load("cashdesk");
$langs->load("main");
print "\n".'<!-- menu.tpl.php -->'."\n";
print '<div class="menu_bloc">';
print '<ul class="menu">';
// Link to new sell
@ -68,7 +69,13 @@ print '<li class="menu_choix2"><a href=".." target="backoffice"><span class="hid
// Disconnect
print '<li class="menu_choix0">'.$langs->trans("User").': '.$_SESSION['firstname'].' '.$_SESSION['lastname'];
print ' <a href="deconnexion.php">'.img_picto($langs->trans('Logout'), 'logout.png').'</a><br>';
print $langs->trans("CashDeskThirdParty").': '.$companyLink.'<br>';
print '<form id="frmThirdparty" class="formulaire1 inline-block" method="post" action="facturation_verif.php?action=change_thirdparty">';
print $langs->trans("CashDeskThirdParty").': ';
print $form->select_company($_SESSION["CASHDESK_ID_THIRDPARTY"], 'CASHDESK_ID_THIRDPARTY', 's.client IN (1,3)', '', 0, 0, null, 0, 'valignmiddle inline-block');
print '<input class="button bouton_change_thirdparty inline-block valignmiddle" type="submit" id="bouton_change_thirdparty" value="'.$langs->trans("Modify").'">';
//print $companyLink;
print '<br>';
print '</form>';
/*print $langs->trans("CashDeskBankCash").': '.$bankcashLink.'<br>';
print $langs->trans("CashDeskBankCB").': '.$bankcbLink.'<br>';
print $langs->trans("CashDeskBankCheque").': '.$bankchequeLink.'<br>';*/
@ -78,3 +85,4 @@ if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled)
}
print '</li></ul>';
print '</div>';
print "\n".'<!-- menu.tpl.php end -->'."\n";

View File

@ -18,6 +18,7 @@
$langs->load("main");
$langs->load("bills");
$langs->load("banks");
// Object $form must de defined

View File

@ -209,7 +209,7 @@ class Categories extends DolibarrApi
$sql.= ' AND s.rowid = sub.fk_categorie';
$sql.= ' AND sub.'.$subcol_name.' = '.$item;
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -124,7 +124,7 @@ class CategoryApi extends DolibarrApi
$sql.= ' WHERE s.entity IN ('.getEntity('category', 1).')';
$sql.= ' AND s.type='.array_search($type,CategoryApi::$TYPES);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
@ -205,7 +205,7 @@ class CategoryApi extends DolibarrApi
$sql.= ' AND s.rowid = sub.fk_categorie';
$sql.= ' AND sub.'.$subcol_name.' = '.$item;
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -245,7 +245,7 @@ if ($datestart > 0) $sql.= " AND a.datep BETWEEN '".$db->idate($datestart)."' AN
if ($dateend > 0) $sql.= " AND a.datep2 BETWEEN '".$db->idate($dateend)."' AND '".$db->idate($dateend+3600*24-1)."'";
$sql.= $db->order($sortfield,$sortorder);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -85,7 +85,7 @@ $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')';
$sql.= " GROUP BY year, month, df";
$sql.= " ORDER BY year DESC, month DESC, df DESC";
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -366,6 +366,21 @@ if ($id > 0)
print '</td>';
print '</tr>';
// Max outstanding bill
if ($object->client)
{
print '<tr class="nowrap">';
print '<td>';
print $form->editfieldkey("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer);
print '</td><td>';
$limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount';
print $form->editfieldval("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer,$limit_field_type,($object->outstanding_limit != '' ? price($object->outstanding_limit) : ''));
//if (empty($object->outstanding_limit)) print $langs->trans("NoLimit");
print '</td>';
print '</tr>';
}
// Multiprice level
if (! empty($conf->global->PRODUIT_MULTIPRICES))
{
@ -493,48 +508,92 @@ if ($id > 0)
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
$boxstat = '';
// Nbre max d'elements des petites listes
$MAXLIST=$conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
// Lien recap
$outstandingBills = $object->get_OutstandingBill();
$warn = '';
if ($object->outstanding_limit != '' && $object->outstanding_limit < $outstandingBills)
$boxstat.='<div class="box">';
$boxstat.='<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="noborder boxtable" width="100%">';
$boxstat.='<tr class="impair"><td colspan="2" class="tdboxstats nohover">';
if ($conf->propal->enabled)
{
$warn = img_warning($langs->trans("OutstandingBillReached"));
// Box proposals
$tmp = $object->getOutstandingProposals();
$outstandingOpened=$tmp['opened'];
$outstandingTotal=$tmp['total_ht'];
$outstandingTotalIncTax=$tmp['total_ttc'];
$text=$langs->trans("OverAllProposals");
$link='';
$icon='bill';
if ($link) $boxstat.='<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
$boxstat.='<div class="boxstats">';
$boxstat.='<span class="boxstatstext">'.img_object("",$icon).' '.$text.'</span><br>';
$boxstat.='<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
$boxstat.='</div>';
if ($link) $boxstat.='</a>';
}
if ($conf->commande->enabled)
{
// Box proposals
$tmp = $object->getOutstandingOrders();
$outstandingOpened=$tmp['opened'];
$outstandingTotal=$tmp['total_ht'];
$outstandingTotalIncTax=$tmp['total_ttc'];
$text=$langs->trans("OverAllOrders");
$link='';
$icon='bill';
if ($link) $boxstat.='<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
$boxstat.='<div class="boxstats">';
$boxstat.='<span class="boxstatstext">'.img_object("",$icon).' '.$text.'</span><br>';
$boxstat.='<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
$boxstat.='</div>';
if ($link) $boxstat.='</a>';
}
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Summary").'</td>';
print '<td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/compta/recap-compta.php?socid='.$object->id.'">'.$langs->trans("ShowCustomerPreview").'</a></td>';
print '</tr>';
// Max outstanding bill
if ($object->client)
if ($conf->facture->enabled)
{
print '<tr class="impair">';
print '<td>';
print $form->editfieldkey("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer);
print '</td><td>';
$limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount';
print $form->editfieldval("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer,$limit_field_type,($object->outstanding_limit != '' ? price($object->outstanding_limit) : ''));
//if (empty($object->outstanding_limit)) print $langs->trans("NoLimit");
print '</td>';
print '</tr>';
$tmp = $object->getOutstandingBills();
$outstandingOpened=$tmp['opened'];
$outstandingTotal=$tmp['total_ht'];
$outstandingTotalIncTax=$tmp['total_ttc'];
$text=$langs->trans("OverAllInvoices");
$link='';
$icon='bill';
if ($link) $boxstat.='<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
$boxstat.='<div class="boxstats">';
$boxstat.='<span class="boxstatstext">'.img_object("",$icon).' '.$text.'</span><br>';
$boxstat.='<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
$boxstat.='</div>';
if ($link) $boxstat.='</a>';
// Box outstanding bill
$warn = '';
if ($object->outstanding_limit != '' && $object->outstanding_limit < $outstandingOpened)
{
$warn = img_warning($langs->trans("OutstandingBillReached"));
}
$text=$langs->trans("CurrentOutstandingBill");
$link=DOL_URL_ROOT.'/compta/recap-compta.php?socid='.$object->id;
$icon='bill';
if ($link) $boxstat.='<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
$boxstat.='<div class="boxstats">';
$boxstat.='<span class="boxstatstext">'.img_object("",$icon).' '.$text.'</span><br>';
$boxstat.='<span class="boxstatsindicator'.($outstandingOpened>0?' amountremaintopay':'').'">'.price($outstandingOpened).$warn.'</span>';
$boxstat.='</div>';
if ($link) $boxstat.='</a>';
}
// Outstanding bill
print '<tr class="pair">';
print '<td>'.$langs->trans("CurrentOutstandingBill").'</td>';
print '<td>'.price($outstandingBills).$warn.'</td>';
print '</tr>';
$boxstat.='</td></tr>';
$boxstat.='</table>';
$boxstat.='</div>';
print '</table>';
print '<br>';
print $boxstat;
$now=dol_now();
/*
@ -776,7 +835,9 @@ if ($id > 0)
print '<tr class="liste_titre">';
print '<td colspan="6"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastContracts",($num<=$MAXLIST?"":$MAXLIST)).'</td>';
print '<td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->id.'">'.$langs->trans("AllContracts").' <span class="badge">'.$num.'</span></a></td></tr></table></td>';
print '<td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->id.'">'.$langs->trans("AllContracts").' <span class="badge">'.$num.'</span></a></td>';
//print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/contract/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
print '</tr></table></td>';
print '</tr>';
}
$i = 0;
@ -837,7 +898,9 @@ if ($id > 0)
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastInterventions",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fichinter/list.php?socid='.$object->id.'">'.$langs->trans("AllInterventions").' <span class="badge">'.$num.'</span></td></tr></table></td>';
print '<td colspan="3"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastInterventions",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/fichinter/list.php?socid='.$object->id.'">'.$langs->trans("AllInterventions").' <span class="badge">'.$num.'</span></td>';
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/fichinter/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
print '</tr></table></td>';
print '</tr>';
$var=!$var;
}
@ -1007,7 +1070,15 @@ if ($id > 0)
if (! empty($conf->facture->enabled))
{
if ($user->rights->facture->creer && $object->status==1)
if (empty($user->rights->facture->creer))
{
print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
}
else if ($object->status != 1)
{
print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyIsClosed")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
}
else
{
$langs->load("bills");
$langs->load("orders");
@ -1022,10 +1093,6 @@ if ($id > 0)
else print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyMustBeEditAsCustomer")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
}
else
{
print '<div class="inline-block divButAction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
}
}
}

View File

@ -758,7 +758,7 @@ else
// MAILING_NO_USING_PHPMAIL may be defined or not.
// MAILING_LIMIT_SENDBYWEB is always defined to something != 0 (-1=forbidden).
// MAILING_LIMIT_SENDBYCLI may be defined ot not (-1=forbidden, 0=no limit).
// MAILING_LIMIT_SENDBYCLI may be defined ot not (-1=forbidden, 0 or undefined=no limit).
if (! empty($conf->global->MAILING_NO_USING_PHPMAIL) && $sendingmode == 'mail')
{
// EMailing feature may be a spam problem, so when you host several users/instance, having this option may force each user to use their own SMTP agent.
@ -772,8 +772,8 @@ else
}
else if ($conf->global->MAILING_LIMIT_SENDBYWEB == '-1')
{
if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_PHPMAIL, null, 'warnings');
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL, null, 'warnings');
if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_PHPMAIL), null, 'warnings');
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL), null, 'warnings');
// The feature is forbidden from GUI, we show just message to use from command line.
setEventMessages($langs->trans("MailingNeedCommand"), null, 'warnings');
@ -786,8 +786,8 @@ else
}
else
{
if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_PHPMAIL, null, 'warnings');
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL, null, 'warnings');
if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_PHPMAIL), null, 'warnings');
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL), null, 'warnings');
$text='';
if ($conf->global->MAILING_LIMIT_SENDBYCLI >= 0)

View File

@ -412,7 +412,7 @@ if ($object->fetch($id) >= 0)
$sql .= $db->order($sortfield,$sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -3434,17 +3434,15 @@ class Propal extends CommonObject
$langs->load("propale");
// Positionne le modele sur le nom du modele a utiliser
if (! dol_strlen($modele))
{
if (! empty($conf->global->PROPALE_ADDON_PDF))
{
if (! dol_strlen($modele)) {
$modele = 'azur';
if ($this->modelpdf) {
$modele = $this->modelpdf;
} elseif (! empty($conf->global->PROPALE_ADDON_PDF)) {
$modele = $conf->global->PROPALE_ADDON_PDF;
}
else
{
$modele = 'azur';
}
}
$modelpath = "core/modules/propale/doc/";

View File

@ -333,7 +333,7 @@ $sql.= $db->order($sortfield,$sortorder);
$sql.=', p.ref DESC';
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -139,7 +139,7 @@ class CommandeApi extends DolibarrApi
$sql .= " AND sc.fk_user = ".$search_sale;
}
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -3641,17 +3641,15 @@ class Commande extends CommonOrder
$langs->load("orders");
// Positionne le modele sur le nom du modele a utiliser
if (! dol_strlen($modele))
{
if (! empty($conf->global->COMMANDE_ADDON_PDF))
{
if (! dol_strlen($modele)) {
$modele = 'einstein';
if ($this->modelpdf) {
$modele = $this->modelpdf;
} elseif (! empty($conf->global->COMMANDE_ADDON_PDF)) {
$modele = $conf->global->COMMANDE_ADDON_PDF;
}
else
{
$modele = 'einstein';
}
}
$modelpath = "core/modules/commande/doc/";

View File

@ -97,7 +97,7 @@ $sql.= " GROUP BY s.nom";
$sql.= $db->order($sortfield,$sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -182,6 +182,7 @@ if ($id > 0 || ! empty($ref))
else
{
header('Location: index.php');
exit;
}

View File

@ -560,7 +560,7 @@ $sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -188,7 +188,7 @@ print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td class="liste_titre">'.$langs->trans("Month").'</td>';
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
print '<td align="center" width="20%" colspan="2">'.$annee.'</td>';
print '<td align="center" width="20%" colspan="2" class="liste_titre borderrightlight">'.$annee.'</td>';
}
print '</tr>';
@ -196,7 +196,7 @@ print '<tr class="liste_titre">';
print '<td class="liste_titre">&nbsp;</td>';
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
print '<td align="right">'.$langs->trans("Debit").'</td><td align="right">'.$langs->trans("Credit").'</td>';
print '<td class="liste_titre" align="center">'.$langs->trans("Debit").'</td><td class="liste_titre" align="center">'.$langs->trans("Credit").'</td>';
}
print '</tr>';
@ -218,7 +218,7 @@ for ($mois = 1 ; $mois < 13 ; $mois++)
}
print "</td>";
print '<td align="right" width="10%">&nbsp;';
print '<td align="right" class="borderrightlight" width="10%">&nbsp;';
if ($encaiss[$case]>0)
{
print price($encaiss[$case]);

View File

@ -502,7 +502,7 @@ $sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
$nbtotalofpages = 0;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
@ -621,7 +621,7 @@ if ($resql)
$last_ok=1;
}
$i++;
$liste='<a href="'.DOL_URL_ROOT.'/compta/bank/releve.php?account='.$acct->id.'&amp;num='.$objr->num_releve.'">'.$objr->num_releve.'</a> &nbsp; '.$liste;
$liste='<a href="'.DOL_URL_ROOT.'/compta/bank/releve.php?account='.$id.'&amp;num='.$objr->num_releve.'">'.$objr->num_releve.'</a> &nbsp; '.$liste;
}
if ($numr >= $nbmax) $liste="... &nbsp; ".$liste;
print $liste;
@ -1208,7 +1208,7 @@ if ($resql)
{
if ($objp->rappro) // If line not conciliated and account can be conciliated
{
print '<a href="releve.php?num='.$objp->num_releve.'&amp;account='.$object->id.'">'.$objp->num_releve.'</a>';
print '<a href="releve.php?num='.$objp->num_releve.'&amp;account='.$objp->bankid.'">'.$objp->num_releve.'</a>';
}
else if ($action == 'reconcile')
{
@ -1224,7 +1224,7 @@ if ($resql)
// Transaction reconciliated or edit link
if ($objp->rappro && $bankaccount->canBeConciliated() > 0) // If line not conciliated and account can be conciliated
{
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&amp;account='.$object->id.'&amp;page='.$page.'">';
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&amp;account='.$objp->bankid.'&amp;page='.$page.'">';
print img_edit();
print '</a>';
}
@ -1232,13 +1232,13 @@ if ($resql)
{
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
{
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&amp;account='.$object->id.'&amp;page='.$page.'">';
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&amp;account='.$objp->bankid.'&amp;page='.$page.'">';
print img_edit();
print '</a>';
}
else
{
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&amp;account='.$object->id.'&amp;page='.$page.'">';
print '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$objp->rowid.'&amp;account='.$objp->bankid.'&amp;page='.$page.'">';
print img_view();
print '</a>';
}
@ -1252,7 +1252,7 @@ if ($resql)
print '&nbsp;';
if ($user->rights->banque->modifier)
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=delete&amp;rowid='.$objp->rowid.'&amp;id='.$object->id.'&amp;page='.$page.'">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=delete&amp;rowid='.$objp->rowid.'&amp;id='.$objp->bankid.'&amp;page='.$page.'">';
print img_delete();
print '</a>';
}

View File

@ -662,7 +662,7 @@ class Account extends CommonObject
*
* @param User $user Object user making action
* @param int $notrigger 1=Disable triggers
* @return int <0 si ko, >0 si ok
* @return int <0 if KO, >0 if OK
*/
function update(User $user = null, $notrigger = 0)
{

View File

@ -81,59 +81,13 @@ if ($id)
* Actions
*/
// Envoi fichier
if ($_POST["sendit"] && !empty($conf->global->MAIN_UPLOAD_DOC)) {
if ($object->fetch($id)) {
$upload_dir = $conf->bank->dir_output . "/" . $object->ref;
if (dol_mkdir($upload_dir) >= 0) {
$resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'],
$upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']),
0, 0, $_FILES['userfile']['error']);
if (is_numeric($resupload) && $resupload > 0) {
if (image_format_supported($upload_dir . "/" . $_FILES['userfile']['name']) == 1)
{
// Create thumbs
$object->addThumbs($upload_dir . "/" . $_FILES['userfile']['name']);
}
$mesg = '<div class="ok">' . $langs->trans("FileTransferComplete") . '</div>';
}
else {
$langs->load("errors");
if ($resupload < 0) { // Unknown error
$mesg = '<div class="error">' . $langs->trans("ErrorFileNotUploaded") . '</div>';
}
else if (preg_match('/ErrorFileIsInfectedWithAVirus/',
$resupload)) { // Files infected by a virus
$mesg = '<div class="error">' . $langs->trans("ErrorFileIsInfectedWithAVirus") . '</div>';
}
else { // Known error
$mesg = '<div class="error">' . $langs->trans($resupload) . '</div>';
}
}
}
}
if ($object->id > 0)
{
$object->fetch_thirdparty();
$upload_dir = $conf->bank->dir_output . "/" . dol_sanitizeFileName($object->ref);
}
// Delete
else if ($action == 'confirm_deletefile' && $confirm == 'yes') {
if ($object->fetch($id)) {
$upload_dir = $conf->bank->dir_output;
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$ret = dol_delete_file($file, 0, 0, 0, $object);
if ($ret) {
setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
} else {
setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
}
Header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
exit;
}
}
include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
/*
@ -182,30 +136,12 @@ if ($id > 0 || !empty($ref)) {
dol_fiche_end();
dol_htmloutput_mesg($mesg, $mesgs);
/*
* Confirmation suppression fichier
*/
if ($action == 'delete') {
$ret = $form->form_confirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode($_GET["urlfile"]),
$langs->trans('DeleteFile'),
$langs->trans('ConfirmDeleteFile'), 'confirm_deletefile',
'', 0, 1);
if ($ret == 'html')
print '<br>';
}
// Affiche formulaire upload
$formfile = new FormFile($db);
$formfile->form_attach_new_file(DOL_URL_ROOT . '/compta/bank/document.php?id=' . $object->id,
'', 0, 0, $user->rights->banque, 50, $object);
// List of document
$modulepart = 'bank';
$permission = $user->rights->banque->modifier;
$permtoedit = $user->rights->banque->modifier;
$param = '&id=' . $object->id;
$formfile->list_of_documents($filearray, $object, 'bank', $param);
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
}
else {
dol_print_error($db);

View File

@ -175,7 +175,7 @@ $sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -299,6 +299,7 @@ else
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"add\">";
print '<div class="div-table-responsive">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td align="center">'.$langs->trans("DateOperationShort").'</td>';
@ -348,8 +349,10 @@ else
$i = 0;
// Ligne Solde debut releve
print "<tr ".$bc[$var]."><td colspan=\"4\"><a href=\"releve.php?num=$num&amp;ve=1&amp;rel=$rel&amp;account=".$object->id."\">&nbsp;</a></td>";
print "<td align=\"right\" colspan=\"2\"><b>".$langs->trans("InitialBankBalance")." :</b></td><td align=\"right\"><b>".price($total)."</b></td><td>&nbsp;</td></tr>\n";
print "<tr ".$bc[$var]."><td colspan=\"3\"></td>";
print "<td colspan=\"3\"><b>".$langs->trans("InitialBankBalance")." :</b></td>";
print '<td align="right"><b>'.price($total).'</b></td><td>&nbsp;</td>';
print "</tr>\n";
while ($i < $numrows)
{
@ -552,8 +555,13 @@ else
print "\n".'<tr class="liste_total"><td align="right" colspan="4">'.$langs->trans("Total")." :</td><td align=\"right\">".price($totald)."</td><td align=\"right\">".price($totalc)."</td><td>&nbsp;</td><td>&nbsp;</td></tr>";
// Line Balance
print "\n<tr><td align=\"right\" colspan=\"4\">&nbsp;</td><td align=\"right\" colspan=\"2\"><b>".$langs->trans("EndBankBalance")." :</b></td><td align=\"right\"><b>".price($total)."</b></td><td>&nbsp;</td></tr>\n";
print "</table></form>\n";
print "\n<tr><td align=\"right\" colspan=\"3\">&nbsp;</td><td colspan=\"3\"><b>".$langs->trans("EndBankBalance")." :</b></td>";
print "<td align=\"right\"><b>".price($total)."</b></td><td>&nbsp;</td>";
print "</tr>\n";
print "</table>";
print "</div>";
print "</form>\n";
}

View File

@ -93,15 +93,14 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
$head=bank_prepare_head($object);
dol_fiche_head($head,'cash',$langs->trans("FinancialAccount"),0,'account');
print '<table class="border" width="100%">';
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/index.php">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
dol_fiche_end();
print '<br>';
$solde = $object->solde(0);
// Show next coming entries

View File

@ -3736,6 +3736,8 @@ else if ($id > 0 || ! empty($ref))
}
else // Credit note
{
$cssforamountpaymentcomplete='';
// Total already paid back
print '<tr><td colspan="' . $nbcols . '" align="right">';
print $langs->trans('AlreadyPaidBack');
@ -3751,7 +3753,7 @@ else if ($id > 0 || ! empty($ref))
else
print $langs->trans('ExcessPaydBack');
print ' :</td>';
print '<td align="right" bgcolor="#f0f0f0"><b>' . price($sign * $resteapayeraffiche) . '</b></td>';
print '<td align="right"'.($resteapayeraffiche?' class="amountremaintopayback"':(' class="'.$cssforamountpaymentcomplete.'"')).'>' . price($sign * $resteapayeraffiche) . '</td>';
print '<td class="nowrap">&nbsp;</td></tr>';
// Sold credit note

View File

@ -138,7 +138,7 @@ class InvoiceApi extends DolibarrApi
$sql .= " AND sc.fk_user = ".$search_sale;
}
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -3967,24 +3967,20 @@ class Facture extends CommonInvoice
$langs->load("bills");
// Positionne le modele sur le nom du modele a utiliser
if (! dol_strlen($modele))
{
if (! empty($conf->global->FACTURE_ADDON_PDF))
{
if (! dol_strlen($modele)) {
$modele = 'crabe';
if ($this->modelpdf) {
$modele = $this->modelpdf;
} elseif (! empty($conf->global->FACTURE_ADDON_PDF)) {
$modele = $conf->global->FACTURE_ADDON_PDF;
}
else
{
$modele = 'crabe';
}
}
$modelpath = "core/modules/facture/doc/";
$result=$this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
return $result;
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
/**

View File

@ -1575,7 +1575,7 @@ else
$sql.= " AND f.date_when BETWEEN '".$db->idate(dol_get_first_day($year_date_when,1,false))."' AND '".$db->idate(dol_get_last_day($year_date_when,12,false))."'";
}
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -402,7 +402,7 @@ $listfield=explode(',',$sortfield);
foreach ($listfield as $key => $value) $sql.= $listfield[$key].' '.$sortorder.',';
$sql.= ' f.rowid DESC ';
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -396,7 +396,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
var form = $("#payment_form");
json["invoice_type"] = $("#invoice_type").val();
json["amountPayment"] = $("#amountpayment").attr("value");
json["amountPayment"] = $("#amountpayment").attr("value");
json["amounts"] = _elemToJson(form.find("input.amount"));
json["remains"] = _elemToJson(form.find("input.remain"));

View File

@ -112,7 +112,7 @@ else if ($year > 0)
}
$sql.= $db->order($sortfield,$sortorder);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -186,7 +186,7 @@ else
}
$sql.= $db->order($sortfield,$sortorder);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -813,7 +813,7 @@ class BonPrelevement extends CommonObject
dol_syslog(__METHOD__."::Read invoices error ".$this->db->error(), LOG_ERR);
}
}
if (! $error)
{
require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php';
@ -834,7 +834,7 @@ class BonPrelevement extends CommonObject
{
$bac = new CompanyBankAccount($this->db);
$bac->fetch(0,$soc->id);
if ($bac->verif() >= 1)
//if (true)
{
@ -867,7 +867,7 @@ class BonPrelevement extends CommonObject
}
$ok=0;
// Withdraw invoices in factures_prev array
$out=count($factures_prev)." invoices will be withdrawn.";
//print $out."\n";
@ -1272,7 +1272,7 @@ class BonPrelevement extends CommonObject
* section Debiteur (sepa Debiteurs bloc lines)
*/
$tmp_invoices = array();
/*$tmp_invoices = array();
$sql = "SELECT f.facnumber as fac FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."prelevement_facture as pf, ".MAIN_DB_PREFIX."societe as soc, ".MAIN_DB_PREFIX."c_country as p, ".MAIN_DB_PREFIX."societe_rib as rib WHERE pl.fk_prelevement_bons = ".$this->id." AND pl.rowid = pf.fk_prelevement_lignes AND pf.fk_facture = f.rowid AND soc.fk_pays = p.rowid AND soc.rowid = f.fk_soc AND rib.fk_soc = f.fk_soc AND rib.default_rib = 1";
$resql=$this->db->query($sql);
@ -1280,9 +1280,7 @@ class BonPrelevement extends CommonObject
while ($objfac = $this->db->fetch_object($resql)) {
$tmp_invoices[] = $objfac->fac;
}
}
$ListOfFactures = implode($tmp_invoices);
}*/
$sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,";
$sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,";
@ -1310,7 +1308,7 @@ class BonPrelevement extends CommonObject
while ($i < $num)
{
$obj = $this->db->fetch_object($resql);
$fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $ListOfFactures, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum);
$fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum);
$this->total = $this->total + $obj->somme;
$i++;
}

View File

@ -72,6 +72,7 @@ if ($action == 'create')
$mesg='';
$mesg=$langs->trans("NoInvoiceCouldBeWithdrawed");
setEventMessages($mesg, null, 'errors');
$mesg.='<br>'."\n";
foreach($bprev->invoice_in_error as $key => $val)
{
$mesg.=$val."<br>\n";

View File

@ -521,9 +521,6 @@ if ($id > 0)
print '</tr>';
}
// Status
//print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4, $totalpaye).'</td></tr>';
print '</table>';
print '</div>';
@ -548,6 +545,8 @@ if ($id > 0)
$resql = $db->query($sql);
if ($resql)
{
$totalpaye = 0;
$num = $db->num_rows($resql);
$i = 0; $total = 0;
print '<table class="noborder paymenttable">';
@ -582,8 +581,8 @@ if ($id > 0)
print '<tr '.$bc[$var].'><td colspan="'.$nbcols.'" class="opacitymedium">'.$langs->trans("None").'</td><td></td><td></td><td></td></tr>';
}
if ($object->paye == 0)
{
//if ($object->status == ChargeSociales::STATUS_DRAFT)
//{
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("AlreadyPaid")." :</td><td align=\"right\">".price($totalpaye)."</td></tr>\n";
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("AmountExpected")." :</td><td align=\"right\">".price($object->amount)."</td></tr>\n";
@ -592,7 +591,7 @@ if ($id > 0)
print "<tr><td colspan=\"3\" align=\"right\">".$langs->trans("RemainderToPay")." :</td>";
print '<td align="right"'.($resteapayer?' class="amountremaintopay"':(' class="'.$cssforamountpaymentcomplete.'"')).'>'.price($resteapayer)."</td></tr>\n";
}
//}
print "</table>";
$db->free($resql);
}

View File

@ -365,7 +365,7 @@ else
}
// Count total nb of records
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -2111,13 +2111,13 @@ else
dol_print_error($db, $object->error, $object->errors);
exit();
}
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
$fileparams = dol_most_recent_file($conf->contrat->dir_output . '/' . $ref, preg_quote($ref, '/').'[^\-]+');
$file = $fileparams['fullname'];
}
print '<div class="clearboth"></div>';
print '<br>';
print load_fiche_titre($langs->trans('SendOrderByMail'));
print load_fiche_titre($langs->trans('SendContractByMail'));
dol_fiche_head('');
@ -2145,9 +2145,9 @@ else
$formmail->withtocc = $liste;
$formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC;
if (empty($object->ref_client)) {
$formmail->withtopic = $outputlangs->trans('SendOrderRef', '__ORDERREF__');
$formmail->withtopic = $outputlangs->trans('SendContractRef', '__CONTRACTREF__');
} else if (! empty($object->ref_client)) {
$formmail->withtopic = $outputlangs->trans('SendOrderRef', '__ORDERREF__ (__REFCLIENT__)');
$formmail->withtopic = $outputlangs->trans('SendContractRef', '__CONTRACTREF__ (__REFCLIENT__)');
}
$formmail->withfile = 2;
$formmail->withbody = 1;
@ -2155,7 +2155,7 @@ else
$formmail->withcancel = 1;
// Tableau des substitutions
$formmail->setSubstitFromObject($object);
$formmail->substit ['__ORDERREF__'] = $object->ref;
$formmail->substit ['__CONTRACTREF__'] = $object->ref;
$custcontact = '';
$contactarr = array();
@ -2165,7 +2165,7 @@ else
{
foreach ($contactarr as $contact)
{
if ($contact['libelle'] == $langs->trans('TypeContact_commande_external_CUSTOMER')) { // TODO Use code and not label
if ($contact['libelle'] == $langs->trans('TypeContact_contract_external_CUSTOMER')) { // TODO Use code and not label
$contactstatic = new Contact($db);
$contactstatic->fetch($contact ['id']);
$custcontact = $contactstatic->getFullName($langs, 1);
@ -2179,9 +2179,9 @@ else
// Tableau des parametres complementaires
$formmail->param['action'] = 'send';
$formmail->param['models'] = 'order_send';
$formmail->param['models'] = 'contract_send';
$formmail->param['models_id']=GETPOST('modelmailselected','int');
$formmail->param['orderid'] = $object->id;
$formmail->param['contractid'] = $object->id;
$formmail->param['returnurl'] = $_SERVER["PHP_SELF"] . '?id=' . $object->id;
// Init list of files

View File

@ -693,8 +693,8 @@ class Contrat extends CommonObject
// fetch optionals attributes and labels
$line->fetch_optionals($line->id,$extralabelsline);
$this->lines[] = $line;
$this->lines_id_index_mapper[$line->id] = key($this->lines);
$this->lines[$i] = $line;
$this->lines_id_index_mapper[$line->id] = $i;
//dol_syslog("1 ".$line->desc);
//dol_syslog("2 ".$line->product_desc);
@ -2199,21 +2199,19 @@ class Contrat extends CommonObject
*/
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
{
global $conf,$user,$langs;
global $conf,$langs;
$langs->load("contracts");
// Positionne le modele sur le nom du modele a utiliser
if (! dol_strlen($modele))
{
if (! empty($conf->global->CONTRACT_ADDON_PDF))
{
if (! dol_strlen($modele)) {
$modele = 'strato';
if ($this->modelpdf) {
$modele = $this->modelpdf;
} elseif (! empty($conf->global->CONTRACT_ADDON_PDF)) {
$modele = $conf->global->CONTRACT_ADDON_PDF;
}
else
{
$modele = 'strato';
}
}
$modelpath = "core/modules/contract/doc/";

View File

@ -288,7 +288,7 @@ if ($result)
$totalnboflines = $db->num_rows($result);
}
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -236,7 +236,7 @@ if (! empty($filter_op2) && $filter_op2 != -1 && $filter_date2 != '') $sql.= " A
if (! empty($filter_opcloture) && $filter_opcloture != -1 && $filter_datecloture != '') $sql.= " AND cd.date_cloture ".$filter_opcloture." '".$db->idate($filter_datecloture)."'";
$sql .= $db->order($sortfield,$sortorder);
$nbtotalofrecords = -1;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);

View File

@ -337,24 +337,27 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
}
// Initialisation of datas
$object->socid = $sendtosocid; // To link to a company
$object->sendtoid = $sendtoid; // To link to a contact/address
$object->actiontypecode = $actiontypecode;
$object->actionmsg = $actionmsg; // Long text
$object->actionmsg2 = $actionmsg2; // Short text
$object->trackid = $trackid;
$object->fk_element = $object->id;
$object->elementtype = $object->element;
// Call of triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db);
$result=$interface->run_triggers($trigger_name,$object,$user,$langs,$conf);
if ($result < 0) {
$error++; $errors=$interface->errors;
if (is_object($object))
{
$object->socid = $sendtosocid; // To link to a company
$object->sendtoid = $sendtoid; // To link to a contact/address
$object->actiontypecode = $actiontypecode;
$object->actionmsg = $actionmsg; // Long text
$object->actionmsg2 = $actionmsg2; // Short text
$object->trackid = $trackid;
$object->fk_element = $object->id;
$object->elementtype = $object->element;
// Call of triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db);
$result=$interface->run_triggers($trigger_name,$object,$user,$langs,$conf);
if ($result < 0) {
$error++; $errors=$interface->errors;
}
// End call of triggers
}
// End call of triggers
if ($error)
{
dol_print_error($db);

View File

@ -371,7 +371,9 @@ class CMailFile
{
// Use Swift Mailer library
// ------------------------------------------
$host = dol_getprefix('email');
require_once DOL_DOCUMENT_ROOT.'/includes/swiftmailer/lib/swift_required.php';
// Create the message
$this->message = Swift_Message::newInstance();
@ -379,7 +381,7 @@ class CMailFile
// Adding a trackid header to a message
$headers = $this->message->getHeaders();
$headers->addTextHeader('X-Dolibarr-TRACKID', $trackid);
$headerID = time() . '.swiftmailer-dolibarr-' . $trackid . '@' . $conf->global->MAIN_MAIL_SMTP_SERVER;
$headerID = time() . '.swiftmailer-dolibarr-' . $trackid . '@' . $host;
$msgid = $headers->get('Message-ID');
$msgid->setId($headerID);
$headers->addIdHeader('References', $headerID);

View File

@ -233,7 +233,7 @@ abstract class CommonInvoice extends CommonObject
* @param int $status Id status
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto
* @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
* @param int $type Type facture
* @param int $type Type invoice
* @return string Libelle du statut
*/
function LibStatut($paye,$status,$mode=0,$alreadypaid=-1,$type=0)
@ -255,8 +255,8 @@ abstract class CommonInvoice extends CommonObject
}
else
{
if ($type == 2) return $langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted');
elseif ($type == 3) return $langs->trans('Bill'.$prefix.'StatusConverted');
if ($type == 2) return $langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted'); // credit note
elseif ($type == 3) return $langs->trans('Bill'.$prefix.'StatusConverted'); // deposit invoice
else return $langs->trans('Bill'.$prefix.'StatusPaid');
}
}
@ -340,7 +340,11 @@ abstract class CommonInvoice extends CommonObject
if ($status == 0) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusDraft').' </span>'.img_picto($langs->trans('BillStatusDraft'),'statut0');
if (($status == 3 || $status == 2) && $alreadypaid <= 0) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusCanceled').' </span>'.img_picto($langs->trans('BillStatusCanceled'),'statut5');
if (($status == 3 || $status == 2) && $alreadypaid > 0) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusClosedPaidPartially').' </span>'.img_picto($langs->trans('BillStatusClosedPaidPartially'),'statut7');
if ($alreadypaid <= 0) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusNotPaid').' </span>'.img_picto($langs->trans('BillStatusNotPaid'),'statut1');
if ($alreadypaid <= 0)
{
if ($type == 2) return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusNotRefunded').' </span>'.img_picto($langs->trans('StatusNotRefunded'),'statut1');
return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusNotPaid').' </span>'.img_picto($langs->trans('BillStatusNotPaid'),'statut1');
}
return '<span class="xhideonsmartphone">'.$langs->trans('Bill'.$prefix.'StatusStarted').' </span>'.img_picto($langs->trans('BillStatusStarted'),'statut3');
}
else

View File

@ -942,18 +942,26 @@ abstract class CommonObject
$result=array();
$i=0;
//cas particulier pour les expeditions
if($this->element=='shipping' && $this->origin_id != 0) {
$id=$this->origin_id;
$element='commande';
} else {
$id=$this->id;
$element=$this->element;
}
$sql = "SELECT ec.fk_socpeople";
$sql.= " FROM ".MAIN_DB_PREFIX."element_contact as ec,";
if ($source == 'internal') $sql.= " ".MAIN_DB_PREFIX."user as c,";
if ($source == 'external') $sql.= " ".MAIN_DB_PREFIX."socpeople as c,";
$sql.= " ".MAIN_DB_PREFIX."c_type_contact as tc";
$sql.= " WHERE ec.element_id = ".$this->id;
$sql.= " WHERE ec.element_id = ".$id;
$sql.= " AND ec.fk_socpeople = c.rowid";
if ($source == 'internal') $sql.= " AND c.entity IN (0,".$conf->entity.")";
if ($source == 'external') $sql.= " AND c.entity IN (".getEntity('societe', 1).")";
$sql.= " AND ec.fk_c_type_contact = tc.rowid";
$sql.= " AND tc.element = '".$this->element."'";
$sql.= " AND tc.element = '".$element."'";
$sql.= " AND tc.source = '".$source."'";
$sql.= " AND tc.code = '".$code."'";
$sql.= " AND tc.active = 1";
@ -3020,9 +3028,16 @@ abstract class CommonObject
foreach ($this->lines as $line)
{
$totalOrdered+=$line->qty_asked; // defined for shipment only
$totalToShip+=$line->qty_shipped; // defined for shipment only
if (isset($line->qty_asked))
{
if (empty($totalOrdered)) $totalOrdered=0; // Avoid warning because $totalOrdered is ''
$totalOrdered+=$line->qty_asked; // defined for shipment only
}
if (isset($line->qty_shipped))
{
if (empty($totalToShip)) $totalToShip=0; // Avoid warning because $totalToShip is ''
$totalToShip+=$line->qty_shipped; // defined for shipment only
}
// Define qty, weight, volume, weight_units, volume_units
if ($this->element == 'shipping') $qty=$line->qty_shipped; // for shipments
@ -3037,8 +3052,11 @@ abstract class CommonObject
if (! empty($weight_units)) $weightUnit = $weight_units;
if (! empty($volume_units)) $volumeUnit = $volume_units;
if (empty($totalWeight)) $totalWeight=0; // Avoid warning because $totalWeight is ''
if (empty($totalVolume)) $totalVolume=0; // Avoid warning because $totalVolume is ''
//var_dump($line->volume_units);
if ($weight_units < 50) // >50 means a standard unit (power of 10 of official unit) > 50 means an exotic unit (like inch)
if ($weight_units < 50) // >50 means a standard unit (power of 10 of official unit), > 50 means an exotic unit (like inch)
{
$trueWeightUnit=pow(10, $weightUnit);
$totalWeight += $weight * $qty * $trueWeightUnit;
@ -3047,7 +3065,7 @@ abstract class CommonObject
{
$totalWeight += $weight * $qty; // This may be wrong if we mix different units
}
if ($volume_units < 50) // >50 means a standard unit (power of 10 of official unit) > 50 means an exotic unit (like inch)
if ($volume_units < 50) // >50 means a standard unit (power of 10 of official unit), > 50 means an exotic unit (like inch)
{
//print $line->volume."x".$line->volume_units."x".($line->volume_units < 50)."x".$volumeUnit;
$trueVolumeUnit=pow(10, $volumeUnit);

View File

@ -5658,10 +5658,15 @@ class Form
//print "paramid=$paramid,morehtml=$morehtml,shownav=$shownav,$fieldid,$fieldref,$morehtmlref,$moreparam";
$object->load_previous_next_ref((isset($object->next_prev_filter)?$object->next_prev_filter:''),$fieldid,$nodbprefix);
//$previous_ref = $object->ref_previous?'<a data-role="button" data-icon="arrow-l" data-iconpos="left" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'">'.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Previous"),'previous.png'):'&nbsp;').'</a>':'';
//$next_ref = $object->ref_next?'<a data-role="button" data-icon="arrow-r" data-iconpos="right" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'">'.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Next"),'next.png'):'&nbsp;').'</a>':'';
$previous_ref = $object->ref_previous?'<a data-role="button" data-icon="arrow-l" data-iconpos="left" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'">'.(($conf->dol_use_jmobile != 4)?'&lt;':'&nbsp;').'</a>':'<span class="inactive">'.(($conf->dol_use_jmobile != 4)?'&lt;':'&nbsp;').'</span>';
$next_ref = $object->ref_next?'<a data-role="button" data-icon="arrow-r" data-iconpos="right" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'">'.(($conf->dol_use_jmobile != 4)?'&gt;':'&nbsp;').'</a>':'<span class="inactive">'.(($conf->dol_use_jmobile != 4)?'&gt;':'&nbsp;').'</span>';
$navurl = $_SERVER["PHP_SELF"];
// Special case for project/task page
if ($paramid == 'project_ref')
{
$navurl = preg_replace('/\/tasks\/(task|contact|time|note|document).php/','/tasks.php',$navurl);
$paramid='ref';
}
$previous_ref = $object->ref_previous?'<a data-role="button" data-icon="arrow-l" data-iconpos="left" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'">'.(($conf->dol_use_jmobile != 4)?'&lt;':'&nbsp;').'</a>':'<span class="inactive">'.(($conf->dol_use_jmobile != 4)?'&lt;':'&nbsp;').'</span>';
$next_ref = $object->ref_next?'<a data-role="button" data-icon="arrow-r" data-iconpos="right" href="'.$navurl.'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'">'.(($conf->dol_use_jmobile != 4)?'&gt;':'&nbsp;').'</a>':'<span class="inactive">'.(($conf->dol_use_jmobile != 4)?'&gt;':'&nbsp;').'</span>';
//print "xx".$previous_ref."x".$next_ref;
$ret.='<!-- Start banner content --><div style="vertical-align: middle">';

View File

@ -76,7 +76,7 @@ class FormFile
global $conf,$langs, $hookmanager;
$hookmanager->initHooks(array('formfile'));
if (! empty($conf->browser->layout) && $conf->browser->layout != 'classic') $useajax=0;
if ((! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) && $useajax) || ($useajax==2))
@ -275,7 +275,7 @@ class FormFile
if (0 !== $iconPDF) {
dol_syslog(__METHOD__ . ": passing iconPDF parameter is deprecated", LOG_WARNING);
}
global $langs, $conf, $user, $hookmanager;
global $form, $bc;
@ -287,7 +287,7 @@ class FormFile
if (! empty($iconPDF)) {
return $this->getDocumentsLink($modulepart, $modulesubdir, $filedir);
}
$printer=0;
if (in_array($modulepart,array('facture','supplier_proposal','propal','proposal','order','commande','expedition', 'commande_fournisseur', 'expensereport'))) // The direct print feature is implemented only for such elements
{
@ -559,7 +559,7 @@ class FormFile
$addcolumforpicto=($delallowed || $printer || $morepicto);
$out.= '<th align="center" colspan="'.(3+($addcolumforpicto?'2':'1')).'" class="formdoc liste_titre maxwidthonsmartphone">';
// Model
if (! empty($modellist))
{
@ -1116,10 +1116,11 @@ class FormFile
$minifile=getImageFileNameForSize($file['name'], '_mini'); // For new thumbs using same ext (in lower case howerver) than original
if (! dol_is_file($file['path'].'/'.$minifile)) $minifile=getImageFileNameForSize($file['name'], '_mini', '.png'); // For backward compatibility of old thumbs that were created with filename in lower case and with .png extension
//print $file['path'].'/'.$minifile.'<br>';
$urlforhref=getAdvancedPreviewUrl($modulepart, $relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']));
if (empty($urlforhref)) $urlforhref=DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']));
if (empty($urlforhref)) $urlforhref=DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity)?$object->entity:$conf->entity).'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']));
print '<a href="'.$urlforhref.'" class="aphoto" target="_blank">';
print '<img border="0" height="'.$maxheightmini.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&file='.urlencode($relativepath.$minifile).'" title="">';
print '<img border="0" height="'.$maxheightmini.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity)?$object->entity:$conf->entity).'&file='.urlencode($relativepath.$minifile).'" title="">';
print '</a>';
}
else print '&nbsp;';

View File

@ -37,8 +37,8 @@
*/
class FormOther
{
var $db;
var $error;
private $db;
public $error;
/**

View File

@ -1217,7 +1217,7 @@ class SMTPs
$host=preg_replace('@tcp://@i','',$host); // Remove prefix
$host=preg_replace('@ssl://@i','',$host); // Remove prefix
$host=dol_getprefix('email').'-'.$host;
$host=dol_getprefix('email');
//NOTE: Message-ID should probably contain the username of the user who sent the msg
$_header .= 'Subject: ' . $this->getSubject() . "\r\n";

View File

@ -197,9 +197,10 @@ function checkBanForAccount($account)
$rib = strtr($rib, "abcdefghijklmnopqrstuvwxyz", "12345678912345678923456789");
// Separation du rib en 3 groupes de 7 + 1 groupe de 2.
// Multiplication de chaque groupe par les coef du tableau
for ($i = 0, $s = 0; $i < 3; $i++) {
$code = substr($rib, 7 * $i, 7);
$s += (0 + $code) * $coef[$i];
$s += (0 + (int) $code) * $coef[$i];
}
// Soustraction du modulo 97 de $s a 97 pour obtenir la cle
$cle_rib = 97 - ($s % 97);

View File

@ -92,14 +92,16 @@ function dol_print_cron_urls()
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
// Cron launch
print '<div class="div-table-responsive-no-min">';
print '<u>'.$langs->trans("URLToLaunchCronJobs").':</u><br>';
$url=$urlwithroot.'/public/cron/cron_run_jobs.php?'.(empty($conf->global->CRON_KEY)?'':'securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login;
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
print ' '.$langs->trans("OrToLaunchASpecificJob").'<br>';
$url=$urlwithroot.'/public/cron/cron_run_jobs.php?'.(empty($conf->global->CRON_KEY)?'':'securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login.'&id=cronjobid';
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
print '<br>';
print '</div>';
print '<br>';
$logintouse = 'firstadmin';
if ($user->admin) $logintouse = $user->login;
@ -110,21 +112,24 @@ function dol_print_cron_urls()
print '<br>';
// Add note
$linuxlike=1;
if (preg_match('/^win/i',PHP_OS)) $linuxlike=0;
if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0;
print $langs->trans("Note").': ';
if ($linuxlike)
if (empty($conf->global->CRON_DISABLE_TUTORIAL_CRON))
{
print $langs->trans("CronExplainHowToRunUnix");
print '<br>';
print '<textarea class="quatrevingtpercent">*/5 * * * * pathtoscript/scripts/cron/cron_run_jobs.php '.(empty($conf->global->CRON_KEY)?'securitykey':''.$conf->global->CRON_KEY.'').' '.$logintouse.' &gt; '.DOL_DATA_ROOT.'/cron_run_jobs.php.log</textarea><br>';
$linuxlike=1;
if (preg_match('/^win/i',PHP_OS)) $linuxlike=0;
if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0;
print $langs->trans("Note").': ';
if ($linuxlike)
{
print $langs->trans("CronExplainHowToRunUnix");
print '<br>';
print '<textarea class="quatrevingtpercent">*/5 * * * * pathtoscript/scripts/cron/cron_run_jobs.php '.(empty($conf->global->CRON_KEY)?'securitykey':''.$conf->global->CRON_KEY.'').' '.$logintouse.' &gt; '.DOL_DATA_ROOT.'/cron_run_jobs.php.log</textarea><br>';
}
else
{
print $langs->trans("CronExplainHowToRunWin");
}
}
else
{
print $langs->trans("CronExplainHowToRunWin");
}
return 0;
}

View File

@ -171,11 +171,11 @@ function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengt
if ($format == 'all' || $format == 'allwithouthour' || $format == 'allhour' || $format == 'allhourmin')
{
if ($iSecond === 0) return '0'; // This is to avoid having 0 return a 12:00 AM for en_US
if ((int) $iSecond === 0) return '0'; // This is to avoid having 0 return a 12:00 AM for en_US
$sTime='';
$sDay=0;
$sWeek='';
$sWeek=0;
if ($iSecond >= $lengthOfDay)
{
@ -218,7 +218,7 @@ function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengt
}
if ($format == 'allhourmin')
{
return sprintf("%02d",($sWeek*$lengthOfWeek*24 + $sDay*24 + (int) floor($iSecond/3600))).':'.sprintf("%02d",((int) floor(($iSecond % 3600)/60)));
return sprintf("%02d",($sWeek*$lengthOfWeek*24 + $sDay*24 + (int) floor($iSecond/3600))).':'.sprintf("%02d",((int) floor(($iSecond % 3600)/60)));
}
if ($format == 'allhour')
{

View File

@ -1289,21 +1289,19 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
}
} elseif ($link) {
if (dol_mkdir($upload_dir) >= 0) {
require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
$linkObject = new Link($db);
$linkObject->entity = $conf->entity;
$linkObject->url = $link;
$linkObject->objecttype = GETPOST('objecttype', 'alpha');
$linkObject->objectid = GETPOST('objectid', 'int');
$linkObject->label = GETPOST('label', 'alpha');
$res = $linkObject->create($user);
$langs->load('link');
if ($res > 0) {
setEventMessages($langs->trans("LinkComplete"), null, 'mesgs');
} else {
setEventMessages($langs->trans("ErrorFileNotLinked"), null, 'errors');
}
require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
$linkObject = new Link($db);
$linkObject->entity = $conf->entity;
$linkObject->url = $link;
$linkObject->objecttype = GETPOST('objecttype', 'alpha');
$linkObject->objectid = GETPOST('objectid', 'int');
$linkObject->label = GETPOST('label', 'alpha');
$res = $linkObject->create($user);
$langs->load('link');
if ($res > 0) {
setEventMessages($langs->trans("LinkComplete"), null, 'mesgs');
} else {
setEventMessages($langs->trans("ErrorFileNotLinked"), null, 'errors');
}
}
else

View File

@ -967,7 +967,7 @@ function dol_get_fiche_end($notab=0)
* @param int $nodbprefix Do not include DB prefix to forge table name
* @param string $morehtmlleft More html code to show before ref
* @param string $morehtmlstatus More html code to show under navigation arrows
* @param int $onlybanner Put this to 1, if the card will contains only a banner
* @param int $onlybanner Put this to 1, if the card will contains only a banner (add css 'arearefnobottom' on div)
* @param string $morehtmlright More html code to show before navigation arrows
* @return void
*/
@ -3184,7 +3184,7 @@ function load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png',
* @param string $sortorder Order to sort ('' by default)
* @param string $center String in the middle ('' by default). We often find here string $massaction comming from $form->selectMassAction()
* @param int $num Number of records found by select with limit+1
* @param int $totalnboflines Total number of records/lines for all pages (if known). Use a negative value to not show number.
* @param int|string $totalnboflines Total number of records/lines for all pages (if known). Use a negative value of number to not show number. Use '' if unknown.
* @param string $picto Icon to use before title (should be a 32x32 transparent png file)
* @param int $pictoisfullpath 1=Icon name is a full absolute url of image
* @param string $morehtml More html to show
@ -3193,7 +3193,7 @@ function load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png',
* @param int $hideselectlimit Force to hide select limit
* @return void
*/
function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=-1, $picto='title_generic.png', $pictoisfullpath=0, $morehtml='', $morecss='', $limit=-1, $hideselectlimit=0)
function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines='', $picto='title_generic.png', $pictoisfullpath=0, $morehtml='', $morecss='', $limit=-1, $hideselectlimit=0)
{
global $conf,$langs;
@ -3223,7 +3223,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
print '<td class="nobordernopadding valignmiddle">';
if ($picto && $titre) print img_picto('', $picto, 'class="hideonsmartphone valignmiddle" id="pictotitle"', $pictoisfullpath);
print '<div class="titre inline-block">'.$titre;
if (!empty($titre) && $savtotalnboflines >= 0) print ' ('.$totalnboflines.')';
if (!empty($titre) && $savtotalnboflines >= 0 && (string) $savtotalnboflines != '') print ' ('.$totalnboflines.')';
print '</div></td>';
// Center
@ -3316,7 +3316,7 @@ function print_fleche_navigation($page, $file, $options='', $nextpage=0, $betwee
if (! empty($conf->global->MAIN_PAGESIZE_CHOICES)) $pagesizechoices=$conf->global->MAIN_PAGESIZE_CHOICES;
print '<li class="pagination">';
print '<select class="flat selectlimit" name="limit">';
print '<select class="flat selectlimit" name="limit" title="'.dol_escape_htmltag($langs->trans("MaxNbOfRecordPerPage")).'">';
$tmpchoice=explode(',',$pagesizechoices);
$tmpkey=$limit.':'.$limit;
if (! in_array($tmpkey, $tmpchoice)) $tmpchoice[]=$tmpkey;

View File

@ -1056,13 +1056,13 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
{
$numFinal = preg_replace('/\{yyyy\}/i',date("Y",$date)+$yearoffset, $numFinal);
$numFinal = preg_replace('/\{yy\}/i', date("y",$date)+$yearoffset, $numFinal);
$numFinal = preg_replace('/\{y\}/i', substr(date("y",$date),2,1)+$yearoffset, $numFinal);
$numFinal = preg_replace('/\{y\}/i', substr(date("y",$date),1,1)+$yearoffset, $numFinal);
}
else // we want yyyy to be current year
{
$numFinal = preg_replace('/\{yyyy\}/i',date("Y",$date), $numFinal);
$numFinal = preg_replace('/\{yy\}/i', date("y",$date), $numFinal);
$numFinal = preg_replace('/\{y\}/i', substr(date("y",$date),2,1), $numFinal);
$numFinal = preg_replace('/\{y\}/i', substr(date("y",$date),1,1), $numFinal);
}
$numFinal = preg_replace('/\{mm\}/i', date("m",$date), $numFinal);
$numFinal = preg_replace('/\{dd\}/i', date("d",$date), $numFinal);

View File

@ -80,6 +80,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
$result=array();
// Clean parameters
if (empty($info_bits)) $info_bits=0;
if (empty($txtva)) $txtva=0;
if (empty($seller) || ! is_object($seller))
{

View File

@ -797,16 +797,16 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if (! empty($conf->facture->enabled))
{
$langs->load("bills");
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills",$langs->trans("BillsCustomers"),0,$user->rights->facture->lire, '', $mainmenu, 'customers_bills');
$newmenu->add("/compta/facture.php?action=create&leftmenu=customers_bills",$langs->trans("NewBill"),1,$user->rights->facture->creer);
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills",$langs->trans("BillsCustomers"),0,$user->rights->facture->lire);
$newmenu->add("/compta/facture.php?action=create",$langs->trans("NewBill"),1,$user->rights->facture->creer);
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills",$langs->trans("List"),1,$user->rights->facture->lire);
if ($usemenuhider || empty($leftmenu) || ($leftmenu == 'customers_bills'))
if ($usemenuhider || empty($leftmenu) || preg_match('/customers_bills/', $leftmenu))
{
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills&amp;search_status=0",$langs->trans("BillShortStatusDraft"),2,$user->rights->facture->lire);
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills&amp;search_status=1",$langs->trans("BillShortStatusNotPaid"),2,$user->rights->facture->lire);
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills&amp;search_status=2",$langs->trans("BillShortStatusPaid"),2,$user->rights->facture->lire);
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills&amp;search_status=3",$langs->trans("BillShortStatusCanceled"),2,$user->rights->facture->lire);
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_draft&amp;search_status=0",$langs->trans("BillShortStatusDraft"),2,$user->rights->facture->lire);
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_notpaid&amp;search_status=1",$langs->trans("BillShortStatusNotPaid"),2,$user->rights->facture->lire);
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_paid&amp;search_status=2",$langs->trans("BillShortStatusPaid"),2,$user->rights->facture->lire);
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_canceled&amp;search_status=3",$langs->trans("BillShortStatusCanceled"),2,$user->rights->facture->lire);
}
$newmenu->add("/compta/facture/fiche-rec.php",$langs->trans("ListOfTemplates"),1,$user->rights->facture->lire);
@ -829,15 +829,15 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$newmenu->add("/fourn/facture/card.php?action=create",$langs->trans("NewBill"),1,$user->rights->fournisseur->facture->creer);
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("List"),1,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
if ($usemenuhider || empty($leftmenu) || ($leftmenu == 'suppliers_bills')) {
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills&amp;search_status=0", $langs->trans("BillShortStatusDraft"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills&amp;search_status=1", $langs->trans("BillShortStatusNotPaid"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills&amp;search_status=2", $langs->trans("BillShortStatusPaid"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
if ($usemenuhider || empty($leftmenu) || preg_match('/suppliers_bills/', $leftmenu)) {
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_draft&amp;search_status=0", $langs->trans("BillShortStatusDraft"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_draft');
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_notpaid&amp;search_status=1", $langs->trans("BillShortStatusNotPaid"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_notpaid');
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills_paid&amp;search_status=2", $langs->trans("BillShortStatusPaid"),2,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills_paid');
}
$newmenu->add("/fourn/facture/paiement.php", $langs->trans("Payments"),1,$user->rights->fournisseur->facture->lire);
$newmenu->add("/compta/facture/stats/index.php?leftmenu=suppliers_bills&mode=supplier", $langs->trans("Statistics"),1,$user->rights->fournisseur->facture->lire);
$newmenu->add("/compta/facture/stats/index.php?mode=supplier", $langs->trans("Statistics"),1,$user->rights->fournisseur->facture->lire);
}
// Orders

View File

@ -166,15 +166,15 @@ function chequereceipt_pdf_create($db, $id, $message, $modele, $outputlangs)
// Positionne modele sur le nom du modele a utiliser
if (! dol_strlen($modele))
{
if (! empty($conf->global->FACTURE_ADDON_PDF))
if (! empty($conf->global->CHEQUERECEIPT_ADDON_PDF))
{
$modele = $conf->global->FACTURE_ADDON_PDF;
$modele = $conf->global->CHEQUERECEIPT_ADDON_PDF;
}
else
{
//print $langs->trans("Error")." ".$langs->trans("Error_FACTURE_ADDON_PDF_NotDefined");
//return 0;
$modele = 'crabe';
$modele = 'blochet';
}
}

View File

@ -40,23 +40,47 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
*/
class pdf_einstein extends ModelePDFCommandes
{
var $db;
var $name;
var $description;
var $type;
/**
* @var DoliDb Database handler
*/
public $db;
/**
* @var string model name
*/
public $name;
/**
* @var string model description (short text)
*/
public $description;
/**
* @var string document type
*/
public $type;
/**
* @var array() Minimum version of PHP required by module.
* e.g.: PHP 5.3 = array(5, 3)
*/
public $phpmin = array(5, 2);
/**
* Dolibarr version of the loaded document
* @public string
*/
public $version = 'dolibarr';
var $phpmin = array(4,3,0); // Minimum version of PHP required by module
var $version = 'dolibarr';
public $page_largeur;
public $page_hauteur;
public $format;
public $marge_gauche;
public $marge_droite;
public $marge_haute;
public $marge_basse;
var $page_largeur;
var $page_hauteur;
var $format;
var $marge_gauche;
var $marge_droite;
var $marge_haute;
var $marge_basse;
var $emetteur; // Objet societe qui emet
public $emetteur; // Objet societe qui emet
/**
@ -64,7 +88,7 @@ class pdf_einstein extends ModelePDFCommandes
*
* @param DoliDB $db Database handler
*/
function __construct($db)
public function __construct($db)
{
global $conf,$langs,$mysoc;
@ -483,7 +507,7 @@ class pdf_einstein extends ModelePDFCommandes
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]='';
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]=0;
$this->tva[$vatrate] += $tvaligne;
// Add line

View File

@ -146,26 +146,4 @@ abstract class ModeleNumRefCommandes
if ($this->version) return $this->version;
return $langs->trans("NotAvailable");
}
}
/**
* Create a document onto disk accordign to template module.
*
* @param DoliDB $db Database handler
* @param Commande $object Object order
* @param string $modele Force le modele a utiliser ('' to not force)
* @param Translate $outputlangs objet lang a utiliser pour traduction
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @return int 0 if KO, 1 if OK
* @deprecated Use the new function generateDocument of Commande class
* @see Commande::generateDocument()
*/
function commande_pdf_create(DoliDB $db, Commande $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
{
dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING);
return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
}

View File

@ -143,24 +143,3 @@ class ModelNumRefContracts
return $langs->trans("NotAvailable");
}
}
/**
* Create a contract document on disk using template defined into CONTRACT_ADDON_PDF
*
* @param DoliDB $db objet base de donnee
* @param Contrat $object Object contract
* @param string $modele force le modele a utiliser ('' par defaut)
* @param Translate $outputlangs objet lang a utiliser pour traduction
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @return int 0 if KO, 1 if OK
* @deprecated Use the new function generateDocument of Contrat class
* @see Contrat::generateDocument()
*/
function contract_pdf_create(DoliDB $db, Contrat $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
{
dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING);
return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
}

View File

@ -141,24 +141,3 @@ abstract class ModelNumRefExpedition
return $langs->trans("NotAvailable");
}
}
/**
* Create a document onto disk according to template module.
*
* @param DoliDB $db Objet base de donnee
* @param Expedition $object Object expedition
* @param string $modele Force le modele a utiliser ('' to not force)
* @param Translate $outputlangs Objet lang a utiliser pour traduction
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @return int 1 if OK -1 if KO
* @deprecated Use the new function generateDocument of Expedition class
* @see Expedition::generateDocument()
*/
function expedition_pdf_create(DoliDB $db, Expedition $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
{
dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING);
return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
}

Some files were not shown because too many files have changed in this diff Show More