Merge branch 'develop' into new_branch_04_02_2019

This commit is contained in:
Laurent Destailleur 2019-02-08 09:42:18 +01:00 committed by GitHub
commit 0e42e8824b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
121 changed files with 2127 additions and 2087 deletions

View File

@ -7,8 +7,12 @@ root = true
charset = utf-8 charset = utf-8
end_of_line = lf end_of_line = lf
insert_final_newline = true insert_final_newline = true
# PHP PSR-2 Coding Standards
# http://www.php-fig.org/psr/psr-2/
[*.php] [*.php]
indent_style = space indent_style = space
indent_size = 4
trim_trailing_whitespace = true trim_trailing_whitespace = true
[*.js] [*.js]
indent_style = tab indent_style = tab

View File

@ -140,12 +140,10 @@ else { print "err"; }
$prodids = array(); $prodids = array();
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product WHERE tosell=1"; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product WHERE tosell=1";
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql) {
{
$num_prods = $db->num_rows($resql); $num_prods = $db->num_rows($resql);
$i = 0; $i = 0;
while ($i < $num_prods) while ($i < $num_prods) {
{
$i++; $i++;
$row = $db->fetch_row($resql); $row = $db->fetch_row($resql);
@ -155,7 +153,6 @@ if ($resql)
print "Build ".GEN_NUMBER_COMMANDE." orders\n"; print "Build ".GEN_NUMBER_COMMANDE." orders\n";
for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++) for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++)
{ {

View File

@ -170,6 +170,8 @@
<!-- Disabled as this does not support tab --> <!-- Disabled as this does not support tab -->
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> --> <!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" />
<!-- There MUST NOT be trailing whitespace at the end of non-blank lines. --> <!-- There MUST NOT be trailing whitespace at the end of non-blank lines. -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"> <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties> <properties>

View File

@ -2767,7 +2767,7 @@ class Adherent extends CommonObject
$outputlangs = new Translate('', $conf); $outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang); $outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang);
$outputlangs->loadLangs(array("main", "members")); $outputlangs->loadLangs(array("main", "members"));
dol_syslog("sendReminderForExpiredSubscription Language set to ".$outputlangs->defaultlang); dol_syslog("sendReminderForExpiredSubscription Language for member id ".$adherent->id." set to ".$outputlangs->defaultlang." mysoc->default_lang=".$mysoc->default_lang);
$arraydefaultmessage=null; $arraydefaultmessage=null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION; $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION;

View File

@ -159,7 +159,8 @@ if ($mode)
} }
if ($mode == 'memberbyregion') //+ if ($mode == 'memberbyregion') //+
{ {
$data[]=array('label'=>(($obj->code && $langs->trans("Country".$obj->code)!="Country".$obj->code)?$langs->trans("Country".$obj->code):($obj->label?$obj->label:$langs->trans("Unknown"))), $data[]=array(
'label'=>(($obj->code && $langs->trans("Country".$obj->code)!="Country".$obj->code)?$langs->trans("Country".$obj->code):($obj->label?$obj->label:$langs->trans("Unknown"))),
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code)!="Country".$obj->code)?$langsen->transnoentitiesnoconv("Country".$obj->code):($obj->label?$obj->label:$langs->trans("Unknown"))), 'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code)!="Country".$obj->code)?$langsen->transnoentitiesnoconv("Country".$obj->code):($obj->label?$obj->label:$langs->trans("Unknown"))),
'label2'=>($obj->label2?$obj->label2:$langs->trans("Unknown")), 'label2'=>($obj->label2?$obj->label2:$langs->trans("Unknown")),
'nb'=>$obj->nb, 'nb'=>$obj->nb,

View File

@ -673,7 +673,7 @@ if ($rowid > 0)
$sql.= " c.datef,"; $sql.= " c.datef,";
$sql.= " c.fk_bank,"; $sql.= " c.fk_bank,";
$sql.= " b.rowid as bid,"; $sql.= " b.rowid as bid,";
$sql.= " ba.rowid as baid, ba.label, ba.bank, ba.ref, ba.account_number, ba.fk_accountancy_journal, ba.number"; $sql.= " ba.rowid as baid, ba.label, ba.bank, ba.ref, ba.account_number, ba.fk_accountancy_journal, ba.number, ba.currency_code";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."subscription as c"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."subscription as c";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON c.fk_bank = b.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON c.fk_bank = b.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
@ -726,8 +726,9 @@ if ($rowid > 0)
$accountstatic->id=$objp->baid; $accountstatic->id=$objp->baid;
$accountstatic->number=$objp->number; $accountstatic->number=$objp->number;
$accountstatic->account_number=$objp->account_number; $accountstatic->account_number=$objp->account_number;
$accountstatic->currency_code=$objp->currency_code;
if (! empty($conf->accounting->enabled)) if (! empty($conf->accounting->enabled) && $objp->fk_accountancy_journal > 0)
{ {
$accountingjournal = new AccountingJournal($db); $accountingjournal = new AccountingJournal($db);
$accountingjournal->fetch($objp->fk_accountancy_journal); $accountingjournal->fetch($objp->fk_accountancy_journal);

View File

@ -545,7 +545,7 @@ foreach ($fieldsforcontent as $tmpfieldlist)
print '<strong>' . $form->textwithpicto($langs->trans("FilesAttachedToEmail"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . '</strong> '; print '<strong>' . $form->textwithpicto($langs->trans("FilesAttachedToEmail"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . '</strong> ';
} }
if ($tmpfieldlist == 'content') if ($tmpfieldlist == 'content')
print $form->textwithpicto($langs->trans("Content"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist); print $form->textwithpicto($langs->trans("Content"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist).'<br>';
if ($tmpfieldlist == 'content_lines') if ($tmpfieldlist == 'content_lines')
print $form->textwithpicto($langs->trans("ContentForLines"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . '<br>'; print $form->textwithpicto($langs->trans("ContentForLines"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . '<br>';
// Input field // Input field

View File

@ -68,8 +68,7 @@ if (!function_exists('gzdecode')) {
* Action * Action
*/ */
if ($action == 'addprinter' && $user->admin) if ($action == 'addprinter' && $user->admin) {
{
$error=0; $error=0;
$db->begin(); $db->begin();
if (empty($printername)) { if (empty($printername)) {
@ -81,8 +80,7 @@ if ($action == 'addprinter' && $user->admin)
setEventMessages($langs->trans("PrinterParameterEmpty"), null, 'warnings'); setEventMessages($langs->trans("PrinterParameterEmpty"), null, 'warnings');
} }
if (! $error) if (! $error) {
{
$result= $printer->AddPrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter); $result= $printer->AddPrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter);
if ($result > 0) $error++; if ($result > 0) $error++;
@ -100,8 +98,7 @@ if ($action == 'addprinter' && $user->admin)
$action = ''; $action = '';
} }
if ($action == 'deleteprinter' && $user->admin) if ($action == 'deleteprinter' && $user->admin) {
{
$error=0; $error=0;
$db->begin(); $db->begin();
if (empty($printerid)) { if (empty($printerid)) {
@ -109,8 +106,7 @@ if ($action == 'deleteprinter' && $user->admin)
setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors'); setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
} }
if (! $error) if (! $error) {
{
$result= $printer->DeletePrinter($printerid); $result= $printer->DeletePrinter($printerid);
if ($result > 0) $error++; if ($result > 0) $error++;
@ -128,8 +124,7 @@ if ($action == 'deleteprinter' && $user->admin)
$action = ''; $action = '';
} }
if ($action == 'updateprinter' && $user->admin) if ($action == 'updateprinter' && $user->admin) {
{
$error=0; $error=0;
$db->begin(); $db->begin();
if (empty($printerid)) { if (empty($printerid)) {
@ -137,18 +132,14 @@ if ($action == 'updateprinter' && $user->admin)
setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors'); setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
} }
if (! $error) if (! $error) {
{
$result= $printer->UpdatePrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter, $printerid); $result= $printer->UpdatePrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter, $printerid);
if ($result > 0) $error++; if ($result > 0) $error++;
if (! $error) if (! $error) {
{
$db->commit(); $db->commit();
setEventMessages($langs->trans("PrinterUpdated", $printername), null); setEventMessages($langs->trans("PrinterUpdated", $printername), null);
} } else {
else
{
$db->rollback(); $db->rollback();
dol_print_error($db); dol_print_error($db);
} }
@ -156,24 +147,19 @@ if ($action == 'updateprinter' && $user->admin)
$action = ''; $action = '';
} }
if ($action == 'testprinter' && $user->admin) if ($action == 'testprinter' && $user->admin) {
{
$error=0; $error=0;
if (empty($printerid)) { if (empty($printerid)) {
$error++; $error++;
setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors'); setEventMessages($langs->trans("PrinterIdEmpty"), null, 'errors');
} }
if (! $error) if (! $error) {
{
// test // test
$ret = $printer->SendTestToPrinter($printerid); $ret = $printer->SendTestToPrinter($printerid);
if ($ret == 0) if ($ret == 0) {
{
setEventMessages($langs->trans("TestSentToPrinter", $printername), null); setEventMessages($langs->trans("TestSentToPrinter", $printername), null);
} } else {
else
{
setEventMessages($printer->error, $printer->errors, 'errors'); setEventMessages($printer->error, $printer->errors, 'errors');
} }
} }
@ -181,8 +167,7 @@ if ($action == 'testprinter' && $user->admin)
} }
if ($action == 'updatetemplate' && $user->admin) if ($action == 'updatetemplate' && $user->admin) {
{
$error=0; $error=0;
$db->begin(); $db->begin();
if (empty($templateid)) { if (empty($templateid)) {
@ -190,18 +175,14 @@ if ($action == 'updatetemplate' && $user->admin)
setEventMessages($langs->trans("TemplateIdEmpty"), null, 'errors'); setEventMessages($langs->trans("TemplateIdEmpty"), null, 'errors');
} }
if (! $error) if (! $error) {
{
$result= $printer->UpdateTemplate($templatename, $template, $templateid); $result= $printer->UpdateTemplate($templatename, $template, $templateid);
if ($result > 0) $error++; if ($result > 0) $error++;
if (! $error) if (! $error) {
{
$db->commit(); $db->commit();
setEventMessages($langs->trans("TemplateUpdated", $templatename), null); setEventMessages($langs->trans("TemplateUpdated", $templatename), null);
} } else {
else
{
$db->rollback(); $db->rollback();
dol_print_error($db); dol_print_error($db);
} }
@ -223,8 +204,7 @@ print load_fiche_titre($langs->trans("ReceiptPrinterSetup"), $linkback, 'title_s
$head = receiptprinteradmin_prepare_head($mode); $head = receiptprinteradmin_prepare_head($mode);
if ($mode == 'config' && $user->admin) if ($mode == 'config' && $user->admin) {
{
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=config" autocomplete="off">'; print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=config" autocomplete="off">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
if ($action!='editprinter') { if ($action!='editprinter') {
@ -253,11 +233,9 @@ if ($mode == 'config' && $user->admin)
if ($ret > 0) { if ($ret > 0) {
setEventMessages($printer->error, $printer->errors, 'errors'); setEventMessages($printer->error, $printer->errors, 'errors');
} else { } else {
for ($line=0; $line < $nbofprinters; $line++) for ($line=0; $line < $nbofprinters; $line++) {
{
print '<tr class="oddeven">'; print '<tr class="oddeven">';
if ($action=='editprinter' && $printer->listprinters[$line]['rowid']==$printerid) if ($action=='editprinter' && $printer->listprinters[$line]['rowid']==$printerid) {
{
print '<input type="hidden" name="printerid" value="'.$printer->listprinters[$line]['rowid'].'">'; print '<input type="hidden" name="printerid" value="'.$printer->listprinters[$line]['rowid'].'">';
print '<td><input size="50" type="text" name="printername" value="'.$printer->listprinters[$line]['name'].'"></td>'; print '<td><input size="50" type="text" name="printername" value="'.$printer->listprinters[$line]['name'].'"></td>';
$ret = $printer->selectTypePrinter($printer->listprinters[$line]['fk_type']); $ret = $printer->selectTypePrinter($printer->listprinters[$line]['fk_type']);
@ -291,10 +269,8 @@ if ($mode == 'config' && $user->admin)
} }
} }
if ($action!='editprinter') if ($action!='editprinter') {
{ if ($nbofprinters > 0) {
if ($nbofprinters > 0)
{
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<th>'.$langs->trans("Name").'</th>'; print '<th>'.$langs->trans("Name").'</th>';
print '<th>'.$langs->trans("Type").'</th>'; print '<th>'.$langs->trans("Type").'</th>';
@ -357,8 +333,7 @@ if ($mode == 'config' && $user->admin)
dol_fiche_end(); dol_fiche_end();
} }
if ($mode == 'template' && $user->admin) if ($mode == 'template' && $user->admin) {
{
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=template" autocomplete="off">'; print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?mode=template" autocomplete="off">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
if ($action!='edittemplate') { if ($action!='edittemplate') {
@ -429,8 +404,7 @@ if ($mode == 'template' && $user->admin)
print '<th>'.$langs->trans("Description").'</th>'; print '<th>'.$langs->trans("Description").'</th>';
print "</tr>\n"; print "</tr>\n";
$max = count($printer->tags); $max = count($printer->tags);
for ($tag=0; $tag < $max; $tag++) for ($tag=0; $tag < $max; $tag++) {
{
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>&lt;'.$printer->tags[$tag].'&gt;</td><td>'.$langs->trans(strtoupper($printer->tags[$tag])).'</td>'; print '<td>&lt;'.$printer->tags[$tag].'&gt;</td><td>'.$langs->trans(strtoupper($printer->tags[$tag])).'</td>';
print '</tr>'; print '</tr>';

View File

@ -98,8 +98,7 @@ print '<br>';
$arrayofsocialnetworks=array('jabber'=>'Jabber', 'skype'=>'Skype', 'twitter'=>'Twitter', 'facebook'=>'Facebook'); $arrayofsocialnetworks=array('jabber'=>'Jabber', 'skype'=>'Skype', 'twitter'=>'Twitter', 'facebook'=>'Facebook');
foreach($arrayofsocialnetworks as $snkey => $snlabel) foreach($arrayofsocialnetworks as $snkey => $snlabel) {
{
$consttocheck = 'SOCIALNETWORKS_'.strtoupper($snkey); $consttocheck = 'SOCIALNETWORKS_'.strtoupper($snkey);
if ($conf->use_javascript_ajax) { if ($conf->use_javascript_ajax) {
$link = ajax_constantonoff($consttocheck); $link = ajax_constantonoff($consttocheck);

View File

@ -35,14 +35,15 @@ $what=GETPOST('what', 'alpha');
$export_type=GETPOST('export_type', 'alpha'); $export_type=GETPOST('export_type', 'alpha');
$file=GETPOST('filename_template', 'alpha'); $file=GETPOST('filename_template', 'alpha');
// Load variable for pagination
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield', 'alpha'); $sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha'); $sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOST("page", 'int'); $page = GETPOST("page", 'int');
if (empty($page) || $page == -1 || GETPOST('button_search','alpha') || GETPOST('button_removefilter','alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
$offset = $limit * $page;
if (! $sortorder) $sortorder="DESC"; if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="date"; if (! $sortfield) $sortfield="date";
if ($page < 0) { $page = 0; }
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
$offset = $limit * $page;
if (! $user->admin) accessforbidden(); if (! $user->admin) accessforbidden();

View File

@ -96,8 +96,7 @@ foreach ($modulesdir as $dir)
if (empty($conf->$module->enabled)) $enabled=false; if (empty($conf->$module->enabled)) $enabled=false;
if ($enabled) if ($enabled) {
{
/* /*
* If exists, load the API class for enable module * If exists, load the API class for enable module
* *

View File

@ -1291,7 +1291,7 @@ class ActionComm extends CommonObject
if (! empty($this->location)) if (! empty($this->location))
$tooltip .= '<br><b>' . $langs->trans('Location') . ':</b> ' . $this->location; $tooltip .= '<br><b>' . $langs->trans('Location') . ':</b> ' . $this->location;
if (! empty($this->note)) if (! empty($this->note))
$tooltip .= '<br><b>' . $langs->trans('Note') . ':</b> ' . (dol_textishtml($this->note) ? str_replace(array("\r","\n"), "", $this->note) : $this->note); $tooltip .= '<br><b>' . $langs->trans('Note') . ':</b> ' . (dol_textishtml($this->note) ? str_replace(array("\r","\n"), "", $this->note) : str_replace(array("\r","\n"), '<br>', $this->note));
$linkclose=''; $linkclose='';
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE) && $this->type_color) if (! empty($conf->global->AGENDA_USE_EVENT_TYPE) && $this->type_color)
$linkclose = ' style="background-color:#'.$this->type_color.'"'; $linkclose = ' style="background-color:#'.$this->type_color.'"';

View File

@ -109,8 +109,7 @@ if (is_resource($handle))
print '<tr class="oddeven">'; print '<tr class="oddeven">';
$result=$db->query($sql); $result=$db->query($sql);
if ($result) if ($result) {
{
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $i = 0;
@ -154,8 +153,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."mailing as m";
$sql.= " ORDER BY m.date_creat DESC"; $sql.= " ORDER BY m.date_creat DESC";
$sql.= " LIMIT ".$limit; $sql.= " LIMIT ".$limit;
$result=$db->query($sql); $result=$db->query($sql);
if ($result) if ($result) {
{
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("LastMailings", $limit).'</td>'; print '<td colspan="2">'.$langs->trans("LastMailings", $limit).'</td>';

View File

@ -297,8 +297,7 @@ class Proposals extends DolibarrApi
if ($updateRes > 0) { if ($updateRes > 0) {
return $updateRes; return $updateRes;
} } else {
else {
throw new RestException(400, $this->propal->error); throw new RestException(400, $this->propal->error);
} }
} }

View File

@ -24,8 +24,7 @@
*/ */
// Protection to avoid direct call of template // Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf)) if (empty($conf) || ! is_object($conf)) {
{
print "Error, template page can't be called as URL"; print "Error, template page can't be called as URL";
exit; exit;
} }
@ -54,7 +53,8 @@ foreach($linkedObjectBlock as $key => $objectlink)
?> ?>
<tr class="<?php echo $trclass; ?>" data-element="<?php echo $objectlink->element; ?>" data-id="<?php echo $objectlink->id; ?>" > <tr class="<?php echo $trclass; ?>" data-element="<?php echo $objectlink->element; ?>" data-id="<?php echo $objectlink->id; ?>" >
<td class="linkedcol-element" ><?php echo $langs->trans("Proposal"); ?> <td class="linkedcol-element" ><?php echo $langs->trans("Proposal"); ?>
<?php if(!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) <?php
if(!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES)
{ {
$url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$objectlink->id; $url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$objectlink->id;
print '<a class="objectlinked_importbtn" href="'.$url.'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a>'; print '<a class="objectlinked_importbtn" href="'.$url.'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a>';

View File

@ -66,10 +66,8 @@ print '<tr class="liste_titre">';
print '<th colspan="2">'.$langs->trans("BankChecks")."</th>\n"; print '<th colspan="2">'.$langs->trans("BankChecks")."</th>\n";
print "</tr>\n"; print "</tr>\n";
if ($resql) if ($resql) {
{ if ($row = $db->fetch_row($resql) ) {
if ($row = $db->fetch_row($resql) )
{
$num = $row[0]; $num = $row[0];
} }
print '<tr class="oddeven">'; print '<tr class="oddeven">';

View File

@ -1010,7 +1010,8 @@ class Contact extends CommonObject
} }
// Removed extrafields // Removed extrafields
if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) { // For avoid conflicts if trigger used if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) {
// For avoid conflicts if trigger used
$result=$this->deleteExtraFields($this); $result=$this->deleteExtraFields($this);
if ($result < 0) $error++; if ($result < 0) $error++;
} }

View File

@ -5434,8 +5434,7 @@ abstract class CommonObject
elseif (in_array($type, array('int','integer','price')) || preg_match('/^double(\([0-9],[0-9]\)){0,1}/', $type)) elseif (in_array($type, array('int','integer','price')) || preg_match('/^double(\([0-9],[0-9]\)){0,1}/', $type))
{ {
$morecss = 'maxwidth75'; $morecss = 'maxwidth75';
}elseif ($type == 'url') } elseif ($type == 'url') {
{
$morecss='minwidth400'; $morecss='minwidth400';
} }
elseif ($type == 'boolean') elseif ($type == 'boolean')

View File

@ -1403,8 +1403,7 @@ class DoliDBSqlite3 extends DoliDB
$weekday=self::calc_weekday($first_daynr, !$monday_first); $weekday=self::calc_weekday($first_daynr, !$monday_first);
$calc_year=$year; $calc_year=$year;
if ($month == 1 && $day <= 7-$weekday) if ($month == 1 && $day <= 7-$weekday) {
{
if (!$week_year && (($first_weekday && $weekday != 0) || (!$first_weekday && $weekday >= 4))) if (!$week_year && (($first_weekday && $weekday != 0) || (!$first_weekday && $weekday >= 4)))
return 0; return 0;
$week_year= 1; $week_year= 1;
@ -1415,16 +1414,13 @@ class DoliDBSqlite3 extends DoliDB
if (($first_weekday && $weekday != 0) || (!$first_weekday && $weekday >= 4)) { if (($first_weekday && $weekday != 0) || (!$first_weekday && $weekday >= 4)) {
$days= $daynr - ($first_daynr+ (7-$weekday)); $days= $daynr - ($first_daynr+ (7-$weekday));
} } else {
else {
$days= $daynr - ($first_daynr - $weekday); $days= $daynr - ($first_daynr - $weekday);
} }
if ($week_year && $days >= 52*7) if ($week_year && $days >= 52*7) {
{
$weekday= ($weekday + self::calc_days_in_year($calc_year)) % 7; $weekday= ($weekday + self::calc_days_in_year($calc_year)) % 7;
if ((!$first_weekday && $weekday < 4) || ($first_weekday && $weekday == 0)) if ((!$first_weekday && $weekday < 4) || ($first_weekday && $weekday == 0)) {
{
$calc_year++; $calc_year++;
return 1; return 1;
} }

View File

@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
* *
* @param array $versionarray Tableau de version (vermajeur,vermineur,autre) * @param array $versionarray Tableau de version (vermajeur,vermineur,autre)
* @return string Chaine version * @return string Chaine version
* @see versioncompare
*/ */
function versiontostring($versionarray) function versiontostring($versionarray)
{ {
@ -54,6 +55,7 @@ function versiontostring($versionarray)
* @return int -4,-3,-2,-1 if versionarray1<versionarray2 (value depends on level of difference) * @return int -4,-3,-2,-1 if versionarray1<versionarray2 (value depends on level of difference)
* 0 if same * 0 if same
* 1,2,3,4 if versionarray1>versionarray2 (value depends on level of difference) * 1,2,3,4 if versionarray1>versionarray2 (value depends on level of difference)
* @see versiontostring
*/ */
function versioncompare($versionarray1, $versionarray2) function versioncompare($versionarray1, $versionarray2)
{ {

View File

@ -2367,7 +2367,8 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli
} }
} }
elseif (strtoupper($countrycode) == "MU") elseif (strtoupper($countrycode) == "MU")
{//Maurice {
//Maurice
if(dol_strlen($phone) == 11) if(dol_strlen($phone) == 11)
{//ex: +230_ABC_DE_FG {//ex: +230_ABC_DE_FG
$newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2); $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 3).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2);
@ -2514,9 +2515,11 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli
} }
} }
elseif(strtoupper($countrycode) == "AU") elseif(strtoupper($countrycode) == "AU")
{//Australie {
//Australie
if(dol_strlen($phone) == 12) if(dol_strlen($phone) == 12)
{//ex: +61_A_BCDE_FGHI {
//ex: +61_A_BCDE_FGHI
$newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 1).$separ.substr($newphone, 4, 4).$separ.substr($newphone, 8, 4); $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 1).$separ.substr($newphone, 4, 4).$separ.substr($newphone, 8, 4);
} }
} }
@ -7085,7 +7088,7 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type,
} }
elseif (count($values) == 5) // deprecated elseif (count($values) == 5) // deprecated
{ {
dol_syslog('Passing 5 values in tabs module_parts is deprecated. Please update to 6 with permissions.', LOG_WARNING); dol_syslog('Passing 5 values in tabs module_parts is deprecated. Please update to 6 with permissions.', LOG_WARNING);
if ($values[0] != $type) continue; if ($values[0] != $type) continue;
if ($values[3]) $langs->load($values[3]); if ($values[3]) $langs->load($values[3]);

View File

@ -667,6 +667,10 @@ function dolSavePageContent($filetpl, $object, $objectpage)
$tplcontent.= "require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n"; $tplcontent.= "require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php';\n";
$tplcontent.= "ob_start();\n"; $tplcontent.= "ob_start();\n";
$tplcontent.= "// END PHP ?>\n"; $tplcontent.= "// END PHP ?>\n";
if (! empty($conf->global->WEBSITE_FORCE_DOCTYPE_HTML5))
{
$tplcontent.= "<!DOCTYPE html>\n";
}
$tplcontent.= '<html'.($shortlangcode ? ' lang="'.$shortlangcode.'"':'').'>'."\n"; $tplcontent.= '<html'.($shortlangcode ? ' lang="'.$shortlangcode.'"':'').'>'."\n";
$tplcontent.= '<head>'."\n"; $tplcontent.= '<head>'."\n";
$tplcontent.= '<title>'.dol_string_nohtmltag($objectpage->title, 0, 'UTF-8').'</title>'."\n"; $tplcontent.= '<title>'.dol_string_nohtmltag($objectpage->title, 0, 'UTF-8').'</title>'."\n";

View File

@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
/** /**
* Classe permettant de generer les projets au modele SEPAMandate * Class to generate SEPA mandate
*/ */
class pdf_sepamandate extends ModeleBankAccountDoc class pdf_sepamandate extends ModeleBankAccountDoc

View File

@ -771,8 +771,7 @@ class pdf_einstein extends ModelePDFCommandes
// Show payment mode // Show payment mode
if ($object->mode_reglement_code if ($object->mode_reglement_code
&& $object->mode_reglement_code != 'CHQ' && $object->mode_reglement_code != 'CHQ'
&& $object->mode_reglement_code != 'VIR') && $object->mode_reglement_code != 'VIR') {
{
$pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy); $pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("PaymentMode").':'; $titre = $outputlangs->transnoentities("PaymentMode").':';

View File

@ -831,8 +831,7 @@ class pdf_eratosthene extends ModelePDFCommandes
// Show payment mode // Show payment mode
if ($object->mode_reglement_code if ($object->mode_reglement_code
&& $object->mode_reglement_code != 'CHQ' && $object->mode_reglement_code != 'CHQ'
&& $object->mode_reglement_code != 'VIR') && $object->mode_reglement_code != 'VIR') {
{
$pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy); $pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("PaymentMode").':'; $titre = $outputlangs->transnoentities("PaymentMode").':';

View File

@ -294,8 +294,9 @@ class doc_generic_contract_odt extends ModelePDFContract
if (! empty($usecontact)) if (! empty($usecontact))
{ {
// On peut utiliser le nom de la societe du contact // On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
else { $socobject = $object->contact;
} else {
$socobject = $object->thirdparty; $socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact; $contactobject = $object->contact;

View File

@ -1291,9 +1291,6 @@ class pdf_crabe extends ModelePDFFactures
if (in_array((string) $localtax_type, array('2','4','6'))) continue; if (in_array((string) $localtax_type, array('2','4','6'))) continue;
foreach($localtax_rate as $tvakey => $tvaval) foreach($localtax_rate as $tvakey => $tvaval)
{
// retrieve global local tax
if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
@ -1316,7 +1313,6 @@ class pdf_crabe extends ModelePDFFactures
} }
} }
//} //}
}
// Revenue stamp // Revenue stamp
if (price2num($object->revenuestamp) != 0) if (price2num($object->revenuestamp) != 0)

View File

@ -1377,8 +1377,8 @@ class pdf_sponge extends ModelePDFFactures
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1);
} }
} }
//}
} }
//}
// Revenue stamp // Revenue stamp
if (price2num($object->revenuestamp) != 0) if (price2num($object->revenuestamp) != 0)

View File

@ -130,7 +130,7 @@ class mod_arctic extends ModeleNumRefFicheinter
require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php';
// On d<EFBFBD>fini critere recherche compteur // On défini critere recherche compteur
$mask=$conf->global->FICHINTER_ARTIC_MASK; $mask=$conf->global->FICHINTER_ARTIC_MASK;
if (! $mask) if (! $mask)

View File

@ -321,8 +321,9 @@ class doc_generic_product_odt extends ModelePDFProduct
if (! empty($usecontact)) if (! empty($usecontact))
{ {
// On peut utiliser le nom de la societe du contact // On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
else { $socobject = $object->contact;
} else {
$socobject = $object->thirdparty; $socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact; $contactobject = $object->contact;

View File

@ -321,8 +321,9 @@ class doc_generic_stock_odt extends ModelePDFStock
if (! empty($usecontact)) if (! empty($usecontact))
{ {
// On peut utiliser le nom de la societe du contact // On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
else { $socobject = $object->contact;
} else {
$socobject = $object->thirdparty; $socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use // if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact; $contactobject = $object->contact;

View File

@ -235,7 +235,10 @@ if ($permission) {
</form> </form>
<?php $i++; ?> <?php $i++; ?>
<?php } } ?> <?php
}
}
?>
</div> </div>
</div> </div>

View File

@ -21,8 +21,7 @@
// Protection to avoid direct call of template // Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf)) if (empty($conf) || ! is_object($conf)) {
{
print "Error, template page can't be called as URL"; print "Error, template page can't be called as URL";
exit; exit;
} }
@ -67,13 +66,18 @@ $colorbackhmenu1=join(',', colorStringToArray($colorbackhmenu1)); // Normaliz
?> ?>
<!-- BEGIN PHP TEMPLATE LOGIN.TPL.PHP --> <!-- BEGIN PHP TEMPLATE LOGIN.TPL.PHP -->
<?php if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) { <?php
if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
// For example $conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND = 'https://source.unsplash.com/random' // For example $conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND = 'https://source.unsplash.com/random'
?> ?>
<body class="body bodylogin" style="background-image: url('<?php echo $conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND; ?>'); background-repeat: no-repeat; background-position: center center; background-attachment: fixed; background-size: cover; background-color: #ffffff;"> <body class="body bodylogin" style="background-image: url('<?php echo $conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND; ?>'); background-repeat: no-repeat; background-position: center center; background-attachment: fixed; background-size: cover; background-color: #ffffff;">
<?php } else { ?> <?php
} else {
?>
<body class="body bodylogin"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file=logos/'.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>> <body class="body bodylogin"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file=logos/'.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>>
<?php } ?> <?php
}
?>
<?php if (empty($conf->dol_use_jmobile)) { ?> <?php if (empty($conf->dol_use_jmobile)) { ?>
<script type="text/javascript"> <script type="text/javascript">

View File

@ -200,9 +200,12 @@ $coldisplay=-1; // We remove first td
} }
if (! empty($usemargins)) if (! empty($usemargins))
{ {
if (!empty($user->rights->margins->creer)) {
?>
<td class="margininfos right">
<?php
$coldisplay++;
?> ?>
<?php if (!empty($user->rights->margins->creer)) { ?>
<td class="margininfos right"><?php $coldisplay++; ?>
<!-- For predef product --> <!-- For predef product -->
<?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?> <?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?>
<select id="fournprice_predef" name="fournprice_predef" class="flat right" style="display: none;"></select> <select id="fournprice_predef" name="fournprice_predef" class="flat right" style="display: none;"></select>
@ -211,7 +214,8 @@ $coldisplay=-1; // We remove first td
<input class="flat right" type="text" size="5" id="buying_price" name="buying_price" class="hideobject" value="<?php echo price($line->pa_ht, 0, '', 0); ?>"> <input class="flat right" type="text" size="5" id="buying_price" name="buying_price" class="hideobject" value="<?php echo price($line->pa_ht, 0, '', 0); ?>">
</td> </td>
<?php } ?> <?php } ?>
<?php if ($user->rights->margins->creer) { <?php
if ($user->rights->margins->creer) {
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) if (! empty($conf->global->DISPLAY_MARGIN_RATES))
{ {
$margin_rate = (isset($_POST["np_marginRate"])?GETPOST("np_marginRate", "alpha", 2):(($line->pa_ht == 0)?'':price($line->marge_tx))); $margin_rate = (isset($_POST["np_marginRate"])?GETPOST("np_marginRate", "alpha", 2):(($line->pa_ht == 0)?'':price($line->marge_tx)));

View File

@ -204,13 +204,15 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
<?php } ?> <?php } ?>
<td class="linecolqty nowrap right"><?php $coldisplay++; ?> <td class="linecolqty nowrap right"><?php $coldisplay++; ?>
<?php if ((($line->info_bits & 2) != 2) && $line->special_code != 3) { <?php
if ((($line->info_bits & 2) != 2) && $line->special_code != 3) {
// I comment this because it shows info even when not required // I comment this because it shows info even when not required
// for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated
// must also not be output for most entities (proposal, intervention, ...) // must also not be output for most entities (proposal, intervention, ...)
//if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." "; //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." ";
echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price echo price($line->qty, 0, '', 0, 0); // Yes, it is a quantity, not a price, but we just want the formating role of function price
} else echo '&nbsp;'; ?> } else echo '&nbsp;';
?>
</td> </td>
<?php <?php
@ -308,9 +310,13 @@ $domData .= ' data-product_type="'.$line->product_type.'"';
<?php } else { ?> <?php } else { ?>
<td <?php echo (($conf->browser->layout != 'phone' && empty($disablemove)) ?' class="linecolmove tdlineupdown center"':' class="linecolmove center"'); ?>><?php $coldisplay++; ?></td> <td <?php echo (($conf->browser->layout != 'phone' && empty($disablemove)) ?' class="linecolmove tdlineupdown center"':' class="linecolmove center"'); ?>><?php $coldisplay++; ?></td>
<?php } ?> <?php } ?>
<?php } else { ?> <?php
} else {
?>
<td colspan="3"><?php $coldisplay=$coldisplay+3; ?></td> <td colspan="3"><?php $coldisplay=$coldisplay+3; ?></td>
<?php } ?> <?php
}
?>
<?php if($action == 'selectlines'){ ?> <?php if($action == 'selectlines'){ ?>
<td class="linecolcheck center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php echo $i+1; ?>]" value="<?php echo $line->id; ?>" ></td> <td class="linecolcheck center"><input type="checkbox" class="linecheckbox" name="line_checkbox[<?php echo $i+1; ?>]" value="<?php echo $line->id; ?>" ></td>
<?php } ?> <?php } ?>

View File

@ -446,7 +446,7 @@ if ($num > 0)
print '<tr class="oddeven">'; print '<tr class="oddeven">';
// Ref // Ref
print '<td class="nowrap">'; print '<td class="nowraponall">';
print $object->getNomUrl(1); print $object->getNomUrl(1);
print '</td>'; print '</td>';

View File

@ -206,8 +206,7 @@ class ActionsDatapolicy
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT . '/datapolicy/class/datapolicy.class.php'; require_once DOL_DOCUMENT_ROOT . '/datapolicy/class/datapolicy.class.php';
DataPolicy::sendMailDataPolicyContact($object); DataPolicy::sendMailDataPolicyContact($object);
} } elseif ($parameters['currentcontext'] == 'membercard' && $action == 'send_datapolicy') {
elseif ($parameters['currentcontext'] == 'membercard' && $action == 'send_datapolicy') {
$object->fetch(GETPOST('id')); $object->fetch(GETPOST('id'));
require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT . '/datapolicy/class/datapolicy.class.php'; require_once DOL_DOCUMENT_ROOT . '/datapolicy/class/datapolicy.class.php';

View File

@ -188,8 +188,7 @@ if ($action == 'create' || empty($action))
$total = $expensereport->total_ttc; $total = $expensereport->total_ttc;
// autofill remainder amount // autofill remainder amount
if (! empty($conf->use_javascript_ajax)) if (! empty($conf->use_javascript_ajax)) {
{
print "\n".'<script type="text/javascript" language="javascript">'; print "\n".'<script type="text/javascript" language="javascript">';
//Add js for AutoFill //Add js for AutoFill
print ' $(document).ready(function () {'; print ' $(document).ready(function () {';
@ -197,8 +196,8 @@ if ($action == 'create' || empty($action))
var amount = $(this).data("value"); var amount = $(this).data("value");
document.getElementById($(this).data(\'rowid\')).value = amount ; document.getElementById($(this).data(\'rowid\')).value = amount ;
});'; });';
print ' });'."\n"; print "\t});\n";
print ' </script>'."\n"; print "</script>\n";
} }
print load_fiche_titre($langs->trans("DoPayment")); print load_fiche_titre($langs->trans("DoPayment"));

View File

@ -281,8 +281,7 @@ class Interventions extends DolibarrApi
if ($updateRes > 0) { if ($updateRes > 0) {
return $updateRes; return $updateRes;
} } else {
else {
throw new RestException(400, $this->fichinter->error); throw new RestException(400, $this->fichinter->error);
} }
} }

View File

@ -3082,17 +3082,19 @@ class CommandeFournisseur extends CommonOrder
} }
return 4; return 4;
} }
}elseif(! empty($conf->global->SUPPLIER_ORDER_MORE_THAN_WISHED) ) } elseif (! empty($conf->global->SUPPLIER_ORDER_MORE_THAN_WISHED) ) {
{//set livraison to 'tot' if more products received than wished. (and if $closeopenorder is set to 1 of course...) //set livraison to 'tot' if more products received than wished. (and if $closeopenorder is set to 1 of course...)
$close=0; $close=0;
if( count($diff_array) > 0 ) if( count($diff_array) > 0 )
{//there are some difference between the two arrays {
//there are some difference between the two arrays
//scan the array of results //scan the array of results
foreach($diff_array as $key => $value) foreach($diff_array as $key => $value)
{//if the quantity delivered is greater or equal to wish quantity {
//if the quantity delivered is greater or equal to wish quantity
if($qtydelivered[$key] >= $qtywished[$key] ) if($qtydelivered[$key] >= $qtywished[$key] )
{ {
$close++; $close++;
@ -3101,10 +3103,9 @@ class CommandeFournisseur extends CommonOrder
} }
if($close == count($diff_array)) if($close == count($diff_array)) {
{//all the products are received equal or more than the wished quantity //all the products are received equal or more than the wished quantity
if ($closeopenorder) if ($closeopenorder) {
{
$ret = $this->Livraison($user, $date_liv, 'tot', $comment); // GETPOST("type") is 'tot', 'par', 'nev', 'can' $ret = $this->Livraison($user, $date_liv, 'tot', $comment); // GETPOST("type") is 'tot', 'par', 'nev', 'can'
if ($ret<0) { if ($ret<0) {
return -1; return -1;
@ -3122,7 +3123,8 @@ class CommandeFournisseur extends CommonOrder
} }
} }
else else
{//all the products are not received {
//all the products are not received
$ret = $this->Livraison($user, $date_liv, 'par', $comment); // GETPOST("type") is 'tot', 'par', 'nev', 'can' $ret = $this->Livraison($user, $date_liv, 'par', $comment); // GETPOST("type") is 'tot', 'par', 'nev', 'can'
if ($ret<0) { if ($ret<0) {
return -1; return -1;

View File

@ -156,8 +156,8 @@ DocForAllMembersCards=Generate business cards for all members
DocForOneMemberCards=Generate business cards for a particular member DocForOneMemberCards=Generate business cards for a particular member
DocForLabels=Generate address sheets DocForLabels=Generate address sheets
SubscriptionPayment=Subscription payment SubscriptionPayment=Subscription payment
LastSubscriptionDate=Latest subscription date LastSubscriptionDate=Date of latest subscription payment
LastSubscriptionAmount=Latest subscription amount LastSubscriptionAmount=Amount of latest subscription
MembersStatisticsByCountries=Members statistics by country MembersStatisticsByCountries=Members statistics by country
MembersStatisticsByState=Members statistics by state/province MembersStatisticsByState=Members statistics by state/province
MembersStatisticsByTown=Members statistics by town MembersStatisticsByTown=Members statistics by town
@ -187,7 +187,7 @@ MembersStatisticsByProperties=Members statistics by nature
MembersByNature=This screen show you statistics on members by nature. MembersByNature=This screen show you statistics on members by nature.
MembersByRegion=This screen show you statistics on members by region. MembersByRegion=This screen show you statistics on members by region.
VATToUseForSubscriptions=VAT rate to use for subscriptions VATToUseForSubscriptions=VAT rate to use for subscriptions
NoVatOnSubscription=No TVA for subscriptions NoVatOnSubscription=No VAT for subscriptions
ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS=Product used for subscription line into invoice: %s ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS=Product used for subscription line into invoice: %s
NameOrCompany=Name or company NameOrCompany=Name or company
SubscriptionRecorded=Subscription recorded SubscriptionRecorded=Subscription recorded
@ -195,3 +195,5 @@ NoEmailSentToMember=No email sent to member
EmailSentToMember=Email sent to member at %s EmailSentToMember=Email sent to member at %s
SendReminderForExpiredSubscriptionTitle=Send reminder by email for expired subscription SendReminderForExpiredSubscriptionTitle=Send reminder by email for expired subscription
SendReminderForExpiredSubscription=Send reminder by email to members when subscription is about to expire (parameter is number of days before end of subscription to send the remind. It can be a list of days separated by a semicolon, for example '10;5;0;-5') SendReminderForExpiredSubscription=Send reminder by email to members when subscription is about to expire (parameter is number of days before end of subscription to send the remind. It can be a list of days separated by a semicolon, for example '10;5;0;-5')
MembershipPaid=Membership paid for current period (until %s)
YouMayFindYourInvoiceInThisEmail=You may find your invoice attached to this email

View File

@ -147,7 +147,7 @@ CloneProduct=Clone product or service
ConfirmCloneProduct=Are you sure you want to clone product or service <b>%s</b>? ConfirmCloneProduct=Are you sure you want to clone product or service <b>%s</b>?
CloneContentProduct=Clone all main information of product/service CloneContentProduct=Clone all main information of product/service
ClonePricesProduct=Clone prices ClonePricesProduct=Clone prices
CloneCompositionProduct=Clone packaged product/service CloneCompositionProduct=Clone virtual product/service
CloneCombinationsProduct=Clone product variants CloneCombinationsProduct=Clone product variants
ProductIsUsed=This product is used ProductIsUsed=This product is used
NewRefForClone=Ref. of new product/service NewRefForClone=Ref. of new product/service

View File

@ -195,3 +195,4 @@ NoEmailSentToMember=Aucun e-mail envoyé à l'adhérent
EmailSentToMember=Email envoyé à l'adhérent à %s EmailSentToMember=Email envoyé à l'adhérent à %s
SendReminderForExpiredSubscriptionTitle=Envoyer une relance par mail pour les cotisations expirées SendReminderForExpiredSubscriptionTitle=Envoyer une relance par mail pour les cotisations expirées
SendReminderForExpiredSubscription=Envoyer un rappel par e-mail aux membres lorsque l'adhésion est sur le point d'expirer (le paramètre est le nombre de jours avant la fin de l'adhésion pour envoyer le rappel. Il peut s'agir d'une liste de jours séparé par un point-virgule, par exemple '10;5;0;-5') SendReminderForExpiredSubscription=Envoyer un rappel par e-mail aux membres lorsque l'adhésion est sur le point d'expirer (le paramètre est le nombre de jours avant la fin de l'adhésion pour envoyer le rappel. Il peut s'agir d'une liste de jours séparé par un point-virgule, par exemple '10;5;0;-5')
YouMayFindYourInvoiceInThisEmail=You pourrez trouver votre facture en pièce jointe à cet email

View File

@ -37,8 +37,7 @@ $backtopage = GETPOST('backtopage', 'alpha');
*/ */
if ($action=="update"){ if ($action=="update"){
$res1=dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_README', GETPOST('MODULEBUILDER_SPECIFIC_README'), 'chaine', 0, '', $conf->entity); $res1=dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_README', GETPOST('MODULEBUILDER_SPECIFIC_README'), 'chaine', 0, '', $conf->entity);
if ($res1 < 0) if ($res1 < 0) {
{
setEventMessages('ErrorFailedToSaveDate', null, 'errors'); setEventMessages('ErrorFailedToSaveDate', null, 'errors');
$db->rollback(); $db->rollback();
} }

View File

@ -639,8 +639,7 @@ class MultiCurrency extends CommonObject
curl_close($ch); curl_close($ch);
$response = json_decode($response); $response = json_decode($response);
if ($response->success) if ($response->success) {
{
$TRate = $response->quotes; $TRate = $response->quotes;
$timestamp = $response->timestamp; $timestamp = $response->timestamp;

View File

@ -277,19 +277,19 @@ class PriceExpression
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (! $error) // if (! $error)
{ // {
if (! $notrigger) // if (! $notrigger)
{ // {
// Uncomment this and change MYOBJECT to your own tag if you // // Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger. // // want this action calls a trigger.
//// Call triggers // //// Call triggers
//$result=$this->call_trigger('MYOBJECT_MODIFY',$user); // //$result=$this->call_trigger('MYOBJECT_MODIFY',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} // //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers // //// End call triggers
} // }
} // }
// Commit or rollback // Commit or rollback
if ($error) if ($error)

View File

@ -201,19 +201,19 @@ class PriceGlobalVariable
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (! $error) // if (! $error)
{ // {
if (! $notrigger) // if (! $notrigger)
{ // {
// Uncomment this and change MYOBJECT to your own tag if you // // Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger. // // want this action calls a trigger.
//// Call triggers // //// Call triggers
//$result=$this->call_trigger('MYOBJECT_MODIFY',$user); // //$result=$this->call_trigger('MYOBJECT_MODIFY',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} // //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers // //// End call triggers
} // }
} // }
// Commit or rollback // Commit or rollback
if ($error) if ($error)

View File

@ -225,19 +225,19 @@ class PriceGlobalVariableUpdater
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (! $error) // if (! $error)
{ // {
if (! $notrigger) // if (! $notrigger)
{ // {
// Uncomment this and change MYOBJECT to your own tag if you // // Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger. // // want this action calls a trigger.
//// Call triggers // //// Call triggers
//$result=$this->call_trigger('MYOBJECT_MODIFY',$user); // //$result=$this->call_trigger('MYOBJECT_MODIFY',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} // //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers // //// End call triggers
} // }
} // }
// Commit or rollback // Commit or rollback
if ($error) if ($error)

View File

@ -36,8 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
if (! empty($conf->projet->enabled)) if (! empty($conf->projet->enabled)) {
{
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
} }

View File

@ -507,8 +507,6 @@ class Tasks extends DolibarrApi
*/ */
function addTimeSpent($id, $date, $duration, $user_id = 0, $note = '') function addTimeSpent($id, $date, $duration, $user_id = 0, $note = '')
{ {
if( ! DolibarrApiAccess::$user->rights->projet->creer) { if( ! DolibarrApiAccess::$user->rights->projet->creer) {
throw new RestException(401); throw new RestException(401);
} }

View File

@ -1319,6 +1319,13 @@ if ($source == 'membersubscription')
print '<input type="hidden" name="ref" value="'.dol_escape_htmltag($member->ref).'">'; print '<input type="hidden" name="ref" value="'.dol_escape_htmltag($member->ref).'">';
print '</td></tr>'."\n"; print '</td></tr>'."\n";
if ($object->datefin > 0)
{
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("DateEndSubscription");
print '</td><td class="CTableRow'.($var?'1':'2').'">'.dol_print_date($member->datefin,'day');
print '</td></tr>'."\n";
}
if ($member->last_subscription_date || $member->last_subscription_amount) if ($member->last_subscription_date || $member->last_subscription_amount)
{ {
// Last subscription date // Last subscription date
@ -1589,16 +1596,19 @@ if ($action != 'dopayment')
{ {
print '<br><br><span class="amountpaymentcomplete">'.$langs->trans("InvoicePaid").'</span>'; print '<br><br><span class="amountpaymentcomplete">'.$langs->trans("InvoicePaid").'</span>';
} }
elseif ($source == 'membersubscription' && $object->datefin > dol_now())
{
print '<br><br><span class="amountpaymentcomplete">'.$langs->trans("MembershipPaid").'</span>';
}
elseif ($source == 'donation' && $object->paid) elseif ($source == 'donation' && $object->paid)
{ {
print '<br><br><span class="amountpaymentcomplete">'.$langs->trans("DonationPaid").'</span>'; print '<br><br><span class="amountpaymentcomplete">'.$langs->trans("DonationPaid").'</span>';
} }
else else
{ {
// Membership can be paid and we still allow to make renewal
if ($source == 'membersubscription' && $object->datefin > dol_now())
{
$langs->load("members");
print '<br><span class="amountpaymentcomplete">'.$langs->trans("MembershipPaid", dol_print_date($object->datefin, 'day')).'</span><br>';
}
// Buttons for all payments registration methods // Buttons for all payments registration methods
if ((empty($paymentmethod) || $paymentmethod == 'paybox') && ! empty($conf->paybox->enabled)) if ((empty($paymentmethod) || $paymentmethod == 'paybox') && ! empty($conf->paybox->enabled))

View File

@ -116,7 +116,10 @@ if ($this->control->tpl['fournisseur']) {
<td><?php echo $langs->trans('SupplierCategory'); ?></td> <td><?php echo $langs->trans('SupplierCategory'); ?></td>
<td colspan="3"><?php echo $this->control->tpl['select_suppliercategory']; ?></td> <td colspan="3"><?php echo $this->control->tpl['select_suppliercategory']; ?></td>
</tr> </tr>
<?php } }?> <?php
}
}
?>
<?php if (! empty($conf->barcode->enabled)) { ?> <?php if (! empty($conf->barcode->enabled)) { ?>
<tr> <tr>

View File

@ -113,7 +113,10 @@ if ($this->control->tpl['fournisseur']) {
<td><?php echo $langs->trans('SupplierCategory'); ?></td> <td><?php echo $langs->trans('SupplierCategory'); ?></td>
<td colspan="3"><?php echo $this->control->tpl['select_suppliercategory']; ?></td> <td colspan="3"><?php echo $this->control->tpl['select_suppliercategory']; ?></td>
</tr> </tr>
<?php } }?> <?php
}
}
?>
<?php if (! empty($conf->barcode->enabled)) { ?> <?php if (! empty($conf->barcode->enabled)) { ?>
<tr> <tr>

View File

@ -2011,7 +2011,6 @@ class Societe extends CommonObject
$name=$this->name?$this->name:$this->nom; $name=$this->name?$this->name:$this->nom;
if(!empty($conf->global->SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD)){ if(!empty($conf->global->SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD)){
if(empty($option) && $this->client > 0) $option = 'customer'; if(empty($option) && $this->client > 0) $option = 'customer';
if(empty($option) && $this->fournisseur > 0) $option = 'supplier'; if(empty($option) && $this->fournisseur > 0) $option = 'supplier';
} }
@ -3439,6 +3438,7 @@ class Societe extends CommonObject
$this->capital=empty($conf->global->MAIN_INFO_CAPITAL)?'':$conf->global->MAIN_INFO_CAPITAL; $this->capital=empty($conf->global->MAIN_INFO_CAPITAL)?'':$conf->global->MAIN_INFO_CAPITAL;
$this->forme_juridique_code=empty($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE)?'':$conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE; $this->forme_juridique_code=empty($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE)?'':$conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE;
$this->email=empty($conf->global->MAIN_INFO_SOCIETE_MAIL)?'':$conf->global->MAIN_INFO_SOCIETE_MAIL; $this->email=empty($conf->global->MAIN_INFO_SOCIETE_MAIL)?'':$conf->global->MAIN_INFO_SOCIETE_MAIL;
$this->default_lang = (empty($conf->global->MAIN_LANG_DEFAULT)?'auto':$conf->global->MAIN_LANG_DEFAULT);
$this->logo=empty($conf->global->MAIN_INFO_SOCIETE_LOGO)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO; $this->logo=empty($conf->global->MAIN_INFO_SOCIETE_LOGO)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO;
$this->logo_small=empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL; $this->logo_small=empty($conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_SMALL;
$this->logo_mini=empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI; $this->logo_mini=empty($conf->global->MAIN_INFO_SOCIETE_LOGO_MINI)?'':$conf->global->MAIN_INFO_SOCIETE_LOGO_MINI;

View File

@ -56,29 +56,29 @@ $search_all=trim(GETPOST('search_all', 'alphanohtml')?GETPOST('search_all', 'alp
$search_cti=preg_replace('/^0+/', '', preg_replace('/[^0-9]/', '', GETPOST('search_cti', 'alphanohtml'))); // Phone number without any special chars $search_cti=preg_replace('/^0+/', '', preg_replace('/[^0-9]/', '', GETPOST('search_cti', 'alphanohtml'))); // Phone number without any special chars
$search_id=trim(GETPOST("search_id", "int")); $search_id=trim(GETPOST("search_id", "int"));
$search_nom=trim(GETPOST("search_nom")); $search_nom=trim(GETPOST("search_nom", 'none'));
$search_alias=trim(GETPOST("search_alias")); $search_alias=trim(GETPOST("search_alias", 'none'));
$search_nom_only=trim(GETPOST("search_nom_only")); $search_nom_only=trim(GETPOST("search_nom_only", 'none'));
$search_barcode=trim(GETPOST("search_barcode")); $search_barcode=trim(GETPOST("search_barcode", 'alpha'));
$search_customer_code=trim(GETPOST('search_customer_code')); $search_customer_code=trim(GETPOST('search_customer_code', 'alpha'));
$search_supplier_code=trim(GETPOST('search_supplier_code')); $search_supplier_code=trim(GETPOST('search_supplier_code', 'alpha'));
$search_account_customer_code=trim(GETPOST('search_account_customer_code')); $search_account_customer_code=trim(GETPOST('search_account_customer_code', 'alpha'));
$search_account_supplier_code=trim(GETPOST('search_account_supplier_code')); $search_account_supplier_code=trim(GETPOST('search_account_supplier_code', 'alpha'));
$search_town=trim(GETPOST("search_town")); $search_town=trim(GETPOST("search_town", 'alpha'));
$search_zip=trim(GETPOST("search_zip")); $search_zip=trim(GETPOST("search_zip", 'alpha'));
$search_state=trim(GETPOST("search_state")); $search_state=trim(GETPOST("search_state", 'alpha'));
$search_region=trim(GETPOST("search_region")); $search_region=trim(GETPOST("search_region", 'alpha'));
$search_email=trim(GETPOST('search_email')); $search_email=trim(GETPOST('search_email', 'alpha'));
$search_phone=trim(GETPOST('search_phone')); $search_phone=trim(GETPOST('search_phone', 'alpha'));
$search_fax=trim(GETPOST('search_fax')); $search_fax=trim(GETPOST('search_fax', 'alpha'));
$search_url=trim(GETPOST('search_url')); $search_url=trim(GETPOST('search_url', 'alpha'));
$search_idprof1=trim(GETPOST('search_idprof1')); $search_idprof1=trim(GETPOST('search_idprof1', 'alpha'));
$search_idprof2=trim(GETPOST('search_idprof2')); $search_idprof2=trim(GETPOST('search_idprof2', 'alpha'));
$search_idprof3=trim(GETPOST('search_idprof3')); $search_idprof3=trim(GETPOST('search_idprof3', 'alpha'));
$search_idprof4=trim(GETPOST('search_idprof4')); $search_idprof4=trim(GETPOST('search_idprof4', 'alpha'));
$search_idprof5=trim(GETPOST('search_idprof5')); $search_idprof5=trim(GETPOST('search_idprof5', 'alpha'));
$search_idprof6=trim(GETPOST('search_idprof6')); $search_idprof6=trim(GETPOST('search_idprof6', 'alpha'));
$search_vat=trim(GETPOST('search_vat')); $search_vat=trim(GETPOST('search_vat', 'alpha'));
$search_sale=trim(GETPOST("search_sale", 'int')); $search_sale=trim(GETPOST("search_sale", 'int'));
$search_categ_cus=trim(GETPOST("search_categ_cus", 'int')); $search_categ_cus=trim(GETPOST("search_categ_cus", 'int'));
$search_categ_sup=trim(GETPOST("search_categ_sup", 'int')); $search_categ_sup=trim(GETPOST("search_categ_sup", 'int'));
@ -92,10 +92,11 @@ $search_stcomm=GETPOST('search_stcomm', 'int');
$search_import_key = GETPOST("search_import_key", "alpha"); $search_import_key = GETPOST("search_import_key", "alpha");
$search_btn=GETPOST('button_search', 'alpha'); $search_btn=GETPOST('button_search', 'alpha');
$search_remove_btn=GETPOST('button_removefilter', 'alpha'); $search_remove_btn=GETPOST('button_removefilter', 'alpha');
$search_parent_name = GETPOST('search_parent_name', 'alpha');
$type=GETPOST('type', 'alpha'); $type=GETPOST('type', 'alpha');
$optioncss=GETPOST('optioncss', 'alpha'); $optioncss=GETPOST('optioncss', 'alpha');
$mode=GETPOST("mode", ''); $mode=GETPOST("mode", 'alpha');
$diroutputmassaction=$conf->societe->dir_output . '/temp/massgeneration/'.$user->id; $diroutputmassaction=$conf->societe->dir_output . '/temp/massgeneration/'.$user->id;
@ -195,6 +196,7 @@ $arrayfields=array(
'customerorsupplier'=>array('label'=>'Nature', 'checked'=>1), 'customerorsupplier'=>array('label'=>'Nature', 'checked'=>1),
's.fk_prospectlevel'=>array('label'=>"ProspectLevelShort", 'checked'=>$checkprospectlevel), 's.fk_prospectlevel'=>array('label'=>"ProspectLevelShort", 'checked'=>$checkprospectlevel),
's.fk_stcomm'=>array('label'=>"StatusProsp", 'checked'=>$checkstcomm), 's.fk_stcomm'=>array('label'=>"StatusProsp", 'checked'=>$checkstcomm),
's2.nom'=>array('label'=>'ParentCompany', 'checked'=>0),
's.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), 's.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
's.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), 's.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
's.status'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), 's.status'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
@ -263,6 +265,7 @@ if (empty($reshook))
$search_status=-1; $search_status=-1;
$search_stcomm=''; $search_stcomm='';
$search_level=''; $search_level='';
$search_parent_name=-1;
$search_import_key=''; $search_import_key='';
$toselect=''; $toselect='';
$search_array_options=array(); $search_array_options=array();
@ -308,6 +311,7 @@ if ($search_status=='') $search_status=1; // always display active thirdparty fi
$form=new Form($db); $form=new Form($db);
$formother=new FormOther($db); $formother=new FormOther($db);
$companystatic=new Societe($db); $companystatic=new Societe($db);
$companyparent=new Societe($db);
$formcompany=new FormCompany($db); $formcompany=new FormCompany($db);
$prospectstatic=new Client($db); $prospectstatic=new Client($db);
$prospectstatic->client=2; $prospectstatic->client=2;
@ -342,7 +346,8 @@ $sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.barcode, s.town, s.zip, s
$sql.= " st.libelle as stcomm, s.fk_stcomm as stcomm_id, s.fk_prospectlevel, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,"; $sql.= " st.libelle as stcomm, s.fk_stcomm as stcomm_id, s.fk_prospectlevel, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,";
$sql.= " s.email, s.phone, s.fax, s.url, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4 as idprof4, s.idprof5 as idprof5, s.idprof6 as idprof6, s.tva_intra, s.fk_pays,"; $sql.= " s.email, s.phone, s.fax, s.url, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4 as idprof4, s.idprof5 as idprof5, s.idprof6 as idprof6, s.tva_intra, s.fk_pays,";
$sql.= " s.tms as date_update, s.datec as date_creation,"; $sql.= " s.tms as date_update, s.datec as date_creation,";
$sql.= " s.code_compta,s.code_compta_fournisseur,"; $sql.= " s.code_compta, s.code_compta_fournisseur, s.parent as fk_parent,";
$sql.= " s2.nom as name2,";
$sql.= " typent.code as typent_code,"; $sql.= " typent.code as typent_code,";
$sql.= " staff.code as staff_code,"; $sql.= " staff.code as staff_code,";
$sql.= " country.code as country_code,"; $sql.= " country.code as country_code,";
@ -360,6 +365,7 @@ $parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint; $sql.=$hookmanager->resPrint;
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s2 ON s.parent = s2.rowid";
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields as ef on (s.rowid = ef.fk_object)"; if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields as ef on (s.rowid = ef.fk_object)";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)";
@ -419,6 +425,7 @@ if (!empty($conf->barcode->enabled) && $search_barcode) $sql.= natural_search("s
if ($search_type_thirdparty && $search_type_thirdparty != '-1') $sql.= natural_search("s.fk_typent", $search_type_thirdparty, 2); if ($search_type_thirdparty && $search_type_thirdparty != '-1') $sql.= natural_search("s.fk_typent", $search_type_thirdparty, 2);
if (! empty($search_staff) && $search_staff != '-1') $sql.= natural_search("s.fk_effectif", $search_staff, 2); if (! empty($search_staff) && $search_staff != '-1') $sql.= natural_search("s.fk_effectif", $search_staff, 2);
if ($search_level) $sql .= natural_search("s.fk_prospectlevel", join(',', $search_level), 3); if ($search_level) $sql .= natural_search("s.fk_prospectlevel", join(',', $search_level), 3);
if ($search_parent_name) $sql.= natural_search("s2.nom", $search_parent_name);
if ($search_stcomm != '' && $search_stcomm != -2) $sql.= natural_search("s.fk_stcomm", $search_stcomm, 2); if ($search_stcomm != '' && $search_stcomm != -2) $sql.= natural_search("s.fk_stcomm", $search_stcomm, 2);
if ($search_import_key) $sql.= natural_search("s.import_key", $search_import_key); if ($search_import_key) $sql.= natural_search("s.import_key", $search_import_key);
// Add where from extra fields // Add where from extra fields
@ -457,8 +464,7 @@ $num = $db->num_rows($resql);
$arrayofselected=is_array($toselect)?$toselect:array(); $arrayofselected=is_array($toselect)?$toselect:array();
if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && ($search_all != '' || $search_cti != '') && $action != 'list') if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && ($search_all != '' || $search_cti != '') && $action != 'list') {
{
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$id = $obj->rowid; $id = $obj->rowid;
if (!empty($conf->global->SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD)) { if (!empty($conf->global->SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD)) {
@ -515,6 +521,7 @@ if ($search_type != '') $param.='&search_type='.urlencode($search_type);
if (is_array($search_level) && count($search_level)) foreach($search_level as $slevel) $param.='&search_level[]='.urlencode($slevel); if (is_array($search_level) && count($search_level)) foreach($search_level as $slevel) $param.='&search_level[]='.urlencode($slevel);
if ($search_status != '') $param.='&search_status='.urlencode($search_status); if ($search_status != '') $param.='&search_status='.urlencode($search_status);
if ($search_stcomm != '') $param.='&search_stcomm='.urlencode($search_stcomm); if ($search_stcomm != '') $param.='&search_stcomm='.urlencode($search_stcomm);
if ($search_parent_name != '') $param.='&search_parent_name='.urlencode($search_parent_name);
if ($search_import_key != '') $param.='&search_import_key='.urlencode($search_import_key); if ($search_import_key != '') $param.='&search_import_key='.urlencode($search_import_key);
if ($type != '') $param.='&type='.urlencode($type); if ($type != '') $param.='&type='.urlencode($type);
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
@ -859,6 +866,12 @@ if (! empty($arrayfields['s.fk_stcomm']['checked']))
print $form->selectarray('search_stcomm', $arraystcomm, $search_stcomm, -2); print $form->selectarray('search_stcomm', $arraystcomm, $search_stcomm, -2);
print '</td>'; print '</td>';
} }
if (! empty($arrayfields['s2.nom']['checked']))
{
print '<td class="liste_titre" align="center">';
print '<input class="flat searchstring maxwidth50" type="text" name="search_parent_name" value="'.dol_escape_htmltag($search_parent_name).'">';
print '</td>';
}
// Extra fields // Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
@ -929,6 +942,7 @@ if (! empty($arrayfields['s.tva_intra']['checked'])) print_liste_field_titr
if (! empty($arrayfields['customerorsupplier']['checked'])) print_liste_field_titre(''); // type of customer if (! empty($arrayfields['customerorsupplier']['checked'])) print_liste_field_titre(''); // type of customer
if (! empty($arrayfields['s.fk_prospectlevel']['checked'])) print_liste_field_titre($arrayfields['s.fk_prospectlevel']['label'], $_SERVER["PHP_SELF"], "s.fk_prospectlevel", "", $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['s.fk_prospectlevel']['checked'])) print_liste_field_titre($arrayfields['s.fk_prospectlevel']['label'], $_SERVER["PHP_SELF"], "s.fk_prospectlevel", "", $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['s.fk_stcomm']['checked'])) print_liste_field_titre($arrayfields['s.fk_stcomm']['label'], $_SERVER["PHP_SELF"], "s.fk_stcomm", "", $param, 'align="center"', $sortfield, $sortorder); if (! empty($arrayfields['s.fk_stcomm']['checked'])) print_liste_field_titre($arrayfields['s.fk_stcomm']['label'], $_SERVER["PHP_SELF"], "s.fk_stcomm", "", $param, 'align="center"', $sortfield, $sortorder);
if (! empty($arrayfields['s2.nom']['checked'])) print_liste_field_titre($arrayfields['s2.nom']['label'], $_SERVER["PHP_SELF"], "s2.nom", "", $param, 'align="center"', $sortfield, $sortorder);
// Extra fields // Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields // Hook fields
@ -965,6 +979,7 @@ while ($i < min($num, $limit))
$companystatic->code_compta_fournisseur=$obj->code_compta_fournisseur; $companystatic->code_compta_fournisseur=$obj->code_compta_fournisseur;
$companystatic->fk_prospectlevel=$obj->fk_prospectlevel; $companystatic->fk_prospectlevel=$obj->fk_prospectlevel;
$companystatic->fk_parent = $obj->fk_parent;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
if (! empty($arrayfields['s.rowid']['checked'])) if (! empty($arrayfields['s.rowid']['checked']))
@ -1181,6 +1196,18 @@ while ($i < min($num, $limit))
print '</div></div></td>'; print '</div></div></td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
} }
// Parent company
if (! empty($arrayfields['s2.nom']['checked']))
{
print '<td align="center">';
if ($companystatic->fk_parent > 0)
{
$companyparent->fetch($companystatic->fk_parent);
print $companyparent->getNomUrl(1);
}
print "</td>";
if (! $i) $totalarray['nbfield']++;
}
// Extra fields // Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook // Fields from hook

View File

@ -599,7 +599,8 @@ if (! empty($id) || ! empty($ref))
<td><input type="text" id="price_impact" name="price_impact" value="<?php echo price($price_impact) ?>"> <td><input type="text" id="price_impact" name="price_impact" value="<?php echo price($price_impact) ?>">
<input type="checkbox" id="price_impact_percent" name="price_impact_percent" <?php echo $price_impact_percent ? ' checked' : '' ?>> <label for="price_impact_percent"><?php echo $langs->trans('PercentageVariation') ?></label></td> <input type="checkbox" id="price_impact_percent" name="price_impact_percent" <?php echo $price_impact_percent ? ' checked' : '' ?>> <label for="price_impact_percent"><?php echo $langs->trans('PercentageVariation') ?></label></td>
</tr> </tr>
<?php if ($object->isProduct()) { <?php
if ($object->isProduct()) {
print '<tr>'; print '<tr>';
print '<td><label for="weight_impact">'.$langs->trans('WeightImpact').'</label></td>'; print '<td><label for="weight_impact">'.$langs->trans('WeightImpact').'</label></td>';
print '<td><input type="text" id="weight_impact" name="weight_impact" value="'.price($weight_impact).'"></td>'; print '<td><input type="text" id="weight_impact" name="weight_impact" value="'.price($weight_impact).'"></td>';

View File

@ -194,7 +194,7 @@ class WebsitePage extends CommonObject
if (null !== $website_id) { if (null !== $website_id) {
$sql .= " AND t.fk_website = '" . $this->db->escape($website_id) . "'"; $sql .= " AND t.fk_website = '" . $this->db->escape($website_id) . "'";
if ($page) $sql .= " AND t.pageurl = '" . $this->db->escape($page) . "'"; if ($page) $sql .= " AND t.pageurl = '" . $this->db->escape($page) . "'";
if ($aliasalt) $sql .= " AND t.aliasalt LIKE '%," . $this->db->escape($aliasalt) . ",%'"; if ($aliasalt) $sql .= " AND (t.aliasalt LIKE '%," . $this->db->escape($aliasalt) . ",%' OR t.aliasalt LIKE '%, " . $this->db->escape($aliasalt) . ",%')";
} }
} }
$sql .= $this->db->plimit(1); $sql .= $this->db->plimit(1);

View File

@ -116,6 +116,10 @@ if ($pageid < 0) $pageid = 0;
if (($pageid > 0 || $pageref) && $action != 'addcontainer') if (($pageid > 0 || $pageref) && $action != 'addcontainer')
{ {
$res = $objectpage->fetch($pageid, ($object->id > 0 ? $object->id : null), $pageref); $res = $objectpage->fetch($pageid, ($object->id > 0 ? $object->id : null), $pageref);
if ($res == 0)
{
$res = $objectpage->fetch($pageid, ($object->id > 0 ? $object->id : null), null, $pageref);
}
// Check if pageid is inside the new website, if not we reset param pageid // Check if pageid is inside the new website, if not we reset param pageid
if ($res >= 0 && $object->id > 0) if ($res >= 0 && $object->id > 0)

View File

@ -65,10 +65,13 @@ $version=DOL_VERSION;
$error=0; $error=0;
/* /*
* Main * Main
*/ */
$langs->loadLangs(array('main', 'dict'));
// current date // current date
$now=dol_now(); $now=dol_now();