Merge branch 'develop' of https://github.com/dolibarr/dolibarr into develop

This commit is contained in:
Laurent Destailleur 2020-12-03 00:40:56 +01:00
commit 1343fb48db
829 changed files with 8453 additions and 5267 deletions

View File

@ -167,7 +167,8 @@ NEW: Thirdparty module : box on customer/supplier tab for invoice outsantding am
NEW: ticket classification on create from email collector
NEW: Ticket message notifications when edited from public interface
NEW: translate classification labels in ticket
NEW: Add VAT and juridical status for Algeria
NEW: VAT rate for Angola #15606
NEW: VAT and juridical status for Algeria
NEW: VAT report - Invert constant to show by default zero VAT in reports
NEW: website page fields selection
NEW: Weighing Scale compatibility with TakePOS connector
@ -178,10 +179,8 @@ NEW: #15065 Add option to put the product label in bold in the PDF templates if
For developers:
---------------
NEW: Hook on propal card
NEW: add __MEMBER_TYPE__ substitution key
NEW: add function dolButtonToOpenUrlInDialogPopup() to be able to open page into a popup
NEW: add hooks on stats pages
NEW: show line number on intervention card (via MAIN_VIEW_LINE_NUMBER)
NEW: API get contacts list of a given order
NEW: API endpoint getContacts and Clean results
@ -210,16 +209,20 @@ NEW: standardizes API thirdparties by email like other object
NEW: Thirdparty REST API: endpoint to set price level
NEW: use new category API for project list view
NEW: Triggers Attributes and Attributes values
NEW: add hooks on newpayment page to allow external payment modules
NEW: added incoterms data into the substitution array
NEW: add formConfirm hook on product page
NEW: add send context for ticket
NEW: add a message in error_log after detection of SQL or script injection
NEW: add two hooks printFieldListFrom and printFieldSearchParam
NEW: add __TYPE__ substitution key
NEW: add validation of MX domain for emails
NEW: calculate the virtual stock in transverse mode ( not on getEntity('commande'), ... but on getEntity('stock') )
HOOKs
NEW: Hook on propal card
NEW: add hooks on newpayment page to allow external payment modules
NEW: add hooks on stats pages
NEW: add formConfirm hook on product page
NEW: add two hooks printFieldListFrom and printFieldSearchParam
WARNING:
@ -240,6 +243,7 @@ Following changes may create regressions for some external modules, but were nec
* Depreciate all methods with name ->valide(). Use instead methods ->validate().
***** ChangeLog for 12.0.3 compared to 12.0.2 *****
FIX: 10.0 - when the mime file name is different from the filesystem name, the attachment name should be the mime filename
FIX: 11.0 - expenses lines overlapping the total amounts frame
@ -266,7 +270,7 @@ FIX: Look and feel v12: First tab must be name of object
FIX: missing entity check
FIX: missing param for hook
FIX: Missing transaction on PO actions
FIX: MySql Strict mode
FIX: MySQL Strict mode
FIX: param entity in html form file
FIX: Problems on FEC format
FIX: round stock value on product list

View File

@ -140,15 +140,18 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
### Other general features
- Localization in most major languages
- Multi-Language Support
- Multi-Users and groups with finely grained rights
- Multi-currency
- Multi-company by adding of an external module
- Multi-Currency
- Multi-Company (by adding of an external module)
- Very user friendly and easy to use
- customizable Dashboard
- Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one)
- APIs
- APIs (REST, SOAP)
- Code that is easy to understand, maintain and develop (PHP with no heavy framework; trigger and hook architecture)
- Support a lot of country specific features:
- Spanish Tax RE and ISPF
- French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM)

View File

@ -1,48 +1,62 @@
README (English)
Path: /dolibarr/build/README
##################################################
Building packages
##################################################
All sub-directories of "build" directory contains files (setup or binary tools) required to build automatically Dolibarr packages.
There are several tools:
There are several tools:
- To build full Dolibarr packages, launch the script
> Launch command perl makepack-dolibarr.pl
Note: Prerequisites to build tgz, debian, rpm package
--------------------------------------------------------------------------------------------------
Prerequisites to build tgz, debian, rpm package:
> apt-get install tar dpkg dpatch p7zip-full rpm zip
Note: Prerequisites to build autoexe DoliWamp package:
--------------------------------------------------------------------------------------------------
Prerequisites to build autoexe DoliWamp package:
> apt-get install wine q4wine
> Launch "wine cmd" to check a drive Z: pointing to / exists.
> Install InnoSetup
For example by running isetup-5.3.9.exe (http://www.jrsoftware.org)
For example by running isetup-5.5.8.exe (https://www.jrsoftware.org) https://files.jrsoftware.org/is/5/
> Install WampServer into "C:\wamp64" to have Apache, PHP and MariaDB
For example by running wampserver3.2.0_x64.exe (http://www.wampserver.com). See file build/exe/doliwamp.iss to know the doliwamp version currently setup.
For example by running wampserver3.2.0_x64.exe (https://www.wampserver.com).
See file build/exe/doliwamp.iss to know the doliwamp version currently setup.
> Add path to ISCC into PATH windows var:
Launch wine cmd, then regedit and add entry int HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment\PATH
> To build manually the .exe from Windows (running from makepack-dolibarr.pl script is however recommanded),
open file build/exe/doliwamp.iss and click on button "Compile".
The .exe file will be build into directory build.
--------------------------------------------------------------------------------------------------
- To build a theme package, launch the script
> perl makepack-dolibarrtheme.pl
--------------------------------------------------------------------------------------------------
- To build a package for a module, launch the script
> perl makepack-dolibarrmodule.pl
--------------------------------------------------------------------------------------------------
- To build developper documentation, launch the script
> perl dolibarr-doxygen-build.pl
--------------------------------------------------------------------------------------------------
Note:
The build directory and all its contents is absolutely not required to make Dolibarr working.

View File

@ -503,7 +503,10 @@ if ($nboftargetok) {
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/mysql/README`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/pgsql/README`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/install/mssql`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/install/mssql`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/install/sqlite3`;
$ret=`rm -fr $BUILDROOT/$PROJECT/node_modules`;
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/ansible`;
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/codesniffer`;

View File

@ -187,7 +187,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br>';
}*/
}
if (isset($_POST["country"]) && ($_POST["country"] == '0') && ($id != 2))
if (GETPOSTISSET("country") && (GETPOST("country") == '0') && ($id != 2))
{
$ok = 0;
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Country")), null, 'errors');

View File

@ -247,7 +247,7 @@ if ($action == 'create') {
// Chart of accounts type
print '<tr><td>'.$langs->trans("Pcgtype").'</td>';
print '<td>';
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(isset($_POST['pcg_type']) ?GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(GETPOSTISSET('pcg_type') ? GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
print '</td></tr>';
print '</table>';
@ -309,7 +309,7 @@ if ($action == 'create') {
// Chart of accounts type
print '<tr><td>'.$langs->trans("Pcgtype").'</td>';
print '<td>';
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(isset($_POST['pcg_type']) ?GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(GETPOSTISSET('pcg_type') ? GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
print '</td></tr>';
print '</table>';

View File

@ -168,7 +168,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
}
}
if (isset($_POST["code"]))
if (GETPOSTISSET("code"))
{
if ($_POST["code"] == '0')
{

View File

@ -108,7 +108,7 @@ $hookmanager->initHooks(array('bookkeepinglist'));
$formaccounting = new FormAccounting($db);
$form = new Form($db);
if (!in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !isset($_POST['formfilteraction']) && GETPOST('page', 'int') == '' && !GETPOST('noreset', 'int') && $user->rights->accounting->mouvements->export)
if (!in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOST('page', 'int') == '' && !GETPOST('noreset', 'int') && $user->rights->accounting->mouvements->export)
{
if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('restore_lastsearch_values'))
{
@ -632,19 +632,19 @@ $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $obj
if (empty($reshook)) {
// Button re-export
if (!empty($conf->global->ACCOUNTING_REEXPORT)) {
$newcardbutton = '<a class="valignmiddle" href="' . $_SERVER['PHP_SELF'] . '?action=setreexport&token=' . newToken() . '&value=0' . ($param ? '&' . $param : '') . '">' . img_picto($langs->trans("Activated"), 'switch_on') . '</a> ';
$newcardbutton = '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?action=setreexport&token='.newToken().'&value=0'.($param ? '&'.$param : '').'">'.img_picto($langs->trans("Activated"), 'switch_on').'</a> ';
} else {
$newcardbutton = '<a class="valignmiddle" href="' . $_SERVER['PHP_SELF'] . '?action=setreexport&token=' . newToken() . '&value=1' . ($param ? '&' . $param : '') . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a> ';
$newcardbutton = '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?action=setreexport&token='.newToken().'&value=1'.($param ? '&'.$param : '').'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a> ';
}
$newcardbutton .= '<span class="valignmiddle marginrightonly">' . $langs->trans("IncludeDocsAlreadyExported") . '</span>';
$newcardbutton .= '<span class="valignmiddle marginrightonly">'.$langs->trans("IncludeDocsAlreadyExported").'</span>';
$newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList") . ' (' . $listofformat[$formatexportset] . ')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"] . '?action=export_file' . ($param ? '&' . $param : ''), $user->rights->accounting->mouvements->export);
$newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file'.($param ? '&'.$param : ''), $user->rights->accounting->mouvements->export);
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?' . $param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?' . $param, '', 1, array('morecss' => 'marginleftonly'));
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly'));
$url = './card.php?action=create';
if (!empty($socid)) $url .= '&socid=' . $socid;
if (!empty($socid)) $url .= '&socid='.$socid;
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', $url, '', $user->rights->accounting->mouvements->creer);
}

View File

@ -379,12 +379,12 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
$newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?' . $param);
$newcardbutton .= dolGetButtonTitle($langs->trans('VueByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?' . $param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
$newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
$newcardbutton .= dolGetButtonTitle($langs->trans('VueByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
$newcardbutton .= ' &nbsp; ';
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT . '/accountancy/bookkeeping/card.php?action=create');
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create');
}
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);

View File

@ -380,8 +380,8 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
$newcardbutton = dolGetButtonTitle($langs->trans('ViewAccountList'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php', '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT . '/accountancy/bookkeeping/card.php?action=create');
$newcardbutton = dolGetButtonTitle($langs->trans('ViewAccountList'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php', '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create');
}
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);

View File

@ -57,8 +57,8 @@ class AccountancyExport
public static $EXPORT_TYPE_OPENCONCERTO = 100;
public static $EXPORT_TYPE_LDCOMPTA = 110;
public static $EXPORT_TYPE_LDCOMPTA10 = 120;
public static $EXPORT_TYPE_GESTINUMV3 = 130;
public static $EXPORT_TYPE_GESTINUMV5 = 135;
public static $EXPORT_TYPE_GESTINUMV3 = 130;
public static $EXPORT_TYPE_GESTINUMV5 = 135;
public static $EXPORT_TYPE_FEC = 1000;
@ -115,11 +115,11 @@ class AccountancyExport
self::$EXPORT_TYPE_AGIRIS => $langs->trans('Modelcsv_agiris'),
self::$EXPORT_TYPE_OPENCONCERTO => $langs->trans('Modelcsv_openconcerto'),
self::$EXPORT_TYPE_SAGE50_SWISS => $langs->trans('Modelcsv_Sage50_Swiss'),
self::$EXPORT_TYPE_CHARLEMAGNE => $langs->trans('Modelcsv_charlemagne'),
self::$EXPORT_TYPE_CHARLEMAGNE => $langs->trans('Modelcsv_charlemagne'),
self::$EXPORT_TYPE_LDCOMPTA => $langs->trans('Modelcsv_LDCompta'),
self::$EXPORT_TYPE_LDCOMPTA10 => $langs->trans('Modelcsv_LDCompta10'),
self::$EXPORT_TYPE_GESTINUMV3 => $langs->trans('Modelcsv_Gestinum_v3'),
self::$EXPORT_TYPE_GESTINUMV5 => $langs->trans('Modelcsv_Gestinum_v5'),
self::$EXPORT_TYPE_GESTINUMV3 => $langs->trans('Modelcsv_Gestinum_v3'),
self::$EXPORT_TYPE_GESTINUMV5 => $langs->trans('Modelcsv_Gestinum_v5'),
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
);
@ -148,12 +148,12 @@ class AccountancyExport
self::$EXPORT_TYPE_COGILOG => 'cogilog',
self::$EXPORT_TYPE_AGIRIS => 'agiris',
self::$EXPORT_TYPE_OPENCONCERTO => 'openconcerto',
self::$EXPORT_TYPE_SAGE50_SWISS => 'sage50ch',
self::$EXPORT_TYPE_CHARLEMAGNE => 'charlemagne',
self::$EXPORT_TYPE_LDCOMPTA => 'ldcompta',
self::$EXPORT_TYPE_LDCOMPTA10 => 'ldcompta10',
self::$EXPORT_TYPE_GESTINUMV3 => 'gestinumv3',
self::$EXPORT_TYPE_GESTINUMV5 => 'gestinumv5',
self::$EXPORT_TYPE_SAGE50_SWISS => 'sage50ch',
self::$EXPORT_TYPE_CHARLEMAGNE => 'charlemagne',
self::$EXPORT_TYPE_LDCOMPTA => 'ldcompta',
self::$EXPORT_TYPE_LDCOMPTA10 => 'ldcompta10',
self::$EXPORT_TYPE_GESTINUMV3 => 'gestinumv3',
self::$EXPORT_TYPE_GESTINUMV5 => 'gestinumv5',
self::$EXPORT_TYPE_FEC => 'fec',
);
@ -208,9 +208,9 @@ class AccountancyExport
self::$EXPORT_TYPE_AGIRIS => array(
'label' => $langs->trans('Modelcsv_agiris'),
),
self::$EXPORT_TYPE_OPENCONCERTO => array(
'label' => $langs->trans('Modelcsv_openconcerto'),
),
self::$EXPORT_TYPE_OPENCONCERTO => array(
'label' => $langs->trans('Modelcsv_openconcerto'),
),
self::$EXPORT_TYPE_SAGE50_SWISS => array(
'label' => $langs->trans('Modelcsv_Sage50_Swiss'),
),
@ -218,18 +218,18 @@ class AccountancyExport
'label' => $langs->trans('Modelcsv_charlemagne'),
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
),
self::$EXPORT_TYPE_LDCOMPTA => array(
'label' => $langs->trans('Modelcsv_LDCompta'),
),
self::$EXPORT_TYPE_LDCOMPTA => array(
'label' => $langs->trans('Modelcsv_LDCompta'),
),
self::$EXPORT_TYPE_LDCOMPTA10 => array(
'label' => $langs->trans('Modelcsv_LDCompta10'),
),
self::$EXPORT_TYPE_GESTINUMV3 => array(
'label' => $langs->trans('Modelcsv_Gestinumv3'),
),
self::$EXPORT_TYPE_GESTINUMV5 => array(
'label' => $langs->trans('Modelcsv_Gestinumv5'),
),
'label' => $langs->trans('Modelcsv_LDCompta10'),
),
self::$EXPORT_TYPE_GESTINUMV3 => array(
'label' => $langs->trans('Modelcsv_Gestinumv3'),
),
self::$EXPORT_TYPE_GESTINUMV5 => array(
'label' => $langs->trans('Modelcsv_Gestinumv5'),
),
self::$EXPORT_TYPE_FEC => array(
'label' => $langs->trans('Modelcsv_FEC'),
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
@ -307,21 +307,21 @@ class AccountancyExport
case self::$EXPORT_TYPE_CHARLEMAGNE :
$this->exportCharlemagne($TData);
break;
case self::$EXPORT_TYPE_LDCOMPTA :
$this->exportLDCompta($TData);
break;
case self::$EXPORT_TYPE_LDCOMPTA10 :
$this->exportLDCompta10($TData);
break;
case self::$EXPORT_TYPE_GESTINUMV3 :
$this->exportGestimumV3($TData);
break;
case self::$EXPORT_TYPE_GESTINUMV5 :
$this->exportGestimumV5($TData);
break;
case self::$EXPORT_TYPE_FEC :
$this->exportFEC($TData);
break;
case self::$EXPORT_TYPE_LDCOMPTA :
$this->exportLDCompta($TData);
break;
case self::$EXPORT_TYPE_LDCOMPTA10 :
$this->exportLDCompta10($TData);
break;
case self::$EXPORT_TYPE_GESTINUMV3 :
$this->exportGestimumV3($TData);
break;
case self::$EXPORT_TYPE_GESTINUMV5 :
$this->exportGestimumV5($TData);
break;
case self::$EXPORT_TYPE_FEC :
$this->exportFEC($TData);
break;
default:
$this->errors[] = $langs->trans('accountancy_error_modelnotfound');
break;
@ -1484,136 +1484,136 @@ class AccountancyExport
}
}
/**
* Export format : Gestimum V3
*
* @param array $objectLines data
*
* @return void
*/
public function exportGestimumV3($objectLines)
/**
* Export format : Gestimum V3
*
* @param array $objectLines data
*
* @return void
*/
public function exportGestimumV3($objectLines)
{
global $langs;
global $langs;
$this->separator = ',';
$this->separator = ',';
$invoices_infos = array();
$supplier_invoices_infos = array();
foreach ($objectLines as $line) {
$date = dol_print_date($line->doc_date, '%d/%m/%Y');
$invoices_infos = array();
$supplier_invoices_infos = array();
foreach ($objectLines as $line) {
$date = dol_print_date($line->doc_date, '%d/%m/%Y');
$invoice_ref = $line->doc_ref;
$company_name = "";
$invoice_ref = $line->doc_ref;
$company_name = "";
if (($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice') && $line->fk_doc > 0) {
if (($line->doc_type == 'customer_invoice' && !isset($invoices_infos[$line->fk_doc])) ||
($line->doc_type == 'supplier_invoice' && !isset($supplier_invoices_infos[$line->fk_doc]))) {
if ($line->doc_type == 'customer_invoice') {
// Get new customer invoice ref and company name
$sql = 'SELECT f.facnumber, s.nom FROM ' . MAIN_DB_PREFIX . 'facture as f';
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON f.fk_soc = s.rowid';
$sql .= ' WHERE f.rowid = ' . $line->fk_doc;
$resql = $this->db->query($sql);
if ($resql) {
if ($obj = $this->db->fetch_object($resql)) {
// Save invoice infos
$invoices_infos[$line->fk_doc] = array('ref' => $obj->facnumber, 'company_name' => $obj->nom);
$invoice_ref = $obj->facnumber;
$company_name = $obj->nom;
}
}
} else {
// Get new supplier invoice ref and company name
$sql = 'SELECT ff.ref, s.nom FROM ' . MAIN_DB_PREFIX . 'facture_fourn as ff';
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON ff.fk_soc = s.rowid';
$sql .= ' WHERE ff.rowid = ' . $line->fk_doc;
$resql = $this->db->query($sql);
if ($resql) {
if ($obj = $this->db->fetch_object($resql)) {
// Save invoice infos
$supplier_invoices_infos[$line->fk_doc] = array('ref' => $obj->ref, 'company_name' => $obj->nom);
$invoice_ref = $obj->ref;
$company_name = $obj->nom;
}
}
}
} elseif ($line->doc_type == 'customer_invoice') {
// Retrieve invoice infos
$invoice_ref = $invoices_infos[$line->fk_doc]['ref'];
$company_name = $invoices_infos[$line->fk_doc]['company_name'];
} else {
// Retrieve invoice infos
$invoice_ref = $supplier_invoices_infos[$line->fk_doc]['ref'];
$company_name = $supplier_invoices_infos[$line->fk_doc]['company_name'];
}
}
if (($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice') && $line->fk_doc > 0) {
if (($line->doc_type == 'customer_invoice' && !isset($invoices_infos[$line->fk_doc])) ||
($line->doc_type == 'supplier_invoice' && !isset($supplier_invoices_infos[$line->fk_doc]))) {
if ($line->doc_type == 'customer_invoice') {
// Get new customer invoice ref and company name
$sql = 'SELECT f.facnumber, s.nom FROM ' . MAIN_DB_PREFIX . 'facture as f';
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON f.fk_soc = s.rowid';
$sql .= ' WHERE f.rowid = ' . $line->fk_doc;
$resql = $this->db->query($sql);
if ($resql) {
if ($obj = $this->db->fetch_object($resql)) {
// Save invoice infos
$invoices_infos[$line->fk_doc] = array('ref' => $obj->facnumber, 'company_name' => $obj->nom);
$invoice_ref = $obj->facnumber;
$company_name = $obj->nom;
}
}
} else {
// Get new supplier invoice ref and company name
$sql = 'SELECT ff.ref, s.nom FROM ' . MAIN_DB_PREFIX . 'facture_fourn as ff';
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON ff.fk_soc = s.rowid';
$sql .= ' WHERE ff.rowid = ' . $line->fk_doc;
$resql = $this->db->query($sql);
if ($resql) {
if ($obj = $this->db->fetch_object($resql)) {
// Save invoice infos
$supplier_invoices_infos[$line->fk_doc] = array('ref' => $obj->ref, 'company_name' => $obj->nom);
$invoice_ref = $obj->ref;
$company_name = $obj->nom;
}
}
}
} elseif ($line->doc_type == 'customer_invoice') {
// Retrieve invoice infos
$invoice_ref = $invoices_infos[$line->fk_doc]['ref'];
$company_name = $invoices_infos[$line->fk_doc]['company_name'];
} else {
// Retrieve invoice infos
$invoice_ref = $supplier_invoices_infos[$line->fk_doc]['ref'];
$company_name = $supplier_invoices_infos[$line->fk_doc]['company_name'];
}
}
print $line->id . $this->separator;
print $date . $this->separator;
print substr($line->code_journal, 0, 4) . $this->separator;
print $line->id . $this->separator;
print $date . $this->separator;
print substr($line->code_journal, 0, 4) . $this->separator;
if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) {
print length_accountg($line->subledger_account) . $this->separator;
} else {
print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator;
}
//Libellé Auto
print $this->separator;
//print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"' . $this->separator;
//Libellé manuel
print dol_trunc(str_replace('"', '', $invoice_ref . (!empty($company_name) ? ' - ' : '') . $company_name), 40, 'right', 'UTF-8', 1) . $this->separator;
//Numéro de pièce
print dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1) . $this->separator;
//Devise
print 'EUR' . $this->separator;
//Montant
print price2num(abs($line->montant)) . $this->separator;
//Sens
print $line->sens . $this->separator;
//Code lettrage
print $this->separator;
//Date Echéance
print $date;
print $this->end_line;
}
}
if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) {
print length_accountg($line->subledger_account) . $this->separator;
} else {
print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator;
}
//Libellé Auto
print $this->separator;
//print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"' . $this->separator;
//Libellé manuel
print dol_trunc(str_replace('"', '', $invoice_ref . (!empty($company_name) ? ' - ' : '') . $company_name), 40, 'right', 'UTF-8', 1) . $this->separator;
//Numéro de pièce
print dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1) . $this->separator;
//Devise
print 'EUR' . $this->separator;
//Montant
print price2num(abs($line->montant)) . $this->separator;
//Sens
print $line->sens . $this->separator;
//Code lettrage
print $this->separator;
//Date Echéance
print $date;
print $this->end_line;
}
}
/**
* Export format : Gestimum V5
*
* @param array $objectLines data
*
* @return void
*/
public function exportGestimumV5($objectLines)
/**
* Export format : Gestimum V5
*
* @param array $objectLines data
*
* @return void
*/
public function exportGestimumV5($objectLines)
{
$this->separator = ',';
$this->separator = ',';
foreach ($objectLines as $line) {
$date = dol_print_date($line->doc_date, '%d%m%Y');
foreach ($objectLines as $line) {
$date = dol_print_date($line->doc_date, '%d%m%Y');
print $line->id . $this->separator;
print $date . $this->separator;
print substr($line->code_journal, 0, 4) . $this->separator;
if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) {
print length_accountg($line->subledger_account) . $this->separator;
} else {
print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator;
}
print $this->separator;
//print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"' . $this->separator;
print '"'.dol_trunc(str_replace('"', '', $line->doc_ref), 40, 'right', 'UTF-8', 1).'"' . $this->separator;
print '"'.dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1).'"'.$this->separator;
print price2num($line->montant).$this->separator;
print $line->sens.$this->separator;
print $date . $this->separator;
print $this->separator;
print $this->separator;
print 'EUR';
print $this->end_line;
}
}
print $line->id . $this->separator;
print $date . $this->separator;
print substr($line->code_journal, 0, 4) . $this->separator;
if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) {
print length_accountg($line->subledger_account) . $this->separator;
} else {
print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator;
}
print $this->separator;
//print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"' . $this->separator;
print '"'.dol_trunc(str_replace('"', '', $line->doc_ref), 40, 'right', 'UTF-8', 1).'"' . $this->separator;
print '"'.dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1).'"'.$this->separator;
print price2num($line->montant).$this->separator;
print $line->sens.$this->separator;
print $date . $this->separator;
print $this->separator;
print $this->separator;
print 'EUR';
print $this->end_line;
}
}
/**
* trunc

View File

@ -437,13 +437,15 @@ if ($result) {
// Get thirdparty
$tmppayment->fetch($links[$key]['url_id']);
$arrayofamounts = $tmppayment->getAmountsArray();
foreach ($arrayofamounts as $invoiceid => $amount)
{
$tmpinvoice->fetch($invoiceid);
$tmpinvoice->fetch_thirdparty();
if ($tmpinvoice->thirdparty->code_compta)
if (is_array($arrayofamounts)) {
foreach ($arrayofamounts as $invoiceid => $amount)
{
$tabtp[$obj->rowid][$tmpinvoice->thirdparty->code_compta] += $amount;
$tmpinvoice->fetch($invoiceid);
$tmpinvoice->fetch_thirdparty();
if ($tmpinvoice->thirdparty->code_compta)
{
$tabtp[$obj->rowid][$tmpinvoice->thirdparty->code_compta] += $amount;
}
}
}
}

View File

@ -621,18 +621,18 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
foreach ($arrayofvat[$key] as $k => $mt) {
if ($mt) {
print '"' . $key . '"' . $sep;
print '"' . $date . '"' . $sep;
print '"' . $val["ref"] . '"' . $sep;
print '"' . utf8_decode(dol_trunc($companystatic->name, 32)) . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
print '""' . $sep;
print '"' . $langs->trans("VAT") . ' - ' . join(', ', $def_tva[$key][$k]) . ' %"' . $sep;
print '"' . utf8_decode(dol_trunc($companystatic->name, 16)) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT") . join(', ', $def_tva[$key][$k]) . ' %' . ($numtax ? ' - Localtax ' . $numtax : '') . '"' . $sep;
print '"' . ($mt < 0 ? price(-$mt) : '') . '"' . $sep;
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
print '"' . $journal . '"';
print '"'.$key.'"'.$sep;
print '"'.$date.'"'.$sep;
print '"'.$val["ref"].'"'.$sep;
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
print '""'.$sep;
print '"'.$langs->trans("VAT").' - '.join(', ', $def_tva[$key][$k]).' %"'.$sep;
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$invoicestatic->ref.' - '.$langs->trans("VAT").join(', ', $def_tva[$key][$k]).' %'.($numtax ? ' - Localtax '.$numtax : '').'"'.$sep;
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
print '"'.$journal.'"';
print "\n";
}
}

View File

@ -382,14 +382,12 @@ if (empty($reshook)) {
if ($action == 'add' && $user->rights->adherent->creer) {
if ($canvas) $object->canvas = $canvas;
$birthdate = '';
if (isset($_POST["birthday"]) && $_POST["birthday"]
&& isset($_POST["birthmonth"]) && $_POST["birthmonth"]
&& isset($_POST["birthyear"]) && $_POST["birthyear"]) {
$birthdate = dol_mktime(12, 0, 0, $_POST["birthmonth"], $_POST["birthday"], $_POST["birthyear"]);
if (GETPOSTISSET("birthday") && GETPOST("birthday") && GETPOSTISSET("birthmonth") && GETPOST("birthmonth") && GETPOSTISSET("birthyear") && GETPOST("birthyear")) {
$birthdate = dol_mktime(12, 0, 0, GETPOST("birthmonth", 'int'), GETPOST("birthday", 'int'), GETPOST("birthyear", 'int'));
}
$datesubscription = '';
if (isset($_POST["reday"]) && isset($_POST["remonth"]) && isset($_POST["reyear"])) {
$datesubscription = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
if (GETPOSTISSET("reday") && GETPOSTISSET("remonth") && GETPOSTISSET("reyear")) {
$datesubscription = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST("reday", "int"), GETPOST("reyear", "int"));
}
$typeid = GETPOST("typeid", 'int');
@ -1075,7 +1073,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Password
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
print '<tr><td class="fieldrequired">'.$langs->trans("Password").'</td><td><input type="password" name="pass" class="minwidth300" maxlength="50" value="'.(isset($_POST["pass"]) ?GETPOST("pass", '', 2) : $object->pass).'"></td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("Password").'</td><td><input type="password" name="pass" class="minwidth300" maxlength="50" value="'.(GETPOSTISSET("pass") ? GETPOST("pass", '', 2) : $object->pass).'"></td></tr>';
}
// Morphy
$morphys["phy"] = $langs->trans("Physical");
@ -1134,7 +1132,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// EMail
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED ? '<span class="fieldrequired">' : '').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED ? '</span>' : '').'</td>';
print '<td>'.img_picto('', 'object_email').' <input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(isset($_POST["member_email"]) ?GETPOST("member_email", '', 2) : $object->email).'"></td></tr>';
print '<td>'.img_picto('', 'object_email').' <input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(GETPOSTISSET("member_email") ? GETPOST("member_email", '', 2) : $object->email).'"></td></tr>';
// Address
print '<tr><td>'.$langs->trans("Address").'</td><td>';
@ -1151,14 +1149,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Country
//$object->country_id=$object->country_id?$object->country_id:$mysoc->country_id; // In edit mode we don't force to company country if not defined
print '<tr><td>'.$langs->trans('Country').'</td><td>';
print $form->select_country(isset($_POST["country_id"]) ? $_POST["country_id"] : $object->country_id, 'country_id');
print $form->select_country(GETPOSTISSET("country_id") ? GETPOST("country_id", "alpha") : $object->country_id, 'country_id');
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
print '</td></tr>';
// State
if (empty($conf->global->MEMBER_DISABLE_STATE)) {
print '<tr><td>'.$langs->trans('State').'</td><td>';
print $formcompany->select_state($object->state_id, isset($_POST["country_id"]) ?GETPOST("country_id") : $object->country_id);
print $formcompany->select_state($object->state_id, GETPOSTISSET("country_id") ? GETPOST("country_id", "alpha") : $object->country_id);
print '</td></tr>';
}

View File

@ -79,8 +79,8 @@ class Adherent extends CommonObject
public $pass;
/**
* @var string Clear password in database (defined if DATABASE_PWD_ENCRYPTED=0)
*/
* @var string Clear password in database (defined if DATABASE_PWD_ENCRYPTED=0)
*/
public $pass_indatabase;
/**

View File

@ -250,10 +250,10 @@ class Subscription extends CommonObject
$this->db->begin();
if (!is_numeric($this->amount)) {
$this->error = 'BadValueForParameterAmount';
return -1;
}
if (!is_numeric($this->amount)) {
$this->error = 'BadValueForParameterAmount';
return -1;
}
$sql = "UPDATE ".MAIN_DB_PREFIX."subscription SET ";
$sql .= " fk_type = ".$this->fk_type.",";

View File

@ -719,7 +719,7 @@ if ($rowid > 0) {
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$object->id.'</td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" name="label" size="40" value="'.dol_escape_htmltag($object->label).'"></td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" class="minwidth300" name="label" value="'.dol_escape_htmltag($object->label).'"></td></tr>';
print '<tr><td>'.$langs->trans("Status").'</td><td>';
print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), $object->status);

View File

@ -37,6 +37,7 @@ $langs->loadLangs(array('members', 'languages'));
$id = GETPOST('rowid', 'int');
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'alpha');
$ref = GETPOST('ref', 'alphanohtml');
// Security check
$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
@ -67,15 +68,17 @@ if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && $user->rights->ad
$object->fetch($id);
$current_lang = $langs->getDefaultLang();
$forcelangprod = GETPOST("forcelangprod", 'aZ09');
// update of object
if ($_POST["forcelangprod"] == $current_lang) {
$object->label = $_POST["libelle"];
$object->description = dol_htmlcleanlastbr($_POST["desc"]);
$object->other = dol_htmlcleanlastbr($_POST["other"]);
if ($forcelangprod == $current_lang) {
$object->label = GETPOST("libelle", 'alphanohtml');
$object->description = dol_htmlcleanlastbr(GETPOST("desc", 'restricthtml'));
$object->other = dol_htmlcleanlastbr(GETPOST("other", 'restricthtml'));
} else {
$object->multilangs[$_POST["forcelangprod"]]["label"] = $_POST["libelle"];
$object->multilangs[$_POST["forcelangprod"]]["description"] = dol_htmlcleanlastbr($_POST["desc"]);
$object->multilangs[$_POST["forcelangprod"]]["other"] = dol_htmlcleanlastbr($_POST["other"]);
$object->multilangs[$forcelangprod]["label"] = GETPOST("libelle", 'alphanohtml');
$object->multilangs[$forcelangprod]["description"] = dol_htmlcleanlastbr(GETPOST("desc", 'restricthtml'));
$object->multilangs[$forcelangprod]["other"] = dol_htmlcleanlastbr(GETPOST("other", 'restricthtml'));
}
// backup into database
@ -95,13 +98,13 @@ if ($action == 'vedit' && $cancel != $langs->trans("Cancel") && $user->rights->a
foreach ($object->multilangs as $key => $value) { // saving new values in the object
if ($key == $current_lang) {
$object->label = $_POST["libelle-".$key];
$object->description = dol_htmlcleanlastbr($_POST["desc-".$key]);
$object->other = dol_htmlcleanlastbr($_POST["other-".$key]);
$object->label = GETPOST("libelle-".$key, 'alphanohtml');
$object->description = dol_htmlcleanlastbr(GETPOST("desc-".$key, 'restricthtml'));
$object->other = dol_htmlcleanlastbr(GETPOST("other-".$key, 'restricthtml'));
} else {
$object->multilangs[$key]["label"] = $_POST["libelle-".$key];
$object->multilangs[$key]["description"] = dol_htmlcleanlastbr($_POST["desc-".$key]);
$object->multilangs[$key]["other"] = dol_htmlcleanlastbr($_POST["other-".$key]);
$object->multilangs[$key]["label"] = GETPOST("libelle-".$key, 'alphanohtml');
$object->multilangs[$key]["description"] = dol_htmlcleanlastbr(GETPOST("desc-".$key, 'restricthtml'));
$object->multilangs[$key]["other"] = dol_htmlcleanlastbr(GETPOST("other-".$key, 'restricthtml'));
}
}
@ -205,7 +208,7 @@ if ($action == 'edit') {
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';
print '<tr><td class="tdtop titlefieldcreate fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle-'.$key.'" size="40" value="'.dol_escape_htmltag($object->multilangs[$key]["label"]).'"></td></tr>';
print '<tr><td class="tdtop titlefieldcreate fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle-'.$key.'" class="minwidth300" value="'.dol_escape_htmltag($object->multilangs[$key]["label"]).'"></td></tr>';
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
$doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
$doleditor->Create();
@ -264,7 +267,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) {
print '<tr><td class="tdtop titlefieldcreate fieldrequired">'.$langs->trans('Language').'</td><td>';
print $formadmin->select_language('', 'forcelangprod', 0, $object->multilangs, 1);
print '</td></tr>';
print '<tr><td class="tdtop fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle" size="40"></td></tr>';
print '<tr><td class="tdtop fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle" class="minwidth300" value="'.dol_escape_htmltag(GETPOST("libelle", 'alphanohtml')).'"></td></tr>';
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
$doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
$doleditor->Create();

View File

@ -54,19 +54,18 @@ if ($action == 'addconst')
if ($action == 'add') {
$error = 0;
$boxids = GETPOST('boxid', 'array');
$db->begin();
if (isset($_POST['boxid']) && is_array($_POST['boxid']))
{
foreach ($_POST['boxid'] as $boxid)
{
if (is_array($boxids)) {
foreach ($boxids as $boxid) {
if (is_numeric($boxid['pos']) && $boxid['pos'] >= 0) // 0=Home, 1=...
{
$pos = $boxid['pos'];
// Initialize distinct fk_user with all already existing values of fk_user (user that use a personalized view of boxes for page "pos")
$distinctfkuser = array();
if (!$error)
{
if (!$error) {
$sql = "SELECT fk_user";
$sql .= " FROM ".MAIN_DB_PREFIX."user_param";
$sql .= " WHERE param = 'MAIN_BOXES_".$db->escape($pos)."' AND value = '1'";
@ -146,7 +145,7 @@ if ($action == 'add') {
if ($action == 'delete')
{
$sql = "SELECT box_id FROM ".MAIN_DB_PREFIX."boxes";
$sql .= " WHERE rowid=".$rowid;
$sql .= " WHERE rowid=".((int) $rowid);
$resql = $db->query($sql);
$obj = $db->fetch_object($resql);

View File

@ -188,7 +188,7 @@ if ($action == 'update')
if (!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) $plus = '_PERCENTAGE';
// Update values
for ($i = 0; $i < 4; $i++) {
if (isset($_POST['MAIN_METEO'.$plus.'_LEVEL'.$i])) dolibarr_set_const($db, 'MAIN_METEO'.$plus.'_LEVEL'.$i, GETPOST('MAIN_METEO'.$plus.'_LEVEL'.$i, 'int'), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_METEO'.$plus.'_LEVEL'.$i)) dolibarr_set_const($db, 'MAIN_METEO'.$plus.'_LEVEL'.$i, GETPOST('MAIN_METEO'.$plus.'_LEVEL'.$i, 'int'), 'chaine', 0, '', $conf->entity);
}
}

View File

@ -690,7 +690,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
if ($value == 'formula' && empty($_POST['formula'])) continue;
if ($value == 'dayrule' && empty($_POST['dayrule'])) continue;
if ($value == 'sortorder') continue; // For a column name 'sortorder', we use the field name 'position'
if ((!isset($_POST[$value]) || $_POST[$value] == '')
if ((!GETPOSTISSET($value) || GETPOST($value) == '')
&& (!in_array($listfield[$f], array('decalage', 'module', 'accountancy_code', 'accountancy_code_sell', 'accountancy_code_buy', 'tracking', 'picto')) // Fields that are not mandatory
&& (!($id == 10 && $listfield[$f] == 'code')) // Code is mandatory fir table 10
)
@ -719,7 +719,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
}
}
// Other checks
if (GETPOST('actionadd') && $tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"], array('system', 'systemauto'))) {
if (GETPOST('actionadd') && $tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && GETPOSTISSET("type") && in_array(GETPOST("type"), array('system', 'systemauto'))) {
$ok = 0;
setEventMessages($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'), null, 'errors');
}
@ -757,7 +757,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
if ($_POST["accountancy_code"] <= 0) $_POST["accountancy_code"] = ''; // If empty, we force to null
if ($_POST["accountancy_code_sell"] <= 0) $_POST["accountancy_code_sell"] = ''; // If empty, we force to null
if ($_POST["accountancy_code_buy"] <= 0) $_POST["accountancy_code_buy"] = ''; // If empty, we force to null
if ($id == 10 && isset($_POST["code"])) // Spaces are not allowed into code
if ($id == 10 && GETPOSTISSET("code")) // Spaces are not allowed into code
{
$_POST["code"] = preg_replace('/\s/', '', $_POST["code"]);
}

View File

@ -178,6 +178,7 @@ if ($action == 'edit')
jQuery("#MAIN_MAIL_EMAIL_DKIM_DOMAIN").prop("disabled", true);
jQuery("#MAIN_MAIL_EMAIL_DKIM_SELECTOR").prop("disabled", true);
jQuery("#MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY").prop("disabled", true);
jQuery(".smtp_method").hide();
jQuery(".dkim").hide();
';
if ($linuxlike)
@ -191,7 +192,7 @@ if ($action == 'edit')
print '
jQuery("#MAIN_MAIL_SMTP_SERVER").prop("disabled", true);
jQuery("#MAIN_MAIL_SMTP_PORT").prop("disabled", true);
jQuery("#smtp_server_mess").hide();
jQuery("#smtp_server_mess").hide();
jQuery("#smtp_port_mess").hide();';
}
print '
@ -220,7 +221,8 @@ if ($action == 'edit')
jQuery("#MAIN_MAIL_SMTP_PORT").show();
jQuery("#smtp_server_mess").hide();
jQuery("#smtp_port_mess").hide();
jQuery(".dkim").hide();
jQuery(".smtp_method").show();
jQuery(".dkim").hide();
}
if (jQuery("#MAIN_MAIL_SENDMODE").val()==\'swiftmailer\')
{
@ -246,6 +248,7 @@ if ($action == 'edit')
jQuery("#MAIN_MAIL_SMTP_PORT").show();
jQuery("#smtp_server_mess").hide();
jQuery("#smtp_port_mess").hide();
jQuery(".smtp_method").show();
jQuery(".dkim").show();
}
}
@ -318,13 +321,15 @@ if ($action == 'edit')
print '</td></tr>';
// Host server
print '<tr class="oddeven"><td>';
if (!$conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail')
{
print '<tr class="oddeven">';
if (!$conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail') {
print '<td>';
print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike");
print '</td><td>';
print '<span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
print '</td>';
} else {
print '<td>';
$mainserver = (!empty($conf->global->MAIN_MAIL_SMTP_SERVER) ? $conf->global->MAIN_MAIL_SMTP_SERVER : '');
$smtpserver = ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined");
if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike");
@ -333,17 +338,19 @@ if ($action == 'edit')
// SuperAdministrator access only
if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity))
{
print '<input class="flat" id="MAIN_MAIL_SMTP_SERVER" name="MAIN_MAIL_SMTP_SERVER" size="18" value="'.$mainserver.'" autocomplete="off">';
print '<input class="flat minwidth300" id="MAIN_MAIL_SMTP_SERVER" name="MAIN_MAIL_SMTP_SERVER" value="'.$mainserver.'" autocomplete="off">';
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_sav" name="MAIN_MAIL_SMTP_SERVER_sav" value="'.$mainserver.'">';
print '<span id="smtp_server_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
print ' <span class="opacitymedium smtp_method">'.$langs->trans("SeeLinkToOnlineDocumentation").'</span>';
} else {
$text = !empty($mainserver) ? $mainserver : $smtpserver;
$htmltext = $langs->trans("ContactSuperAdminForChange");
print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER" name="MAIN_MAIL_SMTP_SERVER" value="'.$mainserver.'">';
}
print '</td>';
}
print '</td></tr>';
print '</tr>';
// Port
print '<tr class="oddeven"><td>';
@ -856,8 +863,8 @@ if ($action == 'edit')
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$formmail->trackid = (($action == 'testhtml') ? "testhtml" : "test");
$formmail->fromname = (isset($_POST['fromname']) ? $_POST['fromname'] : $conf->global->MAIN_MAIL_EMAIL_FROM);
$formmail->frommail = (isset($_POST['frommail']) ? $_POST['frommail'] : $conf->global->MAIN_MAIL_EMAIL_FROM);
$formmail->fromname = (GETPOSTISSET('fromname') ? $_POST['fromname'] : $conf->global->MAIN_MAIL_EMAIL_FROM);
$formmail->frommail = (GETPOSTISSET('frommail') ? $_POST['frommail'] : $conf->global->MAIN_MAIL_EMAIL_FROM);
$formmail->fromid = $user->id;
$formmail->fromalsorobot = 1;
$formmail->fromtype = (GETPOSTISSET('fromtype') ?GETPOST('fromtype', 'aZ09') : (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) ? $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE : 'user'));
@ -865,13 +872,13 @@ if ($action == 'edit')
$formmail->withsubstit = 1;
$formmail->withfrom = 1;
$formmail->witherrorsto = 1;
$formmail->withto = (!empty($_POST['sendto']) ? $_POST['sendto'] : ($user->email ? $user->email : 1));
$formmail->withtocc = (!empty($_POST['sendtocc']) ? $_POST['sendtocc'] : 1); // ! empty to keep field if empty
$formmail->withtoccc = (!empty($_POST['sendtoccc']) ? $_POST['sendtoccc'] : 1); // ! empty to keep field if empty
$formmail->withtopic = (isset($_POST['subject']) ? $_POST['subject'] : $langs->trans("Test"));
$formmail->withto = (!empty($_POST['sendto']) ? GETPOST('sendto', 'restricthtml') : ($user->email ? $user->email : 1));
$formmail->withtocc = (!empty($_POST['sendtocc']) ? GETPOST('sendtocc', 'restricthtml') : 1); // ! empty to keep field if empty
$formmail->withtoccc = (!empty($_POST['sendtoccc']) ? GETPOST('sendtoccc', 'restricthtml') : 1); // ! empty to keep field if empty
$formmail->withtopic = (GETPOSTISSET('subject') ? GETPOST('subject') : $langs->trans("Test"));
$formmail->withtopicreadonly = 0;
$formmail->withfile = 2;
$formmail->withbody = (isset($_POST['message']) ? $_POST['message'] : ($action == 'testhtml' ? $langs->transnoentities("PredefinedMailTestHtml") : $langs->transnoentities("PredefinedMailTest")));
$formmail->withbody = (GETPOSTISSET('message') ? GETPOST('message', 'restricthtml') : ($action == 'testhtml' ? $langs->transnoentities("PredefinedMailTestHtml") : $langs->transnoentities("PredefinedMailTest")));
$formmail->withbodyreadonly = 0;
$formmail->withcancel = 1;
$formmail->withdeliveryreceipt = 1;

View File

@ -564,20 +564,20 @@ if ($action == 'edit')
// Cree l'objet formulaire mail
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$formmail->fromname = (isset($_POST['fromname']) ? $_POST['fromname'] : $conf->global->MAIN_MAIL_EMAIL_FROM);
$formmail->frommail = (isset($_POST['frommail']) ? $_POST['frommail'] : $conf->global->MAIN_MAIL_EMAIL_FROM);
$formmail->fromname = (GETPOSTISSET('fromname') ? GETPOST('fromname', 'restricthtml') : $conf->global->MAIN_MAIL_EMAIL_FROM);
$formmail->frommail = (GETPOSTISSET('frommail') ? GETPOST('frommail', 'restricthtml') : $conf->global->MAIN_MAIL_EMAIL_FROM);
$formmail->trackid = (($action == 'testhtml') ? "testhtml" : "test");
$formmail->withfromreadonly = 0;
$formmail->withsubstit = 0;
$formmail->withfrom = 1;
$formmail->witherrorsto = 1;
$formmail->withto = (!empty($_POST['sendto']) ? $_POST['sendto'] : ($user->email ? $user->email : 1));
$formmail->withtocc = (!empty($_POST['sendtocc']) ? $_POST['sendtocc'] : 1); // ! empty to keep field if empty
$formmail->withtoccc = (!empty($_POST['sendtoccc']) ? $_POST['sendtoccc'] : 1); // ! empty to keep field if empty
$formmail->withtopic = (isset($_POST['subject']) ? $_POST['subject'] : $langs->trans("Test"));
$formmail->withto = (!GETPOST('sendto') ? GETPOST('sendto', 'restricthtml') : ($user->email ? $user->email : 1));
$formmail->withtocc = (!GETPOST(['sendtocc']) ? GETPOST('sendtocc', 'restricthtml') : 1); // ! empty to keep field if empty
$formmail->withtoccc = (!GETPOST(['sendtoccc']) ? GETPOST('sendtoccc', 'restricthtml') : 1); // ! empty to keep field if empty
$formmail->withtopic = (GETPOSTISSET('subject') ? GETPOST('subject') : $langs->trans("Test"));
$formmail->withtopicreadonly = 0;
$formmail->withfile = 2;
$formmail->withbody = (isset($_POST['message']) ? $_POST['message'] : ($action == 'testhtml' ? $langs->transnoentities("PredefinedMailTestHtml") : $langs->transnoentities("PredefinedMailTest")));
$formmail->withbody = (GETPOSTISSET('message') ? GETPOST('message', 'restricthtml') : ($action == 'testhtml' ? $langs->transnoentities("PredefinedMailTestHtml") : $langs->transnoentities("PredefinedMailTest")));
$formmail->withbodyreadonly = 0;
$formmail->withcancel = 1;
$formmail->withdeliveryreceipt = 1;

View File

@ -271,7 +271,7 @@ if (empty($reshook)) {
// Rename some POST variables into a generic name
if (GETPOST('actionmodify', 'alpha') && $value == 'topic') $_POST['topic'] = $_POST['topic-'.$rowid];
if ((!isset($_POST[$value]) || $_POST[$value] == '' || $_POST[$value] == '-1') && $value != 'lang' && $value != 'fk_user' && $value != 'position')
if ((!GETPOSTISSET($value) || GETPOST($value) == '' || GETPOST($value) == '-1') && $value != 'lang' && $value != 'fk_user' && $value != 'position')
{
$ok = 0;
$fieldnamekey = $listfield[$f];

View File

@ -530,20 +530,20 @@ if ($action == 'edit')
// Cree l'objet formulaire mail
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$formmail->fromname = (isset($_POST['fromname']) ? $_POST['fromname'] : $conf->global->MAIN_MAIL_EMAIL_FROM);
$formmail->frommail = (isset($_POST['frommail']) ? $_POST['frommail'] : $conf->global->MAIN_MAIL_EMAIL_FROM);
$formmail->fromname = (GETPOSTISSET('fromname') ? $_POST['fromname'] : $conf->global->MAIN_MAIL_EMAIL_FROM);
$formmail->frommail = (GETPOSTISSET('frommail') ? $_POST['frommail'] : $conf->global->MAIN_MAIL_EMAIL_FROM);
$formmail->trackid = (($action == 'testhtml') ? "testhtml" : "test");
$formmail->withfromreadonly = 0;
$formmail->withsubstit = 0;
$formmail->withfrom = 1;
$formmail->witherrorsto = 1;
$formmail->withto = (!empty($_POST['sendto']) ? $_POST['sendto'] : ($user->email ? $user->email : 1));
$formmail->withtocc = (!empty($_POST['sendtocc']) ? $_POST['sendtocc'] : 1); // ! empty to keep field if empty
$formmail->withtoccc = (!empty($_POST['sendtoccc']) ? $_POST['sendtoccc'] : 1); // ! empty to keep field if empty
$formmail->withtopic = (isset($_POST['subject']) ? $_POST['subject'] : $langs->trans("Test"));
$formmail->withto = (!empty($_POST['sendto']) ? GETPOST('sendto', 'restricthtml') : ($user->email ? $user->email : 1));
$formmail->withtocc = (!empty($_POST['sendtocc']) ? GETPOST('sendtocc', 'restricthtml') : 1); // ! empty to keep field if empty
$formmail->withtoccc = (!empty($_POST['sendtoccc']) ? GETPOST('sendtoccc', 'restricthtml') : 1); // ! empty to keep field if empty
$formmail->withtopic = (GETPOSTISSET('subject') ? GETPOST('subject') : $langs->trans("Test"));
$formmail->withtopicreadonly = 0;
$formmail->withfile = 2;
$formmail->withbody = (isset($_POST['message']) ? $_POST['message'] : ($action == 'testhtml' ? $langs->transnoentities("PredefinedMailTestHtml") : $langs->transnoentities("PredefinedMailTest")));
$formmail->withbody = (GETPOSTISSET('message') ? GETPOST('message', 'restricthtml') : ($action == 'testhtml' ? $langs->transnoentities("PredefinedMailTestHtml") : $langs->transnoentities("PredefinedMailTest")));
$formmail->withbodyreadonly = 0;
$formmail->withcancel = 1;
$formmail->withdeliveryreceipt = 1;

View File

@ -135,7 +135,7 @@ print '<tr class="oddeven">';
print '<td>'.$langs->trans("ConnectionTimeout").'</td><td class="right">';
print '</td>';
print '<td class="nowrap">';
print '<input class="flat" name="MAIN_USE_CONNECT_TIMEOUT" type="text" size="4" value="'.(isset($_POST["MAIN_USE_CONNECT_TIMEOUT"]) ?GETPOST("MAIN_USE_CONNECT_TIMEOUT") : $conf->global->MAIN_USE_CONNECT_TIMEOUT).'">';
print '<input class="flat" name="MAIN_USE_CONNECT_TIMEOUT" type="text" size="4" value="'.(GETPOSTISSET("MAIN_USE_CONNECT_TIMEOUT") ? GETPOST("MAIN_USE_CONNECT_TIMEOUT") : $conf->global->MAIN_USE_CONNECT_TIMEOUT).'">';
print ' '.strtolower($langs->trans("Seconds"));
print '</td>';
print '</tr>';

View File

@ -85,7 +85,7 @@ if ($action == 'set')
$db->begin();
$newActiveModules = array();
$selectedModules = (isset($_POST['SYSLOG_HANDLERS']) ? $_POST['SYSLOG_HANDLERS'] : array());
$selectedModules = (GETPOSTISSET('SYSLOG_HANDLERS') ? GETPOST('SYSLOG_HANDLERS') : array());
// Save options of handler
foreach ($syslogModules as $syslogHandler)
@ -97,11 +97,10 @@ if ($action == 'set')
if (in_array($syslogHandler, $selectedModules)) $newActiveModules[] = $syslogHandler;
foreach ($module->configure() as $option)
{
if (isset($_POST[$option['constant']]))
if (GETPOSTISSET($option['constant']))
{
$_POST[$option['constant']] = trim($_POST[$option['constant']]);
dolibarr_del_const($db, $option['constant'], -1);
dolibarr_set_const($db, $option['constant'], $_POST[$option['constant']], 'chaine', 0, '', 0);
dolibarr_set_const($db, $option['constant'], trim(GETPOST($option['constant'])), 'chaine', 0, '', 0);
}
}
}
@ -229,7 +228,7 @@ foreach ($syslogModules as $moduleName)
$tmpoption = $option['constant'];
if (!empty($tmpoption))
{
if (isset($_POST[$tmpoption])) $value = $_POST[$tmpoption];
if (GETPOSTISSET($tmpoption)) $value = GETPOST($tmpoption);
elseif (!empty($conf->global->$tmpoption)) $value = $conf->global->$tmpoption;
} else $value = (isset($option['default']) ? $option['default'] : '');
@ -240,7 +239,7 @@ foreach ($syslogModules as $moduleName)
{
$filelogparam = ' (<a href="'.DOL_URL_ROOT.'/document.php?modulepart=logs&file='.basename($value).'">';
$filelogparam .= $langs->trans('Download');
$filelogparam .= $filelog.'</a>)';
$filelogparam .= ' '.basename($value).'</a>)';
print $filelogparam;
}
}

View File

@ -93,7 +93,7 @@ if (versioncompare(versionphparray(), $arrayphpminversionerror) < 0)
print '</td></tr>';
print '<tr><td>GET and POST support</td><td>';
if (!isset($_GET["testget"]) && !isset($_POST["testpost"]) && !isset($_GET["mainmenu"]))
if (!isset($_GET["testget"]) && !isset($_POST["testpost"]) && !isset($_GET["mainmenu"])) // We must keep $_GET and $_POST here
{
print '<img src="'.$WarningPicturePath.'" alt="Warning"> '.$langs->trans("PHPSupportPOSTGETKo");
print ' (<a href="'.$_SERVER["PHP_SELF"].'?testget=ok">'.$langs->trans("Recheck").'</a>)';

View File

@ -19,9 +19,9 @@
// Create the autoloader for Luracast
require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/AutoLoader.php';
call_user_func(function () {
$loader = Luracast\Restler\AutoLoader::instance();
spl_autoload_register($loader);
return $loader;
$loader = Luracast\Restler\AutoLoader::instance();
spl_autoload_register($loader);
return $loader;
});
require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/iAuthenticate.php';

View File

@ -475,7 +475,7 @@ class Documents extends DolibarrApi
$upload_dir = $conf->categorie->multidir_output[$object->entity].'/'.get_exdir($object->id, 2, 0, 0, $object, 'category').$object->id."/photos/".dol_sanitizeFileName($object->ref);
} elseif ($modulepart == 'ecm') {
throw new RestException(500, 'Modulepart Ecm not implemented yet.');
throw new RestException(500, 'Modulepart Ecm not implemented yet.');
// // require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php';
// if (!DolibarrApiAccess::$user->rights->ecm->read) {
@ -634,7 +634,7 @@ class Documents extends DolibarrApi
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
$object = new Propal($this->db);
} else {
// TODO Implement additional moduleparts
// TODO Implement additional moduleparts
throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.');
}

View File

@ -111,6 +111,71 @@ class Setup extends DolibarrApi
return $list;
}
/**
* Get the list of ordering origins.
*
* @param string $sortfield Sort field
* @param string $sortorder Sort order
* @param int $limit Number of items per page
* @param int $page Page number {@min 0}
* @param int $active Payment type is active or not {@min 0} {@max 1}
* @param string $sqlfilters SQL criteria to filter with. Syntax example "(t.code:=:'OrderByWWW')"
*
* @url GET dictionary/ordering_origins
*
* @return array [List of ordering reasons]
*
* @throws RestException 400
*/
public function getOrderingOrigins($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{
$list = array();
if (!DolibarrApiAccess::$user->rights->commande->lire) {
throw new RestException(401);
}
$sql = "SELECT rowid, code, label, module";
$sql .= " FROM ".MAIN_DB_PREFIX."c_input_reason as t";
$sql .= " WHERE t.active = ".$active;
// Add sql filters
if ($sqlfilters)
{
if (!DolibarrApi::_checkFilters($sqlfilters))
{
throw new RestException(400, 'error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
$sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
}
$sql .= $this->db->order($sortfield, $sortorder);
if ($limit) {
if ($page < 0) {
$page = 0;
}
$offset = $limit * $page;
$sql .= $this->db->plimit($limit, $offset);
}
$result = $this->db->query($sql);
if ($result) {
$num = $this->db->num_rows($result);
$min = min($num, ($limit <= 0 ? $num : $limit));
for ($i = 0; $i < $min; $i++) {
$list[] = $this->db->fetch_object($result);
}
} else {
throw new RestException(400, $this->db->lasterror());
}
return $list;
}
/**
* Get the list of payments types.
*

View File

@ -46,9 +46,9 @@ if (!$res) die("Include of main fails");
require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/AutoLoader.php';
call_user_func(function () {
$loader = Luracast\Restler\AutoLoader::instance();
spl_autoload_register($loader);
return $loader;
$loader = Luracast\Restler\AutoLoader::instance();
spl_autoload_register($loader);
return $loader;
});
require_once DOL_DOCUMENT_ROOT.'/api/class/api.class.php';

View File

@ -769,6 +769,7 @@ class Categories extends DolibarrApi
$objects = $result;
$cleaned_objects = array();
$objects_api = null;
if ($type == 'member') {
$objects_api = new Members();
} elseif ($type == 'customer' || $type == 'supplier') {

View File

@ -1891,13 +1891,12 @@ class Categorie extends CommonObject
return "";
}
$searchCategorySqlList = array();
foreach ($searchList as $searchCategory) {
if (intval($searchCategory) == -2) {
$searchCategorySqlList[] = " cp.fk_categorie IS NULL";
} elseif (intval($searchCategory) > 0) {
$searchCategorySqlList[] = " ".$rowIdName
." IN (SELECT fk_".$type." FROM ".MAIN_DB_PREFIX."categorie_".$type
." WHERE fk_categorie = ".$searchCategory.")";
$searchCategorySqlList[] = " ".$rowIdName." IN (SELECT fk_".$type." FROM ".MAIN_DB_PREFIX."categorie_".$type." WHERE fk_categorie = ".((int) $searchCategory).")";
}
}

View File

@ -294,7 +294,7 @@ if ($user->rights->categorie->creer)
if ($user->rights->categorie->supprimer)
{
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id.'&type='.$type.'">'.$langs->trans("Delete").'</a>';
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id.'&type='.$type.'">'.$langs->trans("Delete").'</a>';
}
print "</div>";

View File

@ -280,7 +280,7 @@ if (empty($reshook) && $action == 'add')
}
}
}
$object->fk_project = isset($_POST["projectid"]) ? $_POST["projectid"] : 0;
$object->fk_project = GETPOSTISSET("projectid") ? GETPOST("projectid", 'int') : 0;
$taskid = GETPOST('taskid', 'int');
if (!empty($taskid)) {
@ -324,7 +324,7 @@ if (empty($reshook) && $action == 'add')
$object->note_private = trim(GETPOST("note", "restricthtml"));
if (isset($_POST["contactid"])) $object->contact = $contact;
if (GETPOSTISSET("contactid")) $object->contact = $contact;
if (GETPOST('socid', 'int') > 0)
{
@ -1051,8 +1051,8 @@ if ($action == 'create')
print '<tr><td>'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td>';
print '<td>';
$percent = -1;
if (isset($_GET['status']) || isset($_POST['status'])) $percent = GETPOST('status');
elseif (isset($_GET['percentage']) || isset($_POST['percentage'])) $percent = GETPOST('percentage');
if (GETPOSTISSET('status')) $percent = GETPOST('status');
elseif (GETPOSTISSET('percentage')) $percent = GETPOST('percentage');
else {
if (GETPOST('complete') == '0' || GETPOST("afaire") == 1) $percent = '0';
elseif (GETPOST('complete') == 100 || GETPOST("afaire") == 2) $percent = 100;

View File

@ -524,7 +524,7 @@ class ActionComm extends CommonObject
$resql = $this->db->query($sql);
if ($resql)
{
$this->ref =$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."actioncomm", "id");
$this->ref = $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."actioncomm", "id");
// Now insert assigned users
if (!$error)
@ -2186,7 +2186,7 @@ class ActionComm extends CommonObject
$this->db->commit();
return 0;
} else {
$this->db->commit(); // We commit also on error, to have the error message recorded.
$this->db->commit(); // We commit also on error, to have the error message recorded.
$this->error = 'Nb of emails sent : '.$nbMailSend.', '.(!empty($errorsMsg)) ? join(', ', $errorsMsg) : $error;
return $error;
}

View File

@ -336,7 +336,7 @@ if ($status == 'todo') $title = $langs->trans("ToDoActions");
*/
$param = '';
if ($actioncode || isset($_GET['search_actioncode']) || isset($_POST['search_actioncode'])) {
if ($actioncode || GETPOSTISSET('search_actioncode')) {
if (is_array($actioncode)) {
foreach ($actioncode as $str_action) $param .= "&search_actioncode[]=".urlencode($str_action);
} else $param .= "&search_actioncode=".urlencode($actioncode);

View File

@ -122,8 +122,8 @@ $tmparray = explode('-', $tmp);
$begin_d = 1;
$end_d = 53;
if ($status == '' && !isset($_GET['status']) && !isset($_POST['status'])) $status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
if (empty($action) && !isset($_GET['action']) && !isset($_POST['action'])) $action = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);
if ($status == '' && !GETPOSTISSET('status')) $status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
if (empty($action) && !GETPOSTISSET('action')) $action = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);
if (GETPOST('viewcal', 'alpha') && $action != 'show_day' && $action != 'show_week' && $action != 'show_peruser') {
$action = 'show_month'; $day = '';
@ -227,13 +227,13 @@ if ($status == 'done') $title = $langs->trans("DoneActions");
if ($status == 'todo') $title = $langs->trans("ToDoActions");
$param = '';
if ($actioncode || isset($_GET['search_actioncode']) || isset($_POST['search_actioncode'])) {
if ($actioncode || GETPOSTISSET('search_actioncode')) {
if (is_array($actioncode)) {
foreach ($actioncode as $str_action) $param .= "&search_actioncode[]=".urlencode($str_action);
} else $param .= "&search_actioncode=".urlencode($actioncode);
}
if ($resourceid > 0) $param .= "&search_resourceid=".urlencode($resourceid);
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param .= "&search_status=".urlencode($status);
if ($status || GETPOSTISSET('status')) $param .= "&search_status=".urlencode($status);
if ($filter) $param .= "&search_filter=".urlencode($filter);
if ($filtert) $param .= "&search_filtert=".urlencode($filtert);
if ($usergroup) $param .= "&search_usergroup=".urlencode($usergroup);

View File

@ -125,8 +125,8 @@ if ($begin_d < 1 || $begin_d > 7) $begin_d = 1;
if ($end_d < 1 || $end_d > 7) $end_d = 7;
if ($end_d < $begin_d) $end_d = $begin_d + 1;
if ($status == '' && !isset($_GET['status']) && !isset($_POST['status'])) $status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
if (empty($action) && !isset($_GET['action']) && !isset($_POST['action'])) $action = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);
if ($status == '' && !GETPOSTISSET('status')) $status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
if (empty($action) && !GETPOSTISSET('action')) $action = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);
if (GETPOST('viewcal', 'alpha') && $action != 'show_day' && $action != 'show_week' && $action != 'show_peruser') {
$action = 'show_month'; $day = '';
@ -227,13 +227,13 @@ if ($status == 'done') $title = $langs->trans("DoneActions");
if ($status == 'todo') $title = $langs->trans("ToDoActions");
$param = '';
if ($actioncode || isset($_GET['search_actioncode']) || isset($_POST['search_actioncode'])) {
if ($actioncode || GETPOSTISSET('search_actioncode')) {
if (is_array($actioncode)) {
foreach ($actioncode as $str_action) $param .= "&search_actioncode[]=".urlencode($str_action);
} else $param .= "&search_actioncode=".urlencode($actioncode);
}
if ($resourceid > 0) $param .= "&search_resourceid=".urlencode($resourceid);
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param .= "&search_status=".urlencode($status);
if ($status || GETPOSTISSET('status')) $param .= "&search_status=".urlencode($status);
if ($filter) $param .= "&search_filter=".urlencode($filter);
if ($filtert) $param .= "&search_filtert=".urlencode($filtert);
if ($usergroup) $param .= "&search_usergroup=".urlencode($usergroup);

View File

@ -233,7 +233,7 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
$supplierproposalstatic->total_ht = $obj->total_ht;
$supplierproposalstatic->total_tva = $obj->total_tva;
$supplierproposalstatic->total_ttc = $obj->total_ttc;
$supplierproposalstatic->statut = $obj->status;
$supplierproposalstatic->statut = $obj->status;
$companystatic->id = $obj->socid;
$companystatic->name = $obj->name;

View File

@ -343,7 +343,7 @@ if (empty($reshook))
$object->ref = GETPOST('ref');
$object->datep = $datep;
$object->date = $datep;
$object->date_livraison = $date_delivery; // deprecated
$object->date_livraison = $date_delivery; // deprecated
$object->delivery_date = $date_delivery;
$object->availability_id = GETPOST('availability_id');
$object->demand_reason_id = GETPOST('demand_reason_id');
@ -547,9 +547,8 @@ if (empty($reshook))
if ($id > 0)
{
// Insertion contact par defaut si defini
if (GETPOST('contactid') > 0)
{
// Insert default contacts if defined
if (GETPOST('contactid') > 0) {
$result = $object->add_contact(GETPOST('contactid'), 'CUSTOMER', 'external');
if ($result < 0)
{
@ -1344,7 +1343,8 @@ if (empty($reshook))
{
if ($object->id > 0) {
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
$result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
$result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09'));
}
if ($result >= 0) {

View File

@ -155,7 +155,7 @@ class Propal extends CommonObject
* @var int Date expected for delivery
* @deprecated
*/
public $date_livraison; // deprecated; Use delivery_date instead.
public $date_livraison; // deprecated; Use delivery_date instead.
/**
* @var integer|string $delivery_date;
@ -1503,7 +1503,7 @@ class Propal extends CommonObject
$this->date = $this->db->jdate($obj->dp); // Proposal date
$this->datep = $this->db->jdate($obj->dp); // deprecated
$this->fin_validite = $this->db->jdate($obj->dfv);
$this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated
$this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated
$this->delivery_date = $this->db->jdate($obj->delivery_date);
$this->shipping_method_id = ($obj->fk_shipping_method > 0) ? $obj->fk_shipping_method : null;
$this->availability_id = $obj->fk_availability;
@ -2922,7 +2922,7 @@ class Propal extends CommonObject
$tabletodelete = $this->table_element_line;
$sqlef = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete."_extrafields WHERE fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id.")";
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id;
if (! $this->db->query($sqlef) || ! $this->db->query($sql)) {
if (!$this->db->query($sqlef) || !$this->db->query($sql)) {
$error++;
$this->error = $this->db->lasterror();
$this->errors[] = $this->error;
@ -2955,7 +2955,7 @@ class Propal extends CommonObject
if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".$this->id;
$res = $this->db->query($sql);
if (! $res) {
if (!$res) {
$error++;
$this->error = $this->db->lasterror();
$this->errors[] = $this->error;
@ -2966,7 +2966,7 @@ class Propal extends CommonObject
// Delete record into ECM index and physically
if (!$error) {
$res = $this->deleteEcmFiles(0); // Deleting files physically is done later with the dol_delete_dir_recursive
if (! $res) {
if (!$res) {
$error++;
}
}

View File

@ -79,7 +79,8 @@ if ($action == 'addcontact' && $user->rights->propale->creer)
if ($object->id > 0)
{
$contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
$result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
$result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09'));
}
if ($result >= 0)

View File

@ -188,7 +188,7 @@ $arrayfields = array(
'p.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
);
// Extra fields
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
/*

View File

@ -276,7 +276,7 @@ if (empty($reshook))
$object->fk_account = GETPOST('fk_account', 'int');
$object->availability_id = GETPOST('availability_id');
$object->demand_reason_id = GETPOST('demand_reason_id');
$object->date_livraison = $datelivraison; // deprecated
$object->date_livraison = $datelivraison; // deprecated
$object->delivery_date = $datelivraison;
$object->shipping_method_id = GETPOST('shipping_method_id', 'int');
$object->warehouse_id = GETPOST('warehouse_id', 'int');
@ -459,8 +459,7 @@ if (empty($reshook))
// Insert default contacts if defined
if ($object_id > 0)
{
if (GETPOST('contactid', 'int'))
{
if (GETPOST('contactid', 'int')) {
$result = $object->add_contact(GETPOST('contactid', 'int'), 'CUSTOMER', 'external');
if ($result < 0) {
setEventMessages($langs->trans("ErrorFailedToAddContact"), null, 'errors');
@ -1367,7 +1366,8 @@ if (empty($reshook))
{
if ($object->id > 0) {
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
$result = $object->add_contact($contactid, GETPOST('type'), GETPOST('source'));
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
$result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09'));
}
if ($result >= 0) {

View File

@ -184,7 +184,7 @@ class Commande extends CommonOrder
* @var int Date expected for delivery
* @deprecated
*/
public $date_livraison; // deprecated; Use delivery_date instead.
public $date_livraison; // deprecated; Use delivery_date instead.
public $delivery_date; // Date expected of shipment (date starting shipment, not the reception that occurs some days after)
@ -1359,7 +1359,7 @@ class Commande extends CommonOrder
$this->fk_account = $object->fk_account;
$this->availability_id = $object->availability_id;
$this->demand_reason_id = $object->demand_reason_id;
$this->date_livraison = $object->date_livraison; // deprecated
$this->date_livraison = $object->date_livraison; // deprecated
$this->delivery_date = $object->date_livraison;
$this->shipping_method_id = $object->shipping_method_id;
$this->warehouse_id = $object->warehouse_id;
@ -1867,7 +1867,7 @@ class Commande extends CommonOrder
$this->availability = $obj->availability_label;
$this->demand_reason_id = $obj->fk_input_reason;
$this->demand_reason_code = $obj->demand_reason_code;
$this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated
$this->date_livraison = $this->db->jdate($obj->delivery_date); // deprecated
$this->delivery_date = $this->db->jdate($obj->delivery_date);
$this->shipping_method_id = ($obj->fk_shipping_method > 0) ? $obj->fk_shipping_method : null;
$this->warehouse_id = ($obj->fk_warehouse > 0) ? $obj->fk_warehouse : null;
@ -3358,7 +3358,7 @@ class Commande extends CommonOrder
$tabletodelete = $this->table_element_line;
$sqlef = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete."_extrafields WHERE fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id.")";
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id;
if (! $this->db->query($sqlef) || ! $this->db->query($sql)) {
if (!$this->db->query($sqlef) || !$this->db->query($sql)) {
$error++;
$this->error = $this->db->lasterror();
$this->errors[] = $this->error;
@ -3391,7 +3391,7 @@ class Commande extends CommonOrder
if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".$this->id;
$res = $this->db->query($sql);
if (! $res) {
if (!$res) {
$error++;
$this->error = $this->db->lasterror();
$this->errors[] = $this->error;
@ -3402,7 +3402,7 @@ class Commande extends CommonOrder
// Delete record into ECM index and physically
if (!$error) {
$res = $this->deleteEcmFiles(0); // Deleting files physically is done later with the dol_delete_dir_recursive
if (! $res) {
if (!$res) {
$error++;
}
}

View File

@ -56,7 +56,8 @@ if ($action == 'addcontact' && $user->rights->commande->creer)
if ($result > 0 && $id > 0)
{
$contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
$result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
$result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09'));
}
if ($result >= 0)

View File

@ -143,37 +143,37 @@ if (empty($user->socid)) $fieldstosearchall["c.note_private"] = "NotePrivate";
$checkedtypetiers = 0;
$arrayfields = array(
'c.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>5),
'c.ref_client'=>array('label'=>"RefCustomerOrder", 'checked'=>-1, 'position'=>10),
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>20),
'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>25),
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30),
's.town'=>array('label'=>"Town", 'checked'=>1, 'position'=>35),
's.zip'=>array('label'=>"Zip", 'checked'=>1, 'position'=>40),
'state.nom'=>array('label'=>"StateShort", 'checked'=>0, 'position'=>45),
'country.code_iso'=>array('label'=>"Country", 'checked'=>0, 'position'=>50),
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>55),
'c.date_commande'=>array('label'=>"OrderDateShort", 'checked'=>1, 'position'=>60),
'c.date_delivery'=>array('label'=>"DateDeliveryPlanned", 'checked'=>1, 'enabled'=>empty($conf->global->ORDER_DISABLE_DELIVERY_DATE), 'position'=>65),
'c.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>75),
'c.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>80),
'c.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>85),
'c.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>90),
'c.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>95),
'c.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>100),
'c.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>105),
'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>110),
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>10, 'position'=>115),
'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500, 'position'=>120),
'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500, 'position'=>125),
'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>500, 'position'=>130),
'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)), 'position'=>135),
'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'position'=>140),
'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'position'=>990, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)), 'position'=>145),
'shippable'=>array('label'=>"Shippable", 'checked'=>1, 'position'=>995, 'enabled'=>(!empty($conf->expedition->enabled)), 'position'=>150),
'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000, 'position'=>155)
'c.ref_client'=>array('label'=>"RefCustomerOrder", 'checked'=>-1, 'position'=>10),
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>20),
'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>25),
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30),
's.town'=>array('label'=>"Town", 'checked'=>1, 'position'=>35),
's.zip'=>array('label'=>"Zip", 'checked'=>1, 'position'=>40),
'state.nom'=>array('label'=>"StateShort", 'checked'=>0, 'position'=>45),
'country.code_iso'=>array('label'=>"Country", 'checked'=>0, 'position'=>50),
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>55),
'c.date_commande'=>array('label'=>"OrderDateShort", 'checked'=>1, 'position'=>60),
'c.date_delivery'=>array('label'=>"DateDeliveryPlanned", 'checked'=>1, 'enabled'=>empty($conf->global->ORDER_DISABLE_DELIVERY_DATE), 'position'=>65),
'c.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>75),
'c.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>80),
'c.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>85),
'c.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>90),
'c.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>95),
'c.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>100),
'c.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>105),
'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>110),
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>10, 'position'=>115),
'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500, 'position'=>120),
'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500, 'position'=>125),
'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>500, 'position'=>130),
'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)), 'position'=>135),
'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'position'=>140),
'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'position'=>990, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)), 'position'=>145),
'shippable'=>array('label'=>"Shippable", 'checked'=>1, 'position'=>995, 'enabled'=>(!empty($conf->expedition->enabled)), 'position'=>150),
'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000, 'position'=>155)
);
// Extra fields
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
@ -448,10 +448,10 @@ if ($resql)
if ($search_status != '') $param .= '&search_status='.urlencode($search_status);
if ($search_datecloture_start) $param .= '&search_datecloture_start='.urlencode($search_datecloture_start);
if ($search_datecloture_end) $param .= '&search_datecloture_end='.urlencode($search_datecloture_end);
if ($search_dateorder_start) $param .= '&search_dateorder_start_day=' . dol_print_date($search_dateorder_start, '%d') . '&search_dateorder_start_month=' . dol_print_date($search_dateorder_start, '%m') . '&search_dateorder_start_year=' . dol_print_date($search_dateorder_start, '%Y');
if ($search_dateorder_end) $param .= '&search_dateorder_end_day=' . dol_print_date($search_dateorder_end, '%d') . '&search_dateorder_end_month=' . dol_print_date($search_dateorder_end, '%m') . '&search_dateorder_end_year=' . dol_print_date($search_dateorder_end, '%Y');
if ($search_datedelivery_start) $param .= '&search_datedelivery_start_day=' . dol_print_date($search_datedelivery_start, '%d') . '&search_datedelivery_start_month=' . dol_print_date($search_datedelivery_start, '%m') . '&search_datedelivery_start_year=' . dol_print_date($search_datedelivery_start, '%Y');
if ($search_datedelivery_end) $param .= '&search_datedelivery_end_day=' . dol_print_date($search_datedelivery_end, '%d') . '&search_datedelivery_end_month=' . dol_print_date($search_datedelivery_end, '%m') . '&search_datedelivery_end_year=' . dol_print_date($search_datedelivery_end, '%Y');
if ($search_dateorder_start) $param .= '&search_dateorder_start_day='.dol_print_date($search_dateorder_start, '%d').'&search_dateorder_start_month='.dol_print_date($search_dateorder_start, '%m').'&search_dateorder_start_year='.dol_print_date($search_dateorder_start, '%Y');
if ($search_dateorder_end) $param .= '&search_dateorder_end_day='.dol_print_date($search_dateorder_end, '%d').'&search_dateorder_end_month='.dol_print_date($search_dateorder_end, '%m').'&search_dateorder_end_year='.dol_print_date($search_dateorder_end, '%Y');
if ($search_datedelivery_start) $param .= '&search_datedelivery_start_day='.dol_print_date($search_datedelivery_start, '%d').'&search_datedelivery_start_month='.dol_print_date($search_datedelivery_start, '%m').'&search_datedelivery_start_year='.dol_print_date($search_datedelivery_start, '%Y');
if ($search_datedelivery_end) $param .= '&search_datedelivery_end_day='.dol_print_date($search_datedelivery_end, '%d').'&search_datedelivery_end_month='.dol_print_date($search_datedelivery_end, '%m').'&search_datedelivery_end_year='.dol_print_date($search_datedelivery_end, '%Y');
if ($search_ref) $param .= '&search_ref='.urlencode($search_ref);
if ($search_company) $param .= '&search_company='.urlencode($search_company);
if ($search_ref_customer) $param .= '&search_ref_customer='.urlencode($search_ref_customer);
@ -836,7 +836,7 @@ if ($resql)
{
print '<td class="liste_titre maxwidthonsmartphone" align="center">';
//print $form->selectyesno('search_shippable', $search_shippable, 1, 0, 1, 1);
if (! empty($conf->global->ORDER_SHIPABLE_STATUS_DISABLED_BY_DEFAULT)) {
if (!empty($conf->global->ORDER_SHIPABLE_STATUS_DISABLED_BY_DEFAULT)) {
print '<input type="checkbox" name="show_shippable_command" value="1"'.($show_shippable_command ? ' checked' : '').'>';
print $langs->trans('ShowShippableStatus');
} else {
@ -854,17 +854,17 @@ if ($resql)
// Status
if (!empty($arrayfields['c.fk_statut']['checked']))
{
print '<td class="liste_titre maxwidthonsmartphone center">';
$liststatus = array(
Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraftShort"),
Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"),
Commande::STATUS_SHIPMENTONPROCESS=>$langs->trans("StatusOrderSentShort"),
Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"),
-3=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort").'+'.$langs->trans("StatusOrderDelivered"),
Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceledShort")
);
print $form->selectarray('search_status', $liststatus, $search_status, -4, 0, 0, '', 0, 0, 0, '', 'maxwidth100', 1);
print '</td>';
print '<td class="liste_titre maxwidthonsmartphone center">';
$liststatus = array(
Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraftShort"),
Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"),
Commande::STATUS_SHIPMENTONPROCESS=>$langs->trans("StatusOrderSentShort"),
Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"),
-3=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort").'+'.$langs->trans("StatusOrderDelivered"),
Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceledShort")
);
print $form->selectarray('search_status', $liststatus, $search_status, -4, 0, 0, '', 0, 0, 0, '', 'maxwidth100', 1);
print '</td>';
}
// Action column
print '<td class="liste_titre" align="middle">';
@ -950,7 +950,7 @@ if ($resql)
$generic_commande->statut = $obj->fk_statut;
$generic_commande->billed = $obj->billed;
$generic_commande->date = $db->jdate($obj->date_commande);
$generic_commande->date_livraison = $db->jdate($obj->date_delivery); // deprecated
$generic_commande->date_livraison = $db->jdate($obj->date_delivery); // deprecated
$generic_commande->delivery_date = $db->jdate($obj->date_delivery);
$generic_commande->ref_client = $obj->ref_client;
$generic_commande->total_ht = $obj->total_ht;
@ -1235,7 +1235,7 @@ if ($resql)
// Get local and virtual stock and store it into cache
if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product])) {
$generic_product->load_stock('nobatch'); // ->load_virtual_stock() is already included into load_stock()
$generic_product->load_stock('nobatch'); // ->load_virtual_stock() is already included into load_stock()
$productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_reel;
$productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique;
} else {
@ -1245,9 +1245,9 @@ if ($resql)
if (empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) // Default code. Default should be this case.
{
$text_info .= $generic_commande->lines[$lig]->qty . ' X ' . $generic_commande->lines[$lig]->product_ref . '&nbsp;' . dol_trunc($generic_commande->lines[$lig]->product_label, 25);
$text_info .= ' - ' . $langs->trans("Stock") . ': <span class="' . ($generic_product->stock_reel > 0 ? 'ok' : 'error') . '">' . $generic_product->stock_reel . '</span>';
$text_info .= ' - ' . $langs->trans("VirtualStock") . ': <span class="' . ($generic_product->stock_theorique > 0 ? 'ok' : 'error') . '">' . $generic_product->stock_theorique . '</span>';
$text_info .= $generic_commande->lines[$lig]->qty.' X '.$generic_commande->lines[$lig]->product_ref.'&nbsp;'.dol_trunc($generic_commande->lines[$lig]->product_label, 25);
$text_info .= ' - '.$langs->trans("Stock").': <span class="'.($generic_product->stock_reel > 0 ? 'ok' : 'error').'">'.$generic_product->stock_reel.'</span>';
$text_info .= ' - '.$langs->trans("VirtualStock").': <span class="'.($generic_product->stock_theorique > 0 ? 'ok' : 'error').'">'.$generic_product->stock_theorique.'</span>';
$text_info .= '<br>';
if ($generic_commande->lines[$lig]->qty > $generic_product->stock_reel) {
@ -1281,20 +1281,20 @@ if ($resql)
$stock_order_supplier = $generic_product->stats_commande_fournisseur['qty'];
}
}
$text_info .= $generic_commande->lines[$lig]->qty . ' X ' . $generic_commande->lines[$lig]->ref . '&nbsp;' . dol_trunc($generic_commande->lines[$lig]->product_label, 25);
$text_stock_reel = $generic_product->stock_reel . '/' . $stock_order;
$text_info .= $generic_commande->lines[$lig]->qty.' X '.$generic_commande->lines[$lig]->ref.'&nbsp;'.dol_trunc($generic_commande->lines[$lig]->product_label, 25);
$text_stock_reel = $generic_product->stock_reel.'/'.$stock_order;
if ($stock_order > $generic_product->stock_reel && !($generic_product->stock_reel < $generic_commande->lines[$lig]->qty)) {
$warning++;
$text_warning .= '<span class="warning">' . $langs->trans('Available') . '&nbsp;:&nbsp;' . $text_stock_reel . '</span>';
$text_warning .= '<span class="warning">'.$langs->trans('Available').'&nbsp;:&nbsp;'.$text_stock_reel.'</span>';
}
if ($generic_product->stock_reel < $generic_commande->lines[$lig]->qty) {
$notshippable++;
$text_info .= '<span class="warning">' . $langs->trans('Available') . '&nbsp;:&nbsp;' . $text_stock_reel . '</span>';
$text_info .= '<span class="warning">'.$langs->trans('Available').'&nbsp;:&nbsp;'.$text_stock_reel.'</span>';
} else {
$text_info .= '<span class="ok">' . $langs->trans('Available') . '&nbsp;:&nbsp;' . $text_stock_reel . '</span>';
$text_info .= '<span class="ok">'.$langs->trans('Available').'&nbsp;:&nbsp;'.$text_stock_reel.'</span>';
}
if (!empty($conf->fournisseur->enabled)) {
$text_info .= '&nbsp;' . $langs->trans('SupplierOrder') . '&nbsp;:&nbsp;' . $stock_order_supplier . '<br>';
$text_info .= '&nbsp;'.$langs->trans('SupplierOrder').'&nbsp;:&nbsp;'.$stock_order_supplier.'<br>';
} else {
$text_info .= '<br>';
}
@ -1303,10 +1303,10 @@ if ($resql)
}
if ($notshippable == 0) {
$text_icon = img_picto('', 'dolly', '', false, 0, 0, '', 'green paddingleft');
$text_info = $langs->trans('Shippable') . '<br>' . $text_info;
$text_info = $langs->trans('Shippable').'<br>'.$text_info;
} else {
$text_icon = img_picto('', 'dolly', '', false, 0, 0, '', 'error paddingleft');
$text_info = $langs->trans('NonShippable') . '<br>' . $text_info;
$text_info = $langs->trans('NonShippable').'<br>'.$text_info;
}
}
@ -1314,7 +1314,7 @@ if ($resql)
print $form->textwithtooltip('', $text_info, 2, 1, $text_icon, '', 2);
}
if ($warning) { // Always false in default mode
print $form->textwithtooltip('', $langs->trans('NotEnoughForAllOrders') . '<br>' . $text_warning, 2, 1, img_picto('', 'error'), '', 2);
print $form->textwithtooltip('', $langs->trans('NotEnoughForAllOrders').'<br>'.$text_warning, 2, 1, img_picto('', 'error'), '', 2);
}
}
print '</td>';
@ -1330,8 +1330,8 @@ if ($resql)
// Status
if (!empty($arrayfields['c.fk_statut']['checked']))
{
print '<td class="nowrap center">'.$generic_commande->LibStatut($obj->fk_statut, $obj->billed, 5, 1).'</td>';
if (!$i) $totalarray['nbfield']++;
print '<td class="nowrap center">'.$generic_commande->LibStatut($obj->fk_statut, $obj->billed, 5, 1).'</td>';
if (!$i) $totalarray['nbfield']++;
}
// Action column

View File

@ -306,7 +306,7 @@ if ($mode == 'customer')
}
if ($mode == 'supplier')
{
$formorder->selectSupplierOrderStatus((strstr($object_status, ',') ? -1 : $object_status), 0, 'object_status');
$formorder->selectSupplierOrderStatus((strstr($object_status, ',') ? -1 : $object_status), 0, 'object_status');
}
print '</td></tr>';
// Year

View File

@ -225,17 +225,16 @@ if ((GETPOST('confirm_savestatement', 'alpha') || GETPOST('confirm_reconcile', '
if ($num_releve)
{
$bankline = new AccountLine($db);
if (isset($_POST['rowid']) && is_array($_POST['rowid']))
{
foreach ($_POST['rowid'] as $row)
{
if ($row > 0)
{
$rowids = GETPOST('rowid', 'array');
if (!empty($rowids) && is_array($rowids)) {
foreach ($rowids as $row) {
if ($row > 0) {
$result = $bankline->fetch($row);
$bankline->num_releve = $num_releve; //$_POST["num_releve"];
$result = $bankline->update_conciliation($user, GETPOST("cat"), GETPOST('confirm_reconcile', 'alpha') ? 1 : 0); // If we confirm_reconcile, we set flag 'rappro' to 1.
if ($result < 0)
{
if ($result < 0) {
setEventMessages($bankline->error, $bankline->errors, 'errors');
$error++;
break;

View File

@ -346,7 +346,7 @@ if ($action == 'create')
// Type
print '<tr><td class="fieldrequired">'.$langs->trans("AccountType").'</td>';
print '<td>';
$formbank->selectTypeOfBankAccount(isset($_POST["type"]) ? $_POST["type"] : Account::TYPE_CURRENT, "type");
$formbank->selectTypeOfBankAccount(GETPOSTISSET("type") ? GETPOST("type") : Account::TYPE_CURRENT, "type");
print '</td></tr>';
// Currency
@ -354,7 +354,7 @@ if ($action == 'create')
print '<td>';
$selectedcode = $object->currency_code;
if (!$selectedcode) $selectedcode = $conf->currency;
print $form->selectCurrency((isset($_POST["account_currency_code"]) ? $_POST["account_currency_code"] : $selectedcode), 'account_currency_code');
print $form->selectCurrency((GETPOSTISSET("account_currency_code") ? GETPOST("account_currency_code") : $selectedcode), 'account_currency_code');
//print $langs->trans("Currency".$conf->currency);
//print '<input type="hidden" name="account_currency_code" value="'.$conf->currency.'">';
print '</td></tr>';
@ -367,9 +367,8 @@ if ($action == 'create')
// Country
$selectedcode = '';
if (isset($_POST["account_country_id"]))
{
$selectedcode = $_POST["account_country_id"] ? $_POST["account_country_id"] : $object->country_code;
if (GETPOSTISSET("account_country_id")) {
$selectedcode = GETPOST("account_country_id") ? GETPOST("account_country_id") : $object->country_code;
} elseif (empty($selectedcode)) $selectedcode = $mysoc->country_code;
$object->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules
@ -383,7 +382,7 @@ if ($action == 'create')
print '<tr><td>'.$langs->trans('State').'</td><td>';
if ($selectedcode)
{
$formcompany->select_departement(isset($_POST["account_state_id"]) ? $_POST["account_state_id"] : '', $selectedcode, 'account_state_id');
$formcompany->select_departement(GETPOSTISSET("account_state_id") ? GETPOST("account_state_id") : '', $selectedcode, 'account_state_id');
} else {
print $countrynotdefined;
}
@ -818,16 +817,16 @@ if ($action == 'create')
// Ref
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Ref").'</td>';
print '<td><input type="text" class="flat maxwidth200" name="ref" value="'.dol_escape_htmltag(isset($_POST["ref"]) ?GETPOST("ref") : $object->ref).'"></td></tr>';
print '<td><input type="text" class="flat maxwidth200" name="ref" value="'.dol_escape_htmltag(GETPOSTISSET("ref") ? GETPOST("ref") : $object->ref).'"></td></tr>';
// Label
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td>';
print '<td><input type="text" class="flat minwidth300" name="label" value="'.dol_escape_htmltag(isset($_POST["label"]) ?GETPOST("label") : $object->label).'"></td></tr>';
print '<td><input type="text" class="flat minwidth300" name="label" value="'.dol_escape_htmltag(GETPOSTISSET("label") ? GETPOST("label") : $object->label).'"></td></tr>';
// Type
print '<tr><td class="fieldrequired">'.$langs->trans("AccountType").'</td>';
print '<td class="maxwidth200onsmartphone">';
$formbank->selectTypeOfBankAccount((isset($_POST["type"]) ? $_POST["type"] : $object->type), "type");
$formbank->selectTypeOfBankAccount((GETPOSTISSET("type") ? GETPOST("type") : $object->type), "type");
print '</td></tr>';
// Currency
@ -837,7 +836,7 @@ if ($action == 'create')
print '<td class="maxwidth200onsmartphone">';
$selectedcode = $object->currency_code;
if (!$selectedcode) $selectedcode = $conf->currency;
print $form->selectCurrency((isset($_POST["account_currency_code"]) ? $_POST["account_currency_code"] : $selectedcode), 'account_currency_code');
print $form->selectCurrency((GETPOSTISSET("account_currency_code") ? GETPOST("account_currency_code") : $selectedcode), 'account_currency_code');
//print $langs->trans("Currency".$conf->currency);
//print '<input type="hidden" name="account_currency_code" value="'.$conf->currency.'">';
print '</td></tr>';
@ -845,13 +844,13 @@ if ($action == 'create')
// Status
print '<tr><td class="fieldrequired">'.$langs->trans("Status").'</td>';
print '<td class="maxwidth200onsmartphone">';
print $form->selectarray("clos", $object->status, (isset($_POST["clos"]) ? $_POST["clos"] : $object->clos));
print $form->selectarray("clos", $object->status, (GETPOSTISSET("clos") ? GETPOST("clos") : $object->clos));
print '</td></tr>';
// Country
$object->country_id = $object->country_id ? $object->country_id : $mysoc->country_id;
$selectedcode = $object->country_code;
if (isset($_POST["account_country_id"])) $selectedcode = $_POST["account_country_id"];
if (GETPOSTISSET("account_country_id")) $selectedcode = GETPOST("account_country_id");
elseif (empty($selectedcode)) $selectedcode = $mysoc->country_code;
$object->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules
@ -865,7 +864,7 @@ if ($action == 'create')
print '<tr><td>'.$langs->trans('State').'</td><td class="maxwidth200onsmartphone">';
if ($selectedcode)
{
print $formcompany->select_state(isset($_POST["account_state_id"]) ? $_POST["account_state_id"] : $object->state_id, $selectedcode, 'account_state_id');
print $formcompany->select_state(GETPOSTISSET("account_state_id") ? GETPOST("account_state_id") : $object->state_id, $selectedcode, 'account_state_id');
} else {
print $countrynotdefined;
}
@ -882,14 +881,14 @@ if ($action == 'create')
// Balance
print '<tr><td>'.$langs->trans("BalanceMinimalAllowed").'</td>';
print '<td><input size="12" type="text" class="flat" name="account_min_allowed" value="'.(isset($_POST["account_min_allowed"]) ?GETPOST("account_min_allowed") : $object->min_allowed).'"></td></tr>';
print '<td><input size="12" type="text" class="flat" name="account_min_allowed" value="'.(GETPOSTISSET("account_min_allowed") ? GETPOST("account_min_allowed") : $object->min_allowed).'"></td></tr>';
print '<tr><td>'.$langs->trans("BalanceMinimalDesired").'</td>';
print '<td><input size="12" type="text" class="flat" name="account_min_desired" value="'.(isset($_POST["account_min_desired"]) ?GETPOST("account_min_desired") : $object->min_desired).'"></td></tr>';
print '<td><input size="12" type="text" class="flat" name="account_min_desired" value="'.(GETPOSTISSET("account_min_desired") ? GETPOST("account_min_desired") : $object->min_desired).'"></td></tr>';
// Web
print '<tr><td>'.$langs->trans("Web").'</td>';
print '<td><input class="maxwidth200onsmartphone" type="text" class="flat" name="url" value="'.(isset($_POST["url"]) ?GETPOST("url") : $object->url).'">';
print '<td><input class="maxwidth200onsmartphone" type="text" class="flat" name="url" value="'.(GETPOSTISSET("url") ? GETPOST("url") : $object->url).'">';
print '</td></tr>';
// Tags-Categories

View File

@ -771,11 +771,11 @@ print '<table class="notopnoleftnoright" width="100%">';
print '<tr><td class="right">'.$morehtml.' &nbsp; &nbsp; ';
if ($mode == 'showalltime')
{
print '<a href="'.$_SERVER["PHP_SELF"].'?account='.$account.'">';
print '<a href="'.$_SERVER["PHP_SELF"].'?account='.$account.(GETPOST("option") != 'all' ? '' : '&option=all').'">';
print $langs->trans("GoBack");
print '</a>';
} else {
print '<a href="'.$_SERVER["PHP_SELF"].'?mode=showalltime&account='.$account.'">';
print '<a href="'.$_SERVER["PHP_SELF"].'?mode=showalltime&account='.$account.(GETPOST("option") != 'all' ? '' : '&option=all').'">';
print $langs->trans("ShowAllTimeBalance");
print '</a>';
}
@ -793,7 +793,7 @@ if ($mode == 'standard')
if ($nextmonth > 12) { $nextmonth = 1; $nextyear++; }
// For month
$link = "<a href='".$_SERVER["PHP_SELF"]."?account=".$account.(GETPOST("option") != 'all' ? '' : '&option=all')."&year=".$prevyear."&month=".$prevmonth."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Month")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account."&year=".$nextyear."&month=".$nextmonth."'>".img_next('', 'class="valignbottom"')."</a>";
$link = "<a href='".$_SERVER["PHP_SELF"]."?account=".$account.(GETPOST("option") != 'all' ? '' : '&option=all')."&year=".$prevyear."&month=".$prevmonth."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Month")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account.(GETPOST("option") != 'all' ? '' : '&option=all')."&year=".$nextyear."&month=".$nextmonth."'>".img_next('', 'class="valignbottom"')."</a>";
print '<div class="right clearboth">'.$link.'</div>';
print '<div class="center clearboth margintoponly">';
@ -807,7 +807,7 @@ if ($mode == 'standard')
// For year
$prevyear = $year - 1; $nextyear = $year + 1;
$link = "<a href='".$_SERVER["PHP_SELF"]."?account=".$account.(GETPOST("option") != 'all' ? '' : '&option=all')."&year=".($prevyear)."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Year")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account."&year=".($nextyear)."'>".img_next('', 'class="valignbottom"')."</a>";
$link = "<a href='".$_SERVER["PHP_SELF"]."?account=".$account.(GETPOST("option") != 'all' ? '' : '&option=all')."&year=".($prevyear)."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Year")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account.(GETPOST("option") != 'all' ? '' : '&option=all')."&year=".($nextyear)."'>".img_next('', 'class="valignbottom"')."</a>";
print '<div class="right clearboth margintoponly">'.$link.'</div>';

View File

@ -139,17 +139,17 @@ if ($user->rights->banque->modifier && $action == "update")
$sql = "UPDATE ".MAIN_DB_PREFIX."bank";
$sql .= " SET ";
// Always opened
if (isset($_POST['value'])) $sql .= " fk_type='".$db->escape(GETPOST('value'))."',";
if (isset($_POST['num_chq'])) $sql .= " num_chq='".$db->escape(GETPOST("num_chq"))."',";
if (isset($_POST['banque'])) $sql .= " banque='".$db->escape(GETPOST("banque"))."',";
if (isset($_POST['emetteur'])) $sql .= " emetteur='".$db->escape(GETPOST("emetteur"))."',";
if (GETPOSTISSET('value')) $sql .= " fk_type='".$db->escape(GETPOST('value'))."',";
if (GETPOSTISSET('num_chq')) $sql .= " num_chq='".$db->escape(GETPOST("num_chq"))."',";
if (GETPOSTISSET('banque')) $sql .= " banque='".$db->escape(GETPOST("banque"))."',";
if (GETPOSTISSET('emetteur')) $sql .= " emetteur='".$db->escape(GETPOST("emetteur"))."',";
// Blocked when conciliated
if (!$acline->rappro)
{
if (isset($_POST['label'])) $sql .= " label = '".$db->escape(GETPOST("label"))."',";
if (isset($_POST['amount'])) $sql .= " amount= '".$db->escape($amount)."',";
if (isset($_POST['dateomonth'])) $sql .= " dateo = '".$db->idate($dateop)."',";
if (isset($_POST['datevmonth'])) $sql .= " datev = '".$db->idate($dateval)."',";
if (GETPOSTISSET('label')) $sql .= " label = '".$db->escape(GETPOST("label"))."',";
if (GETPOSTISSET('amount')) $sql .= " amount= '".$db->escape($amount)."',";
if (GETPOSTISSET('dateomonth')) $sql .= " dateo = '".$db->idate($dateop)."',";
if (GETPOSTISSET('datevmonth')) $sql .= " datev = '".$db->idate($dateval)."',";
}
$sql .= " fk_account = ".$actarget->id;
$sql .= " WHERE rowid = ".$acline->id;
@ -613,7 +613,7 @@ if ($result)
if ($user->rights->banque->consolidate)
{
print '<td>';
print '<input type="checkbox" name="reconciled" class="flat" '.(isset($_POST["reconciled"]) ? ($_POST["reconciled"] ? ' checked="checked"' : '') : ($objp->rappro ? ' checked="checked"' : '')).'">';
print '<input type="checkbox" name="reconciled" class="flat" '.(GETPOSTISSET("reconciled") ? (GETPOST("reconciled") ? ' checked="checked"' : '') : ($objp->rappro ? ' checked="checked"' : '')).'">';
print '</td>';
} else {
print '<td>'.yn($objp->rappro).'</td>';

View File

@ -117,6 +117,8 @@ $usercancreatewithdrarequest = $user->rights->prelevement->bons->creer;
$now = dol_now();
$error = 0;
/*
* Actions
@ -287,13 +289,21 @@ if (empty($reshook))
elseif ($action == 'setref' && $user->rights->facture->creer)
{
//var_dump(GETPOST('ref', 'alpha'));exit;
$result = $object->setValueFrom('titre', GETPOST('ref', 'alpha'), '', null, 'text', '', $user, 'BILLREC_MODIFY');
$result = $object->setValueFrom('titre', $ref, '', null, 'text', '', $user, 'BILLREC_MODIFY');
if ($result > 0)
{
$object->titre = GETPOST('ref', 'alpha'); // deprecated
$object->title = GETPOST('ref', 'alpha');
$object->ref = $object->title;
} else dol_print_error($db, $object->error, $object->errors);
} else {
$error++;
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$langs->load("errors");
setEventMessages($langs->trans('ErrorRefAlreadyExists', $ref), null, 'errors');
} else {
setEventMessages($object->error, $object->errors, 'errors');
}
}
} // Set bank account
elseif ($action == 'setbankaccount' && $user->rights->facture->creer)
{

View File

@ -2664,7 +2664,8 @@ if (empty($reshook))
if ($result > 0 && $id > 0) {
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
$result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
$result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09'));
}
if ($result >= 0) {
@ -3415,7 +3416,7 @@ if ($action == 'create')
// Payment mode
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td colspan="2">';
$form->select_types_paiements(isset($_POST['mode_reglement_id']) ? $_POST['mode_reglement_id'] : $mode_reglement_id, 'mode_reglement_id', 'CRDT');
$form->select_types_paiements(GETPOSTISSET('mode_reglement_id') ? GETPOST('mode_reglement_id') : $mode_reglement_id, 'mode_reglement_id', 'CRDT');
print '</td></tr>';
// Bank Account
@ -4073,7 +4074,7 @@ if ($action == 'create')
print $object->getLibType();
print '</span>';
if ($object->module_source) {
print ' <span class="opacitymediumbycolor paddingleft">('.$langs->trans("POS").' '.$object->module_source.' - '.$langs->trans("Terminal").' '.$object->pos_source.')</span>';
print ' <span class="opacitymediumbycolor paddingleft">('.$langs->trans("POS").' '.ucfirst($object->module_source).' - '.$langs->trans("Terminal").' '.$object->pos_source.')</span>';
}
if ($object->type == Facture::TYPE_REPLACEMENT) {
$facreplaced = new Facture($db);

View File

@ -119,7 +119,7 @@ class Facture extends CommonInvoice
* @var int Date expected for delivery
* @deprecated
*/
public $date_livraison; // deprecated; Use delivery_date instead.
public $date_livraison; // deprecated; Use delivery_date instead.
public $delivery_date; // Date expected of shipment (date starting shipment, not the reception that occurs some days after)
@ -1331,7 +1331,7 @@ class Facture extends CommonInvoice
$this->availability_id = $object->availability_id;
$this->demand_reason_id = $object->demand_reason_id;
$this->delivery_date = (empty($object->delivery_date) ? $object->date_livraison : $object->delivery_date);
$this->date_livraison = $object->delivery_date; // deprecated
$this->date_livraison = $object->delivery_date; // deprecated
$this->fk_delivery_address = $object->fk_delivery_address; // deprecated
$this->contact_id = $object->contact_id;
$this->ref_client = $object->ref_client;

View File

@ -62,7 +62,8 @@ if ($action == 'addcontact' && $user->rights->facture->creer)
if ($result > 0 && $id > 0)
{
$contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
$result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
$result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09'));
}
if ($result >= 0)

View File

@ -223,7 +223,7 @@ if ($conf->global->INVOICE_USE_SITUATION && $conf->global->INVOICE_USE_RETAINED_
}
// Extra fields
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');

View File

@ -632,10 +632,10 @@ if ($object->id > 0)
print "\n<div class=\"tabsAction\">\n";
$buttonlabel = $langs->trans("MakeWithdrawRequest");
$user_perms=$user->rights->prelevement->bons->creer;
$user_perms = $user->rights->prelevement->bons->creer;
if ($type == 'bank-transfer') {
$buttonlabel = $langs->trans("MakeBankTransferOrder");
$user_perms=$user->rights->paymentbybanktransfer->create;
$user_perms = $user->rights->paymentbybanktransfer->create;
}
// Add a transfer request

View File

@ -222,21 +222,21 @@ if ($action == 'create')
print '<tr><td class="tdtop">'.$langs->trans("RemainderToPay").'</td><td>'.price($total-$sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).'</td></tr>';*/
print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
$datepaye = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
$datepayment = empty($conf->global->MAIN_AUTOFILL_DATE) ? (empty($_POST["remonth"]) ?-1 : $datepaye) : 0;
$datepaye = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST("reday", 'int'), GETPOST("reyear", 'int'));
$datepayment = empty($conf->global->MAIN_AUTOFILL_DATE) ? (GETPOSTISSET("remonth") ? $datepaye : -1) : 0;
print $form->selectDate($datepayment, '', '', '', 0, "add_payment", 1, 1, 0, '', '', $charge->date_ech, '', 1, $langs->trans("DateOfSocialContribution"));
print "</td>";
print '</tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>';
$form->select_types_paiements(isset($_POST["paiementtype"]) ? $_POST["paiementtype"] : $charge->paiementtype, "paiementtype");
$form->select_types_paiements(GETPOSTISSET("paiementtype") ? GETPOST("paiementtype") : $charge->paiementtype, "paiementtype");
print "</td>\n";
print '</tr>';
print '<tr>';
print '<td class="fieldrequired">'.$langs->trans('AccountToDebit').'</td>';
print '<td>';
$form->select_comptes(isset($_POST["accountid"]) ? $_POST["accountid"] : $charge->accountid, "accountid", 0, '', 2); // Show opend bank account list
$form->select_comptes(GETPOSTISSET("accountid") ? GETPOST("accountid") : $charge->accountid, "accountid", 0, '', 2); // Show opend bank account list
print '</td></tr>';
// Number

View File

@ -164,12 +164,12 @@ class BonPrelevement extends CommonObject
$result = 0;
} else {
$result = -1;
$this->errors[] = get_class($this)."::AddFacture " . $this->db->lasterror;
$this->errors[] = get_class($this)."::AddFacture ".$this->db->lasterror;
dol_syslog(get_class($this)."::AddFacture Error $result");
}
} else {
$result = -2;
$this->errors[]=get_class($this)."::AddFacture linedid Empty";
$this->errors[] = get_class($this)."::AddFacture linedid Empty";
dol_syslog(get_class($this)."::AddFacture Error $result");
}
} else {
@ -247,7 +247,7 @@ class BonPrelevement extends CommonObject
$line_id = $this->db->last_insert_id(MAIN_DB_PREFIX."prelevement_lignes");
$result = 0;
} else {
$this->errors[]=get_class($this)."::addline Error -2 " .$this->db->lasterror;
$this->errors[] = get_class($this)."::addline Error -2 ".$this->db->lasterror;
dol_syslog(get_class($this)."::addline Error -2");
$result = -2;
}
@ -1124,7 +1124,7 @@ class BonPrelevement extends CommonObject
if (!$resql)
{
$error++;
$this->errors[]=$this->db->lasterror();
$this->errors[] = $this->db->lasterror();
dol_syslog(__METHOD__."::Update Error=".$this->db->lasterror(), LOG_ERR);
}
}

View File

@ -893,7 +893,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
*/
// We set country_id, and country_code label of the chosen country
if (isset($_POST["country_id"]) || $object->country_id)
if (GETPOSTISSET("country_id") || $object->country_id)
{
$tmparray = getCountry($object->country_id, 'all');
$object->country_code = $tmparray['code'];

View File

@ -203,7 +203,7 @@ if (!empty($conf->socialnetworks->enabled)) {
}
// Extra fields
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');

View File

@ -946,7 +946,8 @@ if (empty($reshook))
if ($action == 'addcontact')
{
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
$result = $object->add_contact($contactid, GETPOST('type'), GETPOST('source'));
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
$result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09'));
if ($result >= 0)
{

View File

@ -63,7 +63,8 @@ if ($action == 'addcontact' && $user->rights->contrat->creer)
if ($result > 0 && $id > 0)
{
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
$result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
$result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09'));
}
if ($result >= 0)

View File

@ -62,7 +62,7 @@ if ($action == 'add' && !empty($permissiontoadd))
// Ignore special fields
if (in_array($key, array('rowid', 'entity', 'import_key'))) continue;
if (in_array($key, array('date_creation', 'tms', 'fk_user_creat', 'fk_user_modif'))) {
if (!in_array(abs($val['visible']), array(1, 3))) continue; // Only 1 and 3 that are case to create
if (!in_array(abs($val['visible']), array(1, 3))) continue; // Only 1 and 3 that are case to create
}
// Set value to insert
@ -146,7 +146,7 @@ if ($action == 'update' && !empty($permissiontoadd))
// Ignore special fields
if (in_array($key, array('rowid', 'entity', 'import_key'))) continue;
if (in_array($key, array('date_creation', 'tms', 'fk_user_creat', 'fk_user_modif'))) {
if (!in_array(abs($val['visible']), array(1, 3, 4))) continue; // Only 1 and 3 and 4 that are case to update
if (!in_array(abs($val['visible']), array(1, 3, 4))) continue; // Only 1 and 3 and 4 that are case to update
}
// Set value to update

View File

@ -153,8 +153,7 @@ if ($action == 'add')
if (!$error) {
// attrname must be alphabetical and lower case only
if (GETPOSISSET("attrname") && preg_match("/^[a-z0-9-_]+$/", GETPOST('attrname', 'aZ09')) && !is_numeric(GETPOST('attrname', 'aZ09')))
{
if (GETPOSTISSET("attrname") && preg_match("/^[a-z0-9-_]+$/", GETPOST('attrname', 'aZ09')) && !is_numeric(GETPOST('attrname', 'aZ09'))) {
// Construct array for parameter (value of select list)
$default_value = GETPOST('default_value', 'alpha');
$parameters = $param;
@ -166,7 +165,7 @@ if ($action == 'add')
$params['options'] = array($parameters=>null);
}
} else {
//Esle it's separated key/value and coma list
// Else it's separated key/value and coma list
foreach ($parameters_array as $param_ligne)
{
list($key, $value) = explode(',', $param_ligne);
@ -375,7 +374,7 @@ if ($action == 'update')
GETPOST('computed_value', 'alpha'),
(GETPOST('entitycurrentorall', 'alpha') ? 0 : ''),
GETPOST('langfile'),
GETPOST('enabled', 'alpha'),
GETPOST('enabled', 'alpha'),
(GETPOST('totalizable', 'alpha') ? 1 : 0),
GETPOST('printable', 'alpha')
);

View File

@ -89,7 +89,7 @@ class box_birthdays extends ModeleBoxes
$sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth";
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE u.entity IN (".getEntity('user').")";
$sql.= " AND u.statut = 1";
$sql .= " AND u.statut = 1";
$sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0);
$sql .= " ORDER BY u.birth ASC";
$sql .= $this->db->plimit($max, 0);

View File

@ -0,0 +1,193 @@
<?php
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/core/boxes/box_clients.php
* \ingroup Facture
* \brief Module d'affichage pour les encours dépassés
*/
include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
/**
* Class to manage the box to show last thirdparties
*/
class box_customers_outstanding_bill_reached extends ModeleBoxes
{
public $boxcode = "customersoutstandingbillreached";
public $boximg = "object_company";
public $boxlabel = "BoxCustomersOutstandingBillReached";
public $depends = array("facture","societe");
/**
* @var DoliDB Database handler.
*/
public $db;
public $enabled = 1;
public $info_box_head = array();
public $info_box_contents = array();
/**
* Constructor
*
* @param DoliDB $db Database handler
* @param string $param More parameters
*/
public function __construct($db, $param = '')
{
global $conf, $user;
$this->db = $db;
// disable box for such cases
if (!empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) $this->enabled = 0; // disabled by this option
$this->hidden = !($user->rights->societe->lire && empty($user->socid));
}
/**
* Load data for box to show them later
*
* @param int $max Maximum number of records to load
* @return void
*/
public function loadBox($max = 5)
{
global $user, $langs, $conf;
$langs->load("boxes");
$this->max = $max;
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$thirdpartystatic = new Societe($this->db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastOutstandingBillReached", $max));
if ($user->rights->societe->lire)
{
$sql = "SELECT s.nom as name, s.rowid as socid";
$sql .= ", s.code_client";
$sql .= ", s.client";
$sql .= ", s.code_fournisseur";
$sql .= ", s.fournisseur";
$sql .= ", s.code_compta";
$sql .= ", s.code_compta_fournisseur";
$sql .= ", s.logo";
$sql .= ", s.email";
$sql .= ", s.outstanding_limit";
$sql .= ", s.datec, s.tms, s.status, s.entity";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE s.client IN (1, 3)";
$sql .= " AND s.entity IN (".getEntity('societe').")";
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
if ($user->socid) $sql .= " AND s.rowid = $user->socid";
$sql .= " AND s.outstanding_limit > 0";
$sql .= " AND s.rowid IN (SELECT fk_soc from ".MAIN_DB_PREFIX."facture as f WHERE f.fk_statut = 1 and f.fk_soc = s.rowid)";
$sql .= " ORDER BY s.tms DESC";
//$sql .= $this->db->plimit($max, 0);
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
$num = $this->db->num_rows($result);
$nboutstandingbillreachedcustomers = 0;
$line = 0;
while ($line < $num)
{
$objp = $this->db->fetch_object($result);
$datec = $this->db->jdate($objp->datec);
$datem = $this->db->jdate($objp->tms);
$thirdpartystatic->id = $objp->socid;
$thirdpartystatic->name = $objp->name;
$thirdpartystatic->code_client = $objp->code_client;
$thirdpartystatic->code_fournisseur = $objp->code_fournisseur;
$thirdpartystatic->code_compta = $objp->code_compta;
$thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
$thirdpartystatic->client = $objp->client;
$thirdpartystatic->fournisseur = $objp->fournisseur;
$thirdpartystatic->logo = $objp->logo;
$thirdpartystatic->email = $objp->email;
$thirdpartystatic->entity = $objp->entity;
$thirdpartystatic->outstanding_limit = $objp->outstanding_limit;
$outstandingtotal = $thirdpartystatic->getOutstandingBills()['opened'];
$outstandinglimit = $thirdpartystatic->outstanding_limit;
if ($outstandingtotal >= $outstandinglimit)
{
$this->info_box_contents[$nboutstandingbillreachedcustomers][] = array(
'td' => '',
'text' => $thirdpartystatic->getNomUrl(1, 'customer'),
'asis' => 1,
);
$this->info_box_contents[$nboutstandingbillreachedcustomers][] = array(
'td' => 'class="right" width="18"',
'text' => $thirdpartystatic->LibStatut($objp->status, 3)
);
$nboutstandingbillreachedcustomers++;
}
$line++;
}
if ($num == 0 || $nboutstandingbillreachedcustomers == 0) $this->info_box_contents[$line][0] = array(
'td' => 'class="center opacitymedium"',
'text'=>$langs->trans("NoRecordedCustomers")
);
$this->db->free($result);
} else {
$this->info_box_contents[0][0] = array(
'td' => '',
'maxlength'=>500,
'text' => ($this->db->error().' sql='.$sql)
);
}
} else {
$this->info_box_contents[0][0] = array(
'td' => 'class="nohover opacitymedium left"',
'text' => $langs->trans("ReadPermissionNotAllowed")
);
}
}
/**
* Method to show box
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string
* @return string
*/
public function showBox($head = null, $contents = null, $nooutput = 0)
{
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}
}

View File

@ -204,6 +204,6 @@ class box_last_modified_ticket extends ModeleBoxes
*/
public function showBox($head = null, $contents = null, $nooutput = 0)
{
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}
}

View File

@ -202,6 +202,6 @@ class box_last_ticket extends ModeleBoxes
*/
public function showBox($head = null, $contents = null, $nooutput = 0)
{
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}
}

View File

@ -111,6 +111,6 @@ class box_lastlogin extends ModeleBoxes
*/
public function showBox($head = null, $contents = null, $nooutput = 0)
{
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}
}

View File

@ -58,6 +58,8 @@ class CMailFile
public $alternative_boundary;
public $deliveryreceipt;
public $atleastonefile;
public $eol;
public $eol2;
@ -171,7 +173,7 @@ class CMailFile
if (!empty($this->sendcontext)) {
$smtpContextKey = strtoupper($this->sendcontext);
$keyForSMTPSendMode = 'MAIN_MAIL_SENDMODE_'.$smtpContextKey;
$smtpContextSendMode = $conf->global->{$keyForSMTPSendMode};
$smtpContextSendMode = empty($conf->global->{$keyForSMTPSendMode}) ? '' : $conf->global->{$keyForSMTPSendMode};
if (!empty($smtpContextSendMode) && $smtpContextSendMode != 'default') {
$this->sendmode = $smtpContextSendMode;
}
@ -298,7 +300,7 @@ class CMailFile
if (!empty($this->sendcontext)) {
$smtpContextKey = strtoupper($this->sendcontext);
$keyForSMTPSendMode = 'MAIN_MAIL_SENDMODE_'.$smtpContextKey;
$smtpContextSendMode = $conf->global->{$keyForSMTPSendMode};
$smtpContextSendMode = empty($conf->global->{$keyForSMTPSendMode}) ? '' : $conf->global->{$keyForSMTPSendMode};
if (!empty($smtpContextSendMode) && $smtpContextSendMode != 'default') {
$keyforsslseflsigned = 'MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_'.$smtpContextKey;
}
@ -338,8 +340,7 @@ class CMailFile
$text_body = $this->write_body($msg);
// Add attachments to text_encoded
if ($this->atleastonefile)
{
if (!empty($this->atleastonefile)) {
$files_encoded = $this->write_files($filename_list, $mimetype_list, $mimefilename_list);
}
@ -401,7 +402,7 @@ class CMailFile
}
}
if ($this->atleastonefile)
if (!empty($this->atleastonefile))
{
foreach ($filename_list as $i => $val)
{
@ -530,7 +531,7 @@ class CMailFile
$this->message->addPart(dol_nl2br($msg), 'text/html');
}
if ($this->atleastonefile)
if (!empty($this->atleastonefile))
{
foreach ($filename_list as $i => $val)
{
@ -657,7 +658,7 @@ class CMailFile
if (!empty($this->sendcontext)) {
$smtpContextKey = strtoupper($this->sendcontext);
$keyForSMTPSendMode = 'MAIN_MAIL_SENDMODE_'.$smtpContextKey;
$smtpContextSendMode = $conf->global->{$keyForSMTPSendMode};
$smtpContextSendMode = empty($conf->global->{$keyForSMTPSendMode}) ? '' : $conf->global->{$keyForSMTPSendMode};
if (!empty($smtpContextSendMode) && $smtpContextSendMode != 'default') {
$keyforsmtpserver = 'MAIN_MAIL_SMTP_SERVER_'.$smtpContextKey;
$keyforsmtpport = 'MAIN_MAIL_SMTP_PORT_'.$smtpContextKey;

View File

@ -123,7 +123,7 @@ abstract class CommonDocGenerator
if ($member->photo) {
$logotouse = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $member, 'user').'/photos/'.$member->photo;
} else {
$logotouse = DOL_DOCUMENT_ROOT . '/public/theme/common/nophoto.png';
$logotouse = DOL_DOCUMENT_ROOT.'/public/theme/common/nophoto.png';
}
$array_member = array(
@ -585,7 +585,7 @@ abstract class CommonDocGenerator
'line_product_ref'=>(empty($line->product_ref) ? '' : $line->product_ref),
'line_product_ref_fourn'=>(empty($line->ref_fourn) ? '' : $line->ref_fourn), // for supplier doc lines
'line_product_label'=>(empty($line->product_label) ? '' :$line->product_label),
'line_product_label'=>(empty($line->product_label) ? '' : $line->product_label),
'line_product_type'=>(empty($line->product_type) ? '' : $line->product_type),
'line_product_barcode'=>(empty($line->product_barcode) ? '' : $line->product_barcode),
@ -652,7 +652,7 @@ abstract class CommonDocGenerator
{
$columns = "";
foreach ($extralabels as $key)
foreach ($extralabels as $key => $label)
{
$columns .= "$key, ";
}
@ -666,7 +666,7 @@ abstract class CommonDocGenerator
{
$resql = $this->db->fetch_object($resql);
foreach ($extralabels as $key)
foreach ($extralabels as $key => $label)
{
$resarray['line_product_supplier_'.$key] = $resql->{$key};
}

View File

@ -936,11 +936,11 @@ abstract class CommonObject
/**
* Add a link between element $this->element and a contact
*
* @param int $fk_socpeople Id of thirdparty contact (if source = 'external') or id of user (if souce = 'internal') to link
* @param int $type_contact Type of contact (code or id). Must be id or code found into table llx_c_type_contact. For example: SALESREPFOLL
* @param string $source external=Contact extern (llx_socpeople), internal=Contact intern (llx_user)
* @param int $notrigger Disable all triggers
* @return int <0 if KO, >0 if OK
* @param int $fk_socpeople Id of thirdparty contact (if source = 'external') or id of user (if souce = 'internal') to link
* @param int|string $type_contact Type of contact (code or id). Must be id or code found into table llx_c_type_contact. For example: SALESREPFOLL
* @param string $source external=Contact extern (llx_socpeople), internal=Contact intern (llx_user)
* @param int $notrigger Disable all triggers
* @return int <0 if KO, >0 if OK
*/
public function add_contact($fk_socpeople, $type_contact, $source = 'external', $notrigger = 0)
{
@ -1817,7 +1817,11 @@ abstract class CommonObject
return -2;
}
} else {
$this->error = $this->db->lasterror();
if ($this->db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$this->error = 'DB_ERROR_RECORD_ALREADY_EXISTS';
} else {
$this->error = $this->db->lasterror();
}
$this->db->rollback();
return -1;
}
@ -5092,7 +5096,7 @@ abstract class CommonObject
global $conf, $extrafields;
if (empty($rowid)) $rowid = $this->id;
if (empty($rowid) && isset($this->rowid)) $rowid = $this->rowid; // deprecated
if (empty($rowid) && isset($this->rowid)) $rowid = $this->rowid; // deprecated
// To avoid SQL errors. Probably not the better solution though
if (!$this->table_element) {
@ -5417,26 +5421,20 @@ abstract class CommonObject
$sql .= ",".$attributeKey;
}
// We must insert a default value for fields for other entities that are mandatory to avoid not null error
if (is_array($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities']))
{
foreach ($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities'] as $tmpkey => $tmpval)
{
if (!isset($extrafields->attributes[$this->table_element]['type'][$tmpkey])) // If field not already added previously
{
if (!empty($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities']) && is_array($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities'])) {
foreach ($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities'] as $tmpkey => $tmpval) {
if (!isset($extrafields->attributes[$this->table_element]['type'][$tmpkey])) { // If field not already added previously
$sql .= ",".$tmpkey;
}
}
}
$sql .= ") VALUES (".$this->id;
foreach ($new_array_options as $key => $value)
{
foreach ($new_array_options as $key => $value) {
$attributeKey = substr($key, 8); // Remove 'options_' prefix
// Add field of attribute
if ($extrafields->attributes[$this->table_element]['type'][$attributeKey] != 'separate') // Only for other type than separator)
{
if ($new_array_options[$key] != '' || $new_array_options[$key] == '0')
{
if ($extrafields->attributes[$this->table_element]['type'][$attributeKey] != 'separate') { // Only for other type than separator)
if ($new_array_options[$key] != '' || $new_array_options[$key] == '0') {
$sql .= ",'".$this->db->escape($new_array_options[$key])."'";
} else {
$sql .= ",null";
@ -5444,12 +5442,9 @@ abstract class CommonObject
}
}
// We must insert a default value for fields for other entities that are mandatory to avoid not null error
if (is_array($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities']))
{
foreach ($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities'] as $tmpkey => $tmpval)
{
if (!isset($extrafields->attributes[$this->table_element]['type'][$tmpkey])) // If field not already added previously
{
if (!empty($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities']) && is_array($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities'])) {
foreach ($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities'] as $tmpkey => $tmpval) {
if (!isset($extrafields->attributes[$this->table_element]['type'][$tmpkey])) { // If field not already added previously
if (in_array($tmpval, array('int', 'double', 'price'))) $sql .= ", 0";
else $sql .= ", ''";
}
@ -5939,7 +5934,7 @@ abstract class CommonObject
$out = $form->selectDate($value, $keyprefix.$key.$keysuffix, $showtime, $showtime, $required, '', 1, (($keyprefix != 'search_' && $keyprefix != 'search_options_') ? 1 : 0), 0, 1);
} elseif (in_array($type, array('duration'))) {
$out = $form->select_duration($keyprefix.$key.$keysuffix, $value, 0, 'text', 0, 1);
} elseif (in_array($type, array('int', 'integer'))) {
} elseif (in_array($type, array('int', 'integer'))) {
$tmp = explode(',', $size);
$newsize = $tmp[0];
$out = '<input type="text" class="flat '.$morecss.'" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" maxlength="'.$newsize.'" value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').($autofocusoncreate ? ' autofocus' : '').'>';
@ -5949,7 +5944,7 @@ abstract class CommonObject
$out = '<input type="text" class="flat '.$morecss.'" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" maxlength="'.$size.'" value="'.dol_escape_htmltag($value).'"'.($moreparam ? $moreparam : '').($autofocusoncreate ? ' autofocus' : '').'>';
} elseif (in_array($type, array('mail', 'phone', 'url'))) {
$out = '<input type="text" class="flat '.$morecss.'" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.dol_escape_htmltag($value).'" '.($moreparam ? $moreparam : '').($autofocusoncreate ? ' autofocus' : '').'>';
} elseif (preg_match('/^text/', $type)) {
} elseif (preg_match('/^text/', $type)) {
if (!preg_match('/search_/', $keyprefix)) // If keyprefix is search_ or search_options_, we must just use a simple text field
{
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@ -6728,7 +6723,7 @@ abstract class CommonObject
* @param array $params Optional parameters. Example: array('style'=>'class="oddeven"', 'colspan'=>$colspan)
* @param string $keysuffix Suffix string to add after name and id of field (can be used to avoid duplicate names)
* @param string $keyprefix Prefix string to add before name and id of field (can be used to avoid duplicate names)
* @param string $onetrtd All fields in same tr td (TODO field not used ?)
* @param string $onetrtd All fields in same tr td. Used by objectline_create.tpl.php for example.
* @return string
*/
public function showOptionals($extrafields, $mode = 'view', $params = null, $keysuffix = '', $keyprefix = '', $onetrtd = 0)
@ -6894,6 +6889,9 @@ abstract class CommonObject
$helptoshow = $langs->trans($extrafields->attributes[$this->table_element]['help'][$key]);
$out .= '<tr '.($html_id ? 'id="'.$html_id.'" ' : '').$csstyle.' class="'.$class.$this->element.'_extras_'.$key.' trextrafields_collapse'.$extrafields_collapse_num.'" '.$domData.' >';
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER) && $action == 'view') {
$out .= '<td></td>';
}
$out .= '<td class="wordbreak';
//$out .= "titlefield";
//if (GETPOST('action', 'restricthtml') == 'create') $out.='create';
@ -8057,7 +8055,7 @@ abstract class CommonObject
// Delete llx_ecm_files
if (!$error) {
$res = $this->deleteEcmFiles(1); // Deleting files physically is done later with the dol_delete_dir_recursive
if (! $res) {
if (!$res) {
$error++;
}
}
@ -8489,7 +8487,7 @@ abstract class CommonObject
// Delete ecm_files extrafields
$sql = "DELETE FROM ".MAIN_DB_PREFIX."ecm_files_extrafields WHERE fk_object IN (";
$sql .= " SELECT rowid FROM ".MAIN_DB_PREFIX."ecm_files WHERE filename LIKE '".$this->db->escape($this->ref)."%'";
$sql .= " AND filepath = '".$this->db->escape($element)."/".$this->db->escape($this->ref)."' AND entity = ".$conf->entity; // No need of getEntity here
$sql .= " AND filepath = '".$this->db->escape($element)."/".$this->db->escape($this->ref)."' AND entity = ".$conf->entity; // No need of getEntity here
$sql .= ")";
if (!$this->db->query($sql)) {
@ -8501,7 +8499,7 @@ abstract class CommonObject
// Delete ecm_files
$sql = "DELETE FROM ".MAIN_DB_PREFIX."ecm_files";
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%'";
$sql .= " AND filepath = '".$this->db->escape($element)."/".$this->db->escape($this->ref)."' AND entity = ".$conf->entity; // No need of getEntity here
$sql .= " AND filepath = '".$this->db->escape($element)."/".$this->db->escape($this->ref)."' AND entity = ".$conf->entity; // No need of getEntity here
if (!$this->db->query($sql)) {
$this->error = $this->db->lasterror();

View File

@ -98,7 +98,7 @@ class DolGeoIP
//print 'function_exists(geoip_country_code_by_name))='.function_exists('geoip_country_code_by_name');
//print geoip_database_info();
} else {
$this->gi = ''; // For avoid error
$this->gi = ''; // For avoid error
}
}

View File

@ -141,7 +141,7 @@ class Events // extends CommonObject
// Clean parameters
$this->description = trim($this->description);
if (empty($this->user_agent)) $this->user_agent = (empty($_SERVER['HTTP_USER_AGENT'])?'':$_SERVER['HTTP_USER_AGENT']);
if (empty($this->user_agent)) $this->user_agent = (empty($_SERVER['HTTP_USER_AGENT']) ? '' : $_SERVER['HTTP_USER_AGENT']);
// Check parameters
if (empty($this->description)) { $this->error = 'ErrorBadValueForParameterCreateEventDesc'; return -1; }

View File

@ -1456,6 +1456,7 @@ class Form
$langs->load('companies');
if (empty($htmlid)) $htmlid = $htmlname;
$num = 0;
if ($selected === '') $selected = array();
elseif (!is_array($selected)) $selected = array($selected);
@ -1489,7 +1490,7 @@ class Form
$out .= ajax_combobox($htmlid, $events, $conf->global->CONTACT_USE_SEARCH_TO_SELECT);
}
if ($htmlname != 'none' && !$options_only) $out .= '<select class="flat'.($moreclass ? ' '.$moreclass : '').'"'.($num?'':' disabled').' id="'.$htmlid.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>';
if ($htmlname != 'none' && !$options_only) $out .= '<select class="flat'.($moreclass ? ' '.$moreclass : '').'"'.($num ? '' : ' disabled').' id="'.$htmlid.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.(!empty($moreparam) ? $moreparam : '').'>';
if (($showempty == 1 || ($showempty == 3 && $num > 1)) && !$multiple) $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>&nbsp;</option>';
if ($showempty == 2) $out .= '<option value="0"'.(in_array(0, $selected) ? ' selected' : '').'>-- '.$langs->trans("Internal").' --</option>';
@ -1522,7 +1523,7 @@ class Form
if (!empty($contact_town)) $extendedInfos[] = $contact_town;
elseif (!empty($company_town)) $extendedInfos[] = $company_town;
$extendedInfos = implode(' - ', $extendedInfos);
if (!empty($extendedInfos)) $extendedInfos = ' - ' . $extendedInfos;
if (!empty($extendedInfos)) $extendedInfos = ' - '.$extendedInfos;
}
$contactstatic->id = $obj->rowid;
@ -1539,7 +1540,7 @@ class Form
$out .= '<option value="'.$obj->rowid.'"';
if ($disabled) $out .= ' disabled';
$out .= ' selected>';
$out .= $contactstatic->getFullName($langs) . $extendedInfos;
$out .= $contactstatic->getFullName($langs).$extendedInfos;
if ($showfunction && $obj->poste) $out .= ' ('.$obj->poste.')';
if (($showsoc > 0) && $obj->company) $out .= ' - ('.$obj->company.')';
$out .= '</option>';
@ -1547,7 +1548,7 @@ class Form
$out .= '<option value="'.$obj->rowid.'"';
if ($disabled) $out .= ' disabled';
$out .= '>';
$out .= $contactstatic->getFullName($langs) . $extendedInfos;
$out .= $contactstatic->getFullName($langs).$extendedInfos;
if ($showfunction && $obj->poste) $out .= ' ('.$obj->poste.')';
if (($showsoc > 0) && $obj->company) $out .= ' - ('.$obj->company.')';
$out .= '</option>';
@ -1555,7 +1556,7 @@ class Form
} else {
if (in_array($obj->rowid, $selected))
{
$out .= $contactstatic->getFullName($langs) . $extendedInfos;
$out .= $contactstatic->getFullName($langs).$extendedInfos;
if ($showfunction && $obj->poste) $out .= ' ('.$obj->poste.')';
if (($showsoc > 0) && $obj->company) $out .= ' - ('.$obj->company.')';
}
@ -4548,7 +4549,7 @@ class Form
$out .= '<input type="hidden" name="action" value="classin">';
$out .= '<input type="hidden" name="token" value="'.newToken().'">';
$out .= $formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus, 0, 0, '', 1);
$out .= '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
$out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
$out .= '</form>';
} else {
if ($selected)
@ -4590,7 +4591,7 @@ class Form
print '<input type="hidden" name="action" value="setconditions">';
print '<input type="hidden" name="token" value="'.newToken().'">';
$this->select_conditions_paiements($selected, $htmlname, -1, $addempty);
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
print '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">';
print '</form>';
} else {
if ($selected)
@ -4623,7 +4624,7 @@ class Form
print '<input type="hidden" name="action" value="setavailability">';
print '<input type="hidden" name="token" value="'.newToken().'">';
$this->selectAvailabilityDelay($selected, $htmlname, -1, $addempty);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
print '</form>';
} else {
if ($selected)
@ -4655,7 +4656,7 @@ class Form
print '<input type="hidden" name="action" value="setdemandreason">';
print '<input type="hidden" name="token" value="'.newToken().'">';
$this->selectInputReason($selected, $htmlname, -1, $addempty);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
print '</form>';
} else {
if ($selected)
@ -4704,7 +4705,7 @@ class Form
$ret .= '<tr><td>';
$ret .= $this->selectDate($selected, $htmlname, $displayhour, $displaymin, 1, 'form'.$htmlname, 1, 0);
$ret .= '</td>';
$ret .= '<td class="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
$ret .= '<td class="left"><input type="submit smallpaddingimp" class="button" value="'.$langs->trans("Modify").'"></td>';
$ret .= '</tr></table></form>';
} else {
if ($displayhour) $ret .= dol_print_date($selected, 'dayhour');
@ -4738,7 +4739,7 @@ class Form
print '<input type="hidden" name="action" value="set'.$htmlname.'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print $this->select_dolusers($selected, $htmlname, 1, $exclude, 0, $include);
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
print '</form>';
} else {
if ($selected)
@ -4776,7 +4777,7 @@ class Form
print '<input type="hidden" name="action" value="setmode">';
print '<input type="hidden" name="token" value="'.newToken().'">';
$this->select_types_paiements($selected, $htmlname, $filtertype, 0, $addempty, 0, 0, $active);
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
print '</form>';
} else {
if ($selected)
@ -4808,7 +4809,7 @@ class Form
print '<input type="hidden" name="action" value="setmode">';
print '<input type="hidden" name="token" value="'.newToken().'">';
$this->selectTransportMode($selected, $htmlname, 2, $addempty, 0, 0, $active);
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
print '</form>';
}
else {
@ -4841,7 +4842,7 @@ class Form
print '<input type="hidden" name="action" value="setmulticurrencycode">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print $this->selectMultiCurrency($selected, $htmlname, 0);
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
print '</form>';
} else {
dol_include_once('/core/lib/company.lib.php');
@ -4874,7 +4875,7 @@ class Form
print '<option value="1">'.$currency.' > '.$conf->currency.'</option>';
print '<option value="2">'.$conf->currency.' > '.$currency.'</option>';
print '</select> ';
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
print '</form>';
} else {
if (!empty($rate))
@ -4949,7 +4950,7 @@ class Form
$nbqualifiedlines = $this->select_remises($selected, $htmlname, $newfilter, $socid, $maxvalue);
if ($nbqualifiedlines > 0)
{
print ' &nbsp; <input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"';
print ' &nbsp; <input type="submit" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("UseLine")).'"';
if (!empty($discount_type) && $filter && $filter != "fk_invoice_supplier_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS PAID)%')")
print ' title="'.$langs->trans("UseCreditNoteInInvoicePayment").'"';
if (empty($discount_type) && $filter && $filter != "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')")
@ -4999,14 +5000,15 @@ class Form
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
print '<tr><td>';
$num = $this->select_contacts($societe->id, $selected, $htmlname);
print $this->selectcontacts($societe->id, $selected, $htmlname);
$num = $this->num;
if ($num == 0)
{
$addcontact = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
print '<a href="'.DOL_URL_ROOT.'/contact/card.php?socid='.$societe->id.'&amp;action=create&amp;backtoreferer=1">'.$addcontact.'</a>';
}
print '</td>';
print '<td class="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
print '<td class="left"><input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'"></td>';
print '</tr></table></form>';
} else {
if ($selected)
@ -5048,7 +5050,7 @@ class Form
$out .= '<input type="hidden" name="action" value="set_thirdparty">';
$out .= '<input type="hidden" name="token" value="'.newToken().'">';
$out .= $this->select_company($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events);
$out .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$out .= '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
$out .= '</form>';
} else {
if ($selected)

View File

@ -1133,7 +1133,7 @@ class FormMail extends Form
if (!empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_SUPPLIER_PROPOSAL) && !empty($this->param['models']) && $this->param['models'] == 'supplier_proposal_send') $defaultvaluefordeliveryreceipt = 1;
if (!empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_ORDER) && !empty($this->param['models']) && $this->param['models'] == 'order_send') $defaultvaluefordeliveryreceipt = 1;
if (!empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_INVOICE) && !empty($this->param['models']) && $this->param['models'] == 'facture_send') $defaultvaluefordeliveryreceipt = 1;
$out .= $form->selectyesno('deliveryreceipt', (isset($_POST["deliveryreceipt"]) ? $_POST["deliveryreceipt"] : $defaultvaluefordeliveryreceipt), 1);
$out .= $form->selectyesno('deliveryreceipt', (GETPOSTISSET("deliveryreceipt") ? GETPOST("deliveryreceipt") : $defaultvaluefordeliveryreceipt), 1);
}
$out .= "</td></tr>\n";
return $out;
@ -1170,7 +1170,7 @@ class FormMail extends Form
$out .= $defaulttopic;
$out .= '<input type="hidden" class="quatrevingtpercent" id="subject" name="subject" value="'.$defaulttopic.'" />';
} else {
$out .= '<input type="text" class="quatrevingtpercent" id="subject" name="subject" value="'.((isset($_POST["subject"]) && !$_POST['modelselected']) ? $_POST["subject"] : ($defaulttopic ? $defaulttopic : '')).'" />';
$out .= '<input type="text" class="quatrevingtpercent" id="subject" name="subject" value="'.((GETPOSTISSET("subject") && !GETPOST('modelselected')) ? GETPOST("subject") : ($defaulttopic ? $defaulttopic : '')).'" />';
}
$out .= "</td></tr>\n";
return $out;

View File

@ -62,11 +62,11 @@ class FormOrder extends Form
$options[$value] = $tmpsupplierorder->getLibStatut($short);
}
if (is_array($selected)) $selectedarray = $selected;
else $selectedarray = explode(',', $selected);
if (is_array($selected)) $selectedarray = $selected;
else $selectedarray = explode(',', $selected);
print Form::multiselectarray($hmlname, $options, $selectedarray, 0);
}
print Form::multiselectarray($hmlname, $options, $selectedarray, 0);
}
/**
* Return list of input method (mode used to receive order, like order received by email, fax, online)

View File

@ -288,7 +288,7 @@ function limitChars(textarea, limit, infodiv)
$defaultmessage = $this->withbody;
}
$defaultmessage = make_substitutions($defaultmessage, $this->substit);
if (isset($_POST["message"])) $defaultmessage = $_POST["message"];
if (GETPOSTISSET("message")) $defaultmessage = GETPOST("message", 'restricthtml');
$defaultmessage = str_replace('\n', "\n", $defaultmessage);
print "<tr>";

View File

@ -385,7 +385,7 @@ class FormTicket
// If no socid, set to -1 to avoid full contacts list
$selectedCompany = ($this->withfromsocid > 0) ? $this->withfromsocid : -1;
print img_picto('', 'contact', 'class="paddingright"');
$nbofcontacts = $form->select_contacts($selectedCompany, $this->withfromcontactid, 'contactid', 3, '', '', 0, 'minwidth200');
print $form->selectcontacts($selectedCompany, $this->withfromcontactid, 'contactid', 3, '', '', 0, 'minwidth200');
print ' ';
$formcompany->selectTypeContact($ticketstatic, '', 'type', 'external', '', 0, 'maginleftonly');
print '</td></tr>';
@ -999,8 +999,8 @@ class FormTicket
} elseif (!dol_textishtml($defaultmessage) && dol_textishtml($this->substit['__USER_SIGNATURE__'])) {
$defaultmessage = dol_nl2br($defaultmessage);
}
if (isset($_POST["message"]) && !$_POST['modelselected']) {
$defaultmessage = GETPOST('message');
if (GETPOSTISSET("message") && !$_POST['modelselected']) {
$defaultmessage = GETPOST('message', 'restricthtml');
} else {
$defaultmessage = make_substitutions($defaultmessage, $this->substit);
// Clean first \n and br (to avoid empty line when CONTACTCIVNAME is empty)

View File

@ -623,8 +623,8 @@ class Translate
// We replace some HTML tags by __xx__ to avoid having them encoded by htmlentities because
// we want to keep '"' '<b>' '</b>' '<strong' '</strong>' '<a ' '</a>' '<br>' '< ' '<span' '</span>' that are reliable HTML tags inside translation strings.
$str = str_replace(
array('"', '<b>', '</b>', '<strong>', '</strong>', '<a ', '</a>', '<br>', '<span', '</span>', '< ', '>'), // We accept '< ' but not '<'. We can accept however '>'
array('__quot__', '__tagbold__', '__tagboldend__', '__tagbold__', '__tagboldend__', '__taga__', '__tagaend__', '__tagbr__', '__tagspan__', '__tagspanend__', '__lt__', '__gt__'),
array('"', '<b>', '</b>', '<u>', '</u>', '<i>', '</i>', '<center>', '</center>', '<strong>', '</strong>', '<a ', '</a>', '<br>', '<span', '</span>', '< ', '>'), // We accept '< ' but not '<'. We can accept however '>'
array('__quot__', '__tagb__', '__tagbend__', '__tagu__', '__taguend__', '__tagi__', '__tagiend__', '__tagcenter__', '__tagcenterend__', '__tagb__', '__tagbend__', '__taga__', '__tagaend__', '__tagbr__', '__tagspan__', '__tagspanend__', '__lt__', '__gt__'),
$str
);
@ -638,8 +638,8 @@ class Translate
// Restore reliable HTML tags into original translation string
$str = str_replace(
array('__quot__', '__tagbold__', '__tagboldend__', '__taga__', '__tagaend__', '__tagbr__', '__tagspan__', '__tagspanend__', '__lt__', '__gt__'),
array('"', '<b>', '</b>', '<a ', '</a>', '<br>', '<span', '</span>', '< ', '> '),
array('__quot__', '__tagb__', '__tagbend__', '__tagu__', '__taguend__', '__tagi__', '__tagiend__', '__tagcenter__', '__tagcenterend__', '__taga__', '__tagaend__', '__tagbr__', '__tagspan__', '__tagspanend__', '__lt__', '__gt__'),
array('"', '<b>', '</b>', '<u>', '</u>', '<i>', '</i>', '<center>', '</center>', '<a ', '</a>', '<br>', '<span', '</span>', '< ', '> '),
$str
);
@ -745,7 +745,7 @@ class Translate
*/
public function transcountrynoentities($str, $countrycode)
{
if (! empty($this->tab_translate["$str$countrycode"])) return $this->transnoentities("$str$countrycode");
if (!empty($this->tab_translate["$str$countrycode"])) return $this->transnoentities("$str$countrycode");
else return $this->transnoentities($str);
}

View File

@ -224,14 +224,14 @@ function dol_shutdown()
}
/**
* Return true if we are in a context of submitting a parameter
* Return true if we are in a context of submitting the parameter $paramname
*
* @param string $paramname Name or parameter to test
* @return boolean True if we have just submit a POST or GET request with the parameter provided (even if param is empty)
*/
function GETPOSTISSET($paramname)
{
$isset = 0;
$isset = false;
$relativepathstring = $_SERVER["PHP_SELF"];
// Clean $relativepathstring
@ -254,7 +254,7 @@ function GETPOSTISSET($paramname)
{
if ($key == $paramname) // We are on the requested parameter
{
$isset = 1;
$isset = true;
break;
}
}
@ -263,16 +263,16 @@ function GETPOSTISSET($paramname)
// If there is saved contextpage, page or limit
if ($paramname == 'contextpage' && !empty($_SESSION['lastsearch_contextpage_'.$relativepathstring]))
{
$isset = 1;
$isset = true;
} elseif ($paramname == 'page' && !empty($_SESSION['lastsearch_page_'.$relativepathstring]))
{
$isset = 1;
$isset = true;
} elseif ($paramname == 'limit' && !empty($_SESSION['lastsearch_limit_'.$relativepathstring]))
{
$isset = 1;
$isset = true;
}
} else {
$isset = (isset($_POST[$paramname]) || isset($_GET[$paramname]));
$isset = (isset($_POST[$paramname]) || isset($_GET[$paramname])); // We must keep $_POST and $_GET here
}
return $isset;
@ -287,13 +287,13 @@ function GETPOSTISSET($paramname)
* @param string $check Type of check
* ''=no check (deprecated)
* 'none'=no check (only for param that should have very rich content)
* 'array', 'array:restricthtml' or 'array:aZ09' to check it's an array
* 'int'=check it's numeric (integer or float)
* 'intcomma'=check it's integer+comma ('1,2,3,4...')
* 'alpha'=Same than alphanohtml since v13
* 'alphanohtml'=check there is no html content and no " and no ../
* 'aZ'=check it's a-z only
* 'aZ09'=check it's simple alpha string (recommended for keys)
* 'array'=check it's array
* 'san_alpha'=Use filter_var with FILTER_SANITIZE_STRING (do not use this for free text string)
* 'nohtml'=check there is no html content and no " and no ../
* 'restricthtml'=check html content is restricted to some tags only
@ -411,7 +411,6 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
}
}
} // Management of default search_filters and sort order
//elseif (preg_match('/list.php$/', $_SERVER["PHP_SELF"]) && ! empty($paramname) && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname]))
elseif (!empty($paramname) && !isset($_GET[$paramname]) && !isset($_POST[$paramname]))
{
if (!empty($user->default_values)) // $user->default_values defined from menu 'Setup - Default values'
@ -476,6 +475,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
if ($qualified)
{
// We must keep $_POST and $_GET here
if (isset($_POST['sall']) || isset($_POST['search_all']) || isset($_GET['sall']) || isset($_GET['search_all']))
{
// We made a search from quick search menu, do we still use default filter ?
@ -604,6 +604,22 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
return $out;
}
/**
* Return value of a param into GET or POST supervariable.
* Use the property $user->default_values[path]['creatform'] and/or $user->default_values[path]['filters'] and/or $user->default_values[path]['sortorder']
* Note: The property $user->default_values is loaded by main.php when loading the user.
*
* @param string $paramname Name of parameter to found
* @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get)
* @param int $filter Filter to apply when $check is set to 'custom'. (See http://php.net/manual/en/filter.filters.php for détails)
* @param mixed $options Options to pass to filter_var when $check is set to 'custom'
* @param string $noreplace Force disable of replacement of __xxx__ strings.
* @return int Value found (int)
*/
function GETPOSTINT($paramname, $method = 0, $filter = null, $options = null, $noreplace = 0)
{
return (int) GETPOST($paramname, 'int', $method, $filter, $options, $noreplace);
}
/**
* Return a value after checking on a rule.
@ -1273,11 +1289,11 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename =
*/
function dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $disabled = '')
{
if (strpos($url, '?') > 0) {
$url .= '&dol_hide_topmenu=1&dol_hide_leftmenu=1&dol_openinpopup=1';
} else {
$url .= '?dol_hide_menuinpopup=1&dol_hide_leftmenu=1&dol_openinpopup=1';
}
if (strpos($url, '?') > 0) {
$url .= '&dol_hide_topmenu=1&dol_hide_leftmenu=1&dol_openinpopup=1';
} else {
$url .= '?dol_hide_menuinpopup=1&dol_hide_leftmenu=1&dol_openinpopup=1';
}
//print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("MediaFiles")).'" name="file_manager">';
$out = '<a class="button bordertransp button_'.$name.'"'.$disabled.' title="'.dol_escape_htmltag($label).'">'.$buttonstring.'</a>';
@ -3334,7 +3350,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
// Define $color
$arrayconvpictotocolor = array(
'address'=>'#6c6aa8', 'building'=>'#6c6aa8', 'bom'=>'#a69944',
'companies'=>'#6c6aa8', 'company'=>'#6c6aa8', 'contact'=>'#37a', 'dynamicprice'=>'#a69944',
'companies'=>'#6c6aa8', 'company'=>'#6c6aa8', 'contact'=>'#6c6aa8', 'dynamicprice'=>'#a69944',
'edit'=>'#444', 'note'=>'#999', 'error'=>'', 'help'=>'#bbb', 'listlight'=>'#999',
'dolly'=>'#a69944', 'dollyrevert'=>'#a69944', 'lot'=>'#a69944',
'map-marker-alt'=>'#aaa', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'stock'=>'#a69944',
@ -4123,7 +4139,7 @@ function dol_print_error($db = '', $error = '', $errors = null)
print $out;
} else {
if (empty($langs->defaultlang)) $langs->setDefaultLang();
$langs->loadLangs(array("main", "errors")); // Reload main because language may have been set only on previous line so we have to reload files we need.
$langs->loadLangs(array("main", "errors")); // Reload main because language may have been set only on previous line so we have to reload files we need.
// This should not happen, except if there is a bug somewhere. Enabled and check log in such case.
print 'This website or feature is currently temporarly not available or failed after a technical error.<br><br>This may be due to a maintenance operation. Current status of operation are on next line...<br><br>'."\n";
print $langs->trans("DolibarrHasDetectedError").'. ';
@ -5576,7 +5592,7 @@ function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart = '
// In a future, we may distribut directories on several levels depending on setup and object.
// Here, $object->id, $object->ref and $modulepart are required.
//var_dump($modulepart);
if (! in_array($modulepart, array('product'))) { // Test to remove
if (!in_array($modulepart, array('product'))) { // Test to remove
$path = dol_sanitizeFileName(empty($object->ref) ? $object->id : $object->ref);
}
}
@ -6278,7 +6294,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
if (is_object($object) && ($object->element == 'adherent' || $object->element == 'member') && $object->id > 0)
{
$birthday = (empty($object->birth) ? '': dol_print_date($object->birth, 'day'));
$birthday = (empty($object->birth) ? '' : dol_print_date($object->birth, 'day'));
$substitutionarray['__MEMBER_ID__'] = (isset($object->id) ? $object->id : '');
if (method_exists($object, 'getCivilityLabel')) $substitutionarray['__MEMBER_CIVILITY__'] = $object->getCivilityLabel();
@ -6678,7 +6694,7 @@ function complete_substitutions_array(&$substitutionarray, $outputlangs, $object
// to list all tags in odt template
$tags = '';
foreach ($substitutionarray as $key => $value) {
$tags .= '{' . $key . '} => ' . $value ."\n";
$tags .= '{'.$key.'} => '.$value."\n";
}
$substitutionarray = array_merge($substitutionarray, array('__ALL_TAGS__' => $tags));
}

View File

@ -150,7 +150,7 @@ function dolSessionGC($max_lifetime)
$time_stamp = dol_now();
$delete_query = "DELETE FROM ".MAIN_DB_PREFIX."session";
$delete_query = "DELETE FROM ".MAIN_DB_PREFIX."session";
$delete_query .= " WHERE last_accessed < '".$dbsession->idate($time_stamp - $max_lifetime)."'";
$resql = $dbsession->query($delete_query);

View File

@ -485,7 +485,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
$taskstatic->fk_statut = $lines[$i]->status;
$taskstatic->date_start = $lines[$i]->date_start;
$taskstatic->date_end = $lines[$i]->date_end;
$taskstatic->datee = $lines[$i]->date_end; // deprecated
$taskstatic->datee = $lines[$i]->date_end; // deprecated
$taskstatic->planned_workload = $lines[$i]->planned_workload;
$taskstatic->duration_effective = $lines[$i]->duration;
@ -1319,7 +1319,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
global $daytoparse;
$tmparray = dol_getdate($daytoparse, true); // detail of current day
$idw = ($tmparray['wday'] - (empty($conf->global->MAIN_START_WEEK)?0:1));
$idw = ($tmparray['wday'] - (empty($conf->global->MAIN_START_WEEK) ? 0 : 1));
global $numstartworkingday, $numendworkingday;
$cssweekend = '';
if ((($idw + 1) < $numstartworkingday) || (($idw + 1) > $numendworkingday)) // This is a day is not inside the setup of working days, so we use a week-end css.

View File

@ -720,14 +720,15 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY))
{
$langs->load("errors");
$warnpicto = ' '.img_warning($langs->trans("WarningMandatorySetupNotComplete"));
$warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete"));
}
$newmenu->add("/admin/company.php?mainmenu=home", $langs->trans("MenuCompanySetup").$warnpicto, 1);
$warnpicto = '';
if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) // If only user module enabled
{
$langs->load("errors");
$warnpicto = ' '.img_warning($langs->trans("WarningMandatorySetupNotComplete"));
$warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete"));
}
$newmenu->add("/admin/modules.php?mainmenu=home", $langs->trans("Modules").$warnpicto, 1);
$newmenu->add("/admin/ihm.php?mainmenu=home", $langs->trans("GUISetup"), 1);
@ -740,7 +741,18 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/admin/security_other.php?mainmenu=home", $langs->trans("Security"), 1);
$newmenu->add("/admin/limits.php?mainmenu=home", $langs->trans("MenuLimits"), 1);
$newmenu->add("/admin/pdf.php?mainmenu=home", $langs->trans("PDF"), 1);
$newmenu->add("/admin/mails.php?mainmenu=home", $langs->trans("Emails"), 1);
$warnpicto = '';
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
$langs->load("errors");
$warnpicto = img_warning($langs->trans("WarningPHPMailD"));
}
if (in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmail')) && empty($conf->global->MAIN_MAIL_SMTP_SERVER)) {
$langs->load("errors");
$warnpicto = img_warning($langs->trans("ErrorSetupOfEmailsNotComplete"));
}
$newmenu->add("/admin/mails.php?mainmenu=home", $langs->trans("Emails").$warnpicto, 1);
$newmenu->add("/admin/sms.php?mainmenu=home", $langs->trans("SMS"), 1);
$newmenu->add("/admin/dict.php?mainmenu=home", $langs->trans("Dictionary"), 1);
$newmenu->add("/admin/const.php?mainmenu=home", $langs->trans("OtherSetup"), 1);
@ -1985,17 +1997,14 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
if (!empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) && empty($menu_array[$i]['enabled'])) $showmenu = false;
// Begin of new left menu block
if (empty($menu_array[$i]['level']) && $showmenu)
{
if (empty($menu_array[$i]['level']) && $showmenu) {
$altok++;
$blockvmenuopened = true;
$lastopened = true;
for ($j = ($i + 1); $j < $num; $j++)
{
for ($j = ($i + 1); $j < $num; $j++) {
if (empty($menu_array[$j]['level'])) $lastopened = false;
}
if ($altok % 2 == 0)
{
if ($altok % 2 == 0) {
print '<div class="blockvmenu blockvmenuimpair'.$invert.($lastopened ? ' blockvmenulast' : '').($altok == 1 ? ' blockvmenufirst' : '').'">'."\n";
} else {
print '<div class="blockvmenu blockvmenupair'.$invert.($lastopened ? ' blockvmenulast' : '').($altok == 1 ? ' blockvmenufirst' : '').'">'."\n";
@ -2005,10 +2014,8 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
// Add tabulation
$tabstring = '';
$tabul = ($menu_array[$i]['level'] - 1);
if ($tabul > 0)
{
for ($j = 0; $j < $tabul; $j++)
{
if ($tabul > 0) {
for ($j = 0; $j < $tabul; $j++) {
$tabstring .= '&nbsp;&nbsp;&nbsp;';
}
}
@ -2048,7 +2055,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
if ($menu_array[$i]['enabled']) // Enabled so visible
{
print '<div class="menu_titre">'.$tabstring;
if ($shorturlwithoutparam) print '<a class="vmenu" title="'.dol_escape_htmltag($menu_array[$i]['titre']).'" href="'.$url.'"'.($menu_array[$i]['target'] ? ' target="'.$menu_array[$i]['target'].'"' : '').'>';
if ($shorturlwithoutparam) print '<a class="vmenu" title="'.dol_escape_htmltag(dol_string_nohtmltag($menu_array[$i]['titre'])).'" href="'.$url.'"'.($menu_array[$i]['target'] ? ' target="'.$menu_array[$i]['target'].'"' : '').'>';
else print '<span class="vmenu">';
print ($menu_array[$i]['prefix'] ? $menu_array[$i]['prefix'] : '').$menu_array[$i]['titre'];
if ($shorturlwithoutparam) print '</a>';
@ -2077,7 +2084,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
if ($menu_array[$i]['enabled'] && $lastlevel0 == 'enabled') // Enabled so visible, except if parent was not enabled.
{
print '<div class="menu_contenu'.$cssmenu.'">'.$tabstring;
if ($shorturlwithoutparam) print '<a class="vsmenu" title="'.dol_escape_htmltag($menu_array[$i]['titre']).'" href="'.$url.'"'.($menu_array[$i]['target'] ? ' target="'.$menu_array[$i]['target'].'"' : '').'>';
if ($shorturlwithoutparam) print '<a class="vsmenu" title="'.dol_escape_htmltag(dol_string_nohtmltag($menu_array[$i]['titre'])).'" href="'.$url.'"'.($menu_array[$i]['target'] ? ' target="'.$menu_array[$i]['target'].'"' : '').'>';
else print '<span class="vsmenu" title="'.dol_escape_htmltag($menu_array[$i]['titre']).'">';
print $menu_array[$i]['titre'];
if ($shorturlwithoutparam) print '</a>';

View File

@ -420,7 +420,7 @@ class pdf_crabe extends ModelePDFFactures
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 + $top_shift : 10);
// Incoterm
if (! empty($conf->incoterm->enabled))
if (!empty($conf->incoterm->enabled))
{
$desc_incoterms = $object->getIncotermsForPDF();
if ($desc_incoterms)

View File

@ -605,7 +605,7 @@ class ImportCsv extends ModeleImports
$errorforthistable++;
$error++;
} else {
$newval = $arrayrecord[($key - 1)]['val']; //We get new value computed.
$newval = $arrayrecord[($key - 1)]['val']; //We get new value computed.
}
} elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'numeric') {
$newval = price2num($newval);

View File

@ -639,7 +639,7 @@ class ImportXlsx extends ModeleImports
$errorforthistable++;
$error++;
} else {
$newval = $arrayrecord[($key - 1)]['val']; //We get new value computed.
$newval = $arrayrecord[($key - 1)]['val']; //We get new value computed.
}
} elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'numeric') {
$newval = price2num($newval);

View File

@ -172,10 +172,10 @@ class mailing_pomme extends MailingTargets
$sql .= " WHERE u.email <> ''"; // u.email IS NOT NULL est implicite dans ce test
$sql .= " AND u.entity IN (0,".$conf->entity.")";
$sql .= " AND u.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")";
if (isset($_POST["filter"]) && $_POST["filter"] == '1') $sql .= " AND u.statut=1";
if (isset($_POST["filter"]) && $_POST["filter"] == '0') $sql .= " AND u.statut=0";
if (isset($_POST["filteremployee"]) && $_POST["filteremployee"] == '1') $sql .= " AND u.employee=1";
if (isset($_POST["filteremployee"]) && $_POST["filteremployee"] == '0') $sql .= " AND u.employee=0";
if (GETPOSTISSET("filter") && GETPOST("filter") == '1') $sql .= " AND u.statut=1";
if (GETPOSTISSET("filter") && GETPOST("filter") == '0') $sql .= " AND u.statut=0";
if (GETPOSTISSET("filteremployee") && GETPOSt("filteremployee") == '1') $sql .= " AND u.employee=1";
if (GETPOSTISSET("filteremployee") && GETPOST("filteremployee") == '0') $sql .= " AND u.employee=0";
$sql .= " ORDER BY u.email";
// Stocke destinataires dans cibles

View File

@ -81,9 +81,8 @@ class mailing_thirdparties extends MailingTargets
$sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")";
} else {
$addFilter = "";
if (isset($_POST["filter_client"]) && $_POST["filter_client"] <> '-1')
{
$addFilter .= " AND s.client=".$_POST["filter_client"];
if (GETPOSTISSET("filter_client") && GETPOST("filter_client") <> '-1') {
$addFilter .= " AND s.client=".((int) GETPOST("filter_client", 'int'));
$addDescription = $langs->trans('ProspectCustomer')."=";
if ($_POST["filter_client"] == 0)
{
@ -98,18 +97,15 @@ class mailing_thirdparties extends MailingTargets
{
$addDescription .= $langs->trans('ProspectCustomer');
} else {
$addDescription .= "Unknown status ".$_POST["filter_client"];
$addDescription .= "Unknown status ".GETPOST("filter_client");
}
}
if (isset($_POST["filter_status"]))
{
if (strlen($addDescription) > 0)
{
if (GETPOSTISSET("filter_status")) {
if (strlen($addDescription) > 0) {
$addDescription .= ";";
}
$addDescription .= $langs->trans("Status")."=";
if ($_POST["filter_status"] == '1')
{
if (GETPOST("filter_status") == '1') {
$addFilter .= " AND s.status=1";
$addDescription .= $langs->trans("Enabled");
} else {
@ -124,7 +120,7 @@ class mailing_thirdparties extends MailingTargets
$sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")";
$sql .= " AND cs.fk_soc = s.rowid";
$sql .= " AND c.rowid = cs.fk_categorie";
$sql .= " AND c.rowid='".$this->db->escape($_POST['filter'])."'";
$sql .= " AND c.rowid=".((int) GETPOST('filter', 'int'));
$sql .= $addFilter;
$sql .= " UNION ";
$sql .= "SELECT s.rowid as id, s.email as email, s.nom as name, null as fk_contact, null as firstname, c.label as label";
@ -134,7 +130,7 @@ class mailing_thirdparties extends MailingTargets
$sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")";
$sql .= " AND cs.fk_soc = s.rowid";
$sql .= " AND c.rowid = cs.fk_categorie";
$sql .= " AND c.rowid='".$this->db->escape($_POST['filter'])."'";
$sql .= " AND c.rowid=".((int) GETPOST('filter', 'int'));
$sql .= $addFilter;
}
$sql .= " ORDER BY email";

View File

@ -111,7 +111,8 @@ class modFacture extends DolibarrModules
$this->boxes = array(
0=>array('file'=>'box_factures_imp.php', 'enabledbydefaulton'=>'Home'),
1=>array('file'=>'box_factures.php', 'enabledbydefaulton'=>'Home'),
2=>array('file'=>'box_graph_invoices_permonth.php', 'enabledbydefaulton'=>'Home')
2=>array('file'=>'box_graph_invoices_permonth.php', 'enabledbydefaulton'=>'Home'),
3=>array('file'=>'box_customers_outstanding_bill_reached.php', 'enabledbydefaulton'=>'Home')
);
// Cronjobs

View File

@ -258,10 +258,10 @@ class modUser extends DolibarrModules
$keyforselect = 'user'; $keyforelement = 'user'; $keyforaliasextra = 'extra';
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
if (empty($conf->adherent->enabled))
{
unset($this->export_fields_array[$r]['u.fk_member']);
unset($this->export_entities_array[$r]['u.fk_member']);
}
{
unset($this->export_fields_array[$r]['u.fk_member']);
unset($this->export_entities_array[$r]['u.fk_member']);
}
$this->export_sql_start[$r] = 'SELECT DISTINCT ';
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'user as u';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user_extrafields as extra ON u.rowid = extra.fk_object';

View File

@ -155,7 +155,7 @@ if ($permission)
<?php
$tmpobject = $object;
if (($object->element == 'shipping' || $object->element == 'reception') && is_object($objectsrc)) $tmpobject = $objectsrc;
$formcompany->selectTypeContact($tmpobject, $preselectedtypeofcontact, 'type', 'external', 'position', 0, 'minwidth100imp');
$formcompany->selectTypeContact($tmpobject, $preselectedtypeofcontact, 'typecontact', 'external', 'position', 0, 'minwidth100imp');
?>
</div>
<div class="tagtd noborderbottom">&nbsp;</div>

View File

@ -9,10 +9,10 @@ if (empty($conf) || !is_object($conf))
exit;
}
if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey=$object->table_element;
if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey = $object->table_element;
// Loop to show all columns of extrafields from $obj, $extrafields and $db
if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ...
if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ...
{
if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label']) > 0) {
if (empty($extrafieldsobjectprefix)) $extrafieldsobjectprefix = 'ef.';

View File

@ -85,7 +85,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
if (!empty($extrafields->attributes[$object->table_element]['langfile'][$tmpkeyextra])) $langs->load($extrafields->attributes[$object->table_element]['langfile'][$tmpkeyextra]);
if ($action == 'edit_extras')
{
$value = (isset($_POST["options_".$tmpkeyextra]) ? $_POST["options_".$tmpkeyextra] : $object->array_options["options_".$tmpkeyextra]);
$value = (GETPOSTISSET("options_".$tmpkeyextra) ? GETPOST("options_".$tmpkeyextra) : $object->array_options["options_".$tmpkeyextra]);
} else {
$value = $object->array_options["options_".$tmpkeyextra];
//var_dump($tmpkeyextra.' - '.$value);
@ -172,7 +172,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
$datenotinstring = $db->jdate($datenotinstring);
}
//print 'x'.$object->array_options['options_' . $tmpkeyextra].'-'.$datenotinstring.' - '.dol_print_date($datenotinstring, 'dayhour');
$value = isset($_POST["options_".$tmpkeyextra]) ? dol_mktime($_POST["options_".$tmpkeyextra."hour"], $_POST["options_".$tmpkeyextra."min"], 0, $_POST["options_".$tmpkeyextra."month"], $_POST["options_".$tmpkeyextra."day"], $_POST["options_".$tmpkeyextra."year"]) : $datenotinstring;
$value = GETPOSTISSET("options_".$tmpkeyextra) ? dol_mktime(GETPOST("options_".$tmpkeyextra."hour", 'int'), GETPOST("options_".$tmpkeyextra."min", 'int'), 0, GETPOST("options_".$tmpkeyextra."month", 'int'), GETPOST("options_".$tmpkeyextra."day", 'int'), GETPOST("options_".$tmpkeyextra."year", 'int')) : $datenotinstring;
}
//TODO Improve element and rights detection

View File

@ -62,7 +62,7 @@ if ($absolute_discount > 0) {
$text .= ' ('.$addabsolutediscount.')';
}
print '<br>'.$text;
print '<div class="inline-block clearboth">'.$text.'</div>';
} else {
// Discount available of type fixed amount (not credit note)
$more = '('.$addabsolutediscount.')';
@ -85,7 +85,7 @@ if ($absolute_creditnote > 0) {
$text .= '('.$addabsolutediscount.')';
}
print '<br>'.$text;
print '<div class="inline-block clearboth">'.$text.'</div>';
} else { // We can add a credit note on a down payment or standard invoice or situation invoice
// There is credit notes discounts available
$more = $isInvoice && !$isNewObject ? ' ('.$viewabsolutediscount.')' : '';

View File

@ -324,17 +324,17 @@ if ($nolinesbefore) {
{
$coldisplay++;
?>
<td class="nobottom linecolresupplier"><input id="fourn_ref" name="fourn_ref" class="flat minwidth50 maxwidth150" value="<?php echo (isset($_POST["fourn_ref"]) ?GETPOST("fourn_ref", 'alpha', 2) : ''); ?>"></td>
<td class="nobottom linecolresupplier"><input id="fourn_ref" name="fourn_ref" class="flat minwidth50 maxwidth150" value="<?php echo (GETPOSTISSET("fourn_ref") ? GETPOST("fourn_ref", 'alpha', 2) : ''); ?>"></td>
<?php }
print '<td class="nobottom linecolvat right">';
$coldisplay++;
if ($seller->tva_assuj == "0") echo '<input type="hidden" name="tva_tx" id="tva_tx" value="0">'.vatrate(0, true);
else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"]) ?GETPOST("tva_tx", 'alpha', 2) : -1), $seller, $buyer, 0, 0, '', false, 1);
else echo $form->load_tva('tva_tx', (GETPOSTISSET("tva_tx") ? GETPOST("tva_tx", 'alpha', 2) : -1), $seller, $buyer, 0, 0, '', false, 1);
?>
</td>
<td class="nobottom linecoluht right"><?php $coldisplay++; ?>
<input type="text" size="5" name="price_ht" id="price_ht" class="flat right" value="<?php echo (isset($_POST["price_ht"]) ?GETPOST("price_ht", 'alpha', 2) : ''); ?>">
<input type="text" size="5" name="price_ht" id="price_ht" class="flat right" value="<?php echo (GETPOSTISSET("price_ht") ? GETPOST("price_ht", 'alpha', 2) : ''); ?>">
</td>
<?php
@ -342,7 +342,7 @@ if ($nolinesbefore) {
$coldisplay++;
?>
<td class="nobottom linecoluht_currency right">
<input type="text" size="5" name="multicurrency_price_ht" id="multicurrency_price_ht" class="flat right" value="<?php echo (isset($_POST["multicurrency_price_ht"]) ?GETPOST("multicurrency_price_ht", 'alpha', 2) : ''); ?>">
<input type="text" size="5" name="multicurrency_price_ht" id="multicurrency_price_ht" class="flat right" value="<?php echo (GETPOSTISSET("multicurrency_price_ht") ? GETPOST("multicurrency_price_ht", 'alpha', 2) : ''); ?>">
</td>
<?php
}
@ -350,13 +350,13 @@ if ($nolinesbefore) {
$coldisplay++;
?>
<td class="nobottom linecoluttc right">
<input type="text" size="5" name="price_ttc" id="price_ttc" class="flat" value="<?php echo (isset($_POST["price_ttc"]) ?GETPOST("price_ttc", 'alpha', 2) : ''); ?>">
<input type="text" size="5" name="price_ttc" id="price_ttc" class="flat" value="<?php echo (GETPOSTISSET("price_ttc") ? GETPOST("price_ttc", 'alpha', 2) : ''); ?>">
</td>
<?php
}
$coldisplay++;
?>
<td class="nobottom linecolqty right"><input type="text" size="2" name="qty" id="qty" class="flat right" value="<?php echo (isset($_POST["qty"]) ?GETPOST("qty", 'alpha', 2) : 1); ?>">
<td class="nobottom linecolqty right"><input type="text" size="2" name="qty" id="qty" class="flat right" value="<?php echo (GETPOSTISSET("qty") ? GETPOST("qty", 'alpha', 2) : 1); ?>">
</td>
<?php
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
@ -371,7 +371,7 @@ if ($nolinesbefore) {
}
$coldisplay++;
?>
<td class="nobottom nowrap linecoldiscount right"><input type="text" size="1" name="remise_percent" id="remise_percent" class="flat right" value="<?php echo (isset($_POST["remise_percent"]) ?GETPOST("remise_percent", 'alpha', 2) : $remise_percent); ?>"><span class="hideonsmartphone">%</span></td>
<td class="nobottom nowrap linecoldiscount right"><input type="text" size="1" name="remise_percent" id="remise_percent" class="flat right" value="<?php echo (GETPOSTISSET("remise_percent") ? GETPOST("remise_percent", 'alpha', 2) : $remise_percent); ?>"><span class="hideonsmartphone">%</span></td>
<?php
if ($this->situation_cycle_ref) {
$coldisplay++;
@ -389,17 +389,17 @@ if ($nolinesbefore) {
<select id="fournprice_predef" name="fournprice_predef" class="flat minwidth75imp" style="display: none;"></select>
<?php } ?>
<!-- For free product -->
<input type="text" id="buying_price" name="buying_price" class="flat maxwidth75 right" value="<?php echo (isset($_POST["buying_price"]) ?GETPOST("buying_price", 'alpha', 2) : ''); ?>">
<input type="text" id="buying_price" name="buying_price" class="flat maxwidth75 right" value="<?php echo (GETPOSTISSET("buying_price") ? GETPOST("buying_price", 'alpha', 2) : ''); ?>">
</td>
<?php
if (!empty($conf->global->DISPLAY_MARGIN_RATES))
{
echo '<td class="nobottom nowrap margininfos right"><input class="flat right" type="text" size="2" id="np_marginRate" name="np_marginRate" value="'.(isset($_POST["np_marginRate"]) ?GETPOST("np_marginRate", 'alpha', 2) : '').'"><span class="np_marginRate hideonsmartphone">%</span></td>';
echo '<td class="nobottom nowrap margininfos right"><input class="flat right" type="text" size="2" id="np_marginRate" name="np_marginRate" value="'.(GETPOSTISSET("np_marginRate") ? GETPOST("np_marginRate", 'alpha', 2) : '').'"><span class="np_marginRate hideonsmartphone">%</span></td>';
$coldisplay++;
}
if (!empty($conf->global->DISPLAY_MARK_RATES))
{
echo '<td class="nobottom nowrap margininfos right"><input class="flat right" type="text" size="2" id="np_markRate" name="np_markRate" value="'.(isset($_POST["np_markRate"]) ?GETPOST("np_markRate", 'alpha', 2) : '').'"><span class="np_markRate hideonsmartphone">%</span></td>';
echo '<td class="nobottom nowrap margininfos right"><input class="flat right" type="text" size="2" id="np_markRate" name="np_markRate" value="'.(GETPOSTISSET("np_markRate") ? GETPOST("np_markRate", 'alpha', 2) : '').'"><span class="np_markRate hideonsmartphone">%</span></td>';
$coldisplay++;
}
}
@ -419,7 +419,9 @@ if (is_object($objectline)) {
if ((!empty($conf->service->enabled) || ($object->element == 'contrat')) && $dateSelector && GETPOST('type') != '0') // We show date field if required
{
print '<tr id="trlinefordates" class="oddeven">'."\n";
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { print '<td></td>'; }
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
print '<td></td>';
}
print '<td colspan="'.($coldisplay - (empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? 0 : 1)).'">';
$date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear'));
$date_end = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), 0, GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));

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