Merge remote-tracking branch 'upstream/develop' into patch-13
This commit is contained in:
commit
914d2ae7f7
2
.github/workflows/exakat.yml
vendored
2
.github/workflows/exakat.yml
vendored
@ -13,5 +13,5 @@ jobs:
|
||||
- name: Exakat
|
||||
uses: docker://exakat/exakat-ga
|
||||
with:
|
||||
ignore_rules: 'Classes/UseInstanceof,Performances/PrePostIncrement,Functions/UndefinedFunctions,Functions/WrongNumberOfArguments,Functions/WrongTypeWithCall,Variables/UndefinedVariable,Classes/DontUnsetProperties,Classes/NonPpp,Classes/StaticMethodsCalledFromObject,Classes/UseClassOperator,Functions/UsesDefaultArguments,Php/NoClassInGlobal,Php/ShouldUseCoalesce,Php/WrongTypeForNativeFunction,Structures/MergeIfThen,Structures/ElseIfElseif,Structures/RepeatedPrint,Structures/SameConditions,Structures/SwitchWithoutDefault,Structures/ShouldMakeTernary,Structures/UselessParenthesis,Structures/UseConstant'
|
||||
ignore_rules: 'Classes/UseInstanceof,Performances/PrePostIncrement,Functions/UndefinedFunctions,Functions/WrongNumberOfArguments,Functions/WrongTypeWithCall,Variables/UndefinedVariable,Classes/DontUnsetProperties,Classes/NonPpp,Classes/StaticMethodsCalledFromObject,Classes/UseClassOperator,Functions/UsesDefaultArguments,Php/NoClassInGlobal,Php/ShouldUseCoalesce,Php/WrongTypeForNativeFunction,Structures/AddZero,Structures/DropElseAfterReturn,Structures/IfWithSameConditions,Structures/MergeIfThen,Structures/ElseIfElseif,Structures/ExitUsage,Structures/RepeatedPrint,Structures/RepeatedRegex,Structures/SameConditions,Structures/SwitchWithoutDefault,Structures/ShouldMakeTernary,Structures/UselessParenthesis,Structures/UseConstant'
|
||||
ignore_dirs: '/htdocs/includes,/build,/dev,/doc,/scripts,/test'
|
||||
@ -120,7 +120,7 @@ install:
|
||||
|
||||
- |
|
||||
echo "Adding path of binaries tools installed by composer to the PATH"
|
||||
export PATH="$TRAVIS_BUILD_DIR/htdocs/includes/bin:$TRAVIS_BUILD_DIR/vendor/bin:$TRAVIS_BUILD_DIR/htdocs/includes:$PATH"
|
||||
export PATH="$TRAVIS_BUILD_DIR/htdocs/includes/bin:$PATH"
|
||||
echo $PATH
|
||||
ls $TRAVIS_BUILD_DIR/vendor
|
||||
ls $TRAVIS_BUILD_DIR/htdocs/includes/bin
|
||||
|
||||
19
ChangeLog
19
ChangeLog
@ -18,6 +18,7 @@ NEW: Accountancy - change menu disposition
|
||||
NEW: Accountancy - on transfers, select the periodicity by default
|
||||
NEW: Accountancy - Add export for Gestinum (v3 & v5)
|
||||
NEW: new currency rate editor
|
||||
NEW: add a widget to show the customers with outstanding limits reached
|
||||
NEW: add 2 rules for emailcollector: Message send/not sent from Dolibarr
|
||||
NEW: add a counter of number of words for pages in website module
|
||||
NEW: add alert before changing thirdparty in TakePOS
|
||||
@ -167,7 +168,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 +180,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 +210,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 +244,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 +271,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
|
||||
|
||||
@ -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)
|
||||
|
||||
26
build/README
26
build/README
@ -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.
|
||||
|
||||
@ -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`;
|
||||
|
||||
@ -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');
|
||||
|
||||
@ -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>';
|
||||
|
||||
@ -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')
|
||||
{
|
||||
|
||||
@ -360,12 +360,12 @@ if ($action != 'export_csv')
|
||||
|
||||
if (!empty($show_subgroup))
|
||||
{
|
||||
print '<tr class="liste_total"><td class="right" colspan="2">'.$langs->trans("SubTotal").':</td><td class="nowrap right">'.price($sous_total_debit).'</td><td class="nowrap right">'.price($sous_total_credit).'</td><td class="nowrap right">'.price(price2num($sous_total_debit - $sous_total_credit)).'</td>';
|
||||
print '<tr class="liste_total"><td class="right" colspan="2">'.$langs->trans("SubTotal").':</td><td class="nowrap right">'.price($sous_total_debit).'</td><td class="nowrap right">'.price($sous_total_credit).'</td><td class="nowrap right">'.price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')).'</td>';
|
||||
print "<td></td>\n";
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '<tr class="liste_total"><td class="right" colspan="2">'.$langs->trans("AccountBalance").':</td><td class="nowrap right">'.price($total_debit).'</td><td class="nowrap right">'.price($total_credit).'</td><td class="nowrap right">'.price(price2num($total_debit - $total_credit)).'</td>';
|
||||
print '<tr class="liste_total"><td class="right" colspan="2">'.$langs->trans("AccountBalance").':</td><td class="nowrap right">'.price($total_debit).'</td><td class="nowrap right">'.price($total_credit).'</td><td class="nowrap right">'.price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')).'</td>';
|
||||
print "<td></td>\n";
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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 .= ' ';
|
||||
|
||||
$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);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
@ -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>';
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
@ -103,6 +103,7 @@ class Adherent extends CommonObject
|
||||
* @var int Thirdparty ID
|
||||
*/
|
||||
public $fk_soc;
|
||||
public $socid;
|
||||
|
||||
/**
|
||||
* @var string Address
|
||||
@ -1273,14 +1274,15 @@ class Adherent extends CommonObject
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as dep ON d.state_id = dep.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON d.rowid = u.fk_member";
|
||||
$sql .= " WHERE d.fk_adherent_type = t.rowid";
|
||||
if ($rowid)
|
||||
$sql .= " AND d.rowid=".$rowid;
|
||||
elseif ($ref || $fk_soc) {
|
||||
if ($rowid) {
|
||||
$sql .= " AND d.rowid=".((int) $rowid);
|
||||
} elseif ($ref || $fk_soc) {
|
||||
$sql .= " AND d.entity IN (".getEntity('adherent').")";
|
||||
if ($ref)
|
||||
if ($ref) {
|
||||
$sql .= " AND d.ref='".$this->db->escape($ref)."'";
|
||||
elseif ($fk_soc > 0)
|
||||
$sql .= " AND d.fk_soc=".$fk_soc;
|
||||
} elseif ($fk_soc > 0) {
|
||||
$sql .= " AND d.fk_soc=".((int) $fk_soc);
|
||||
}
|
||||
} elseif ($ref_ext) {
|
||||
$sql .= " AND d.ref_ext='".$this->db->escape($ref_ext)."'";
|
||||
}
|
||||
|
||||
@ -250,11 +250,16 @@ class Subscription extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
if (!is_numeric($this->amount)) {
|
||||
$this->error = 'BadValueForParameterAmount';
|
||||
return -1;
|
||||
}
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."subscription SET ";
|
||||
$sql .= " fk_type = ".$this->fk_type.",";
|
||||
$sql .= " fk_adherent = ".$this->fk_adherent.",";
|
||||
$sql .= " note=".($this->note ? "'".$this->db->escape($this->note)."'" : 'null').",";
|
||||
$sql .= " subscription = '".price2num($this->amount)."',";
|
||||
$sql .= " subscription = ".price2num($this->amount).",";
|
||||
$sql .= " dateadh='".$this->db->idate($this->dateh)."',";
|
||||
$sql .= " datef='".$this->db->idate($this->datef)."',";
|
||||
$sql .= " datec='".$this->db->idate($this->datec)."',";
|
||||
|
||||
@ -333,7 +333,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
$listofpaths = array();
|
||||
$listofnames = array();
|
||||
$listofmimes = array();
|
||||
if (is_object($object->invoice)) {
|
||||
if (is_object($object->invoice) && (!is_object($arraydefaultmessage) || intval($arraydefaultmessage->joinfiles))) {
|
||||
$invoicediroutput = $conf->facture->dir_output;
|
||||
$fileparams = dol_most_recent_file($invoicediroutput.'/'.$object->invoice->ref, preg_quote($object->invoice->ref, '/').'[^\-]+');
|
||||
$file = $fileparams['fullname'];
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -292,7 +292,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'order').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@ -391,7 +391,7 @@ foreach ($dirmodels as $reldir) {
|
||||
// Preview
|
||||
print '<td class="center">';
|
||||
if ($module->type == 'pdf') {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
} else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
|
||||
@ -232,8 +232,10 @@ foreach ($dirmodels as $reldir)
|
||||
// Show example of numbering model
|
||||
print '<td class="nowrap">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
|
||||
@ -412,7 +414,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td class="center">';
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
} else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -168,8 +168,10 @@ foreach ($dirmodels as $reldir)
|
||||
// Show example of numbering module
|
||||
print '<td class="nowrap">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
|
||||
|
||||
@ -297,8 +297,10 @@ foreach ($dirmodels as $reldir)
|
||||
// Show example of numbering model
|
||||
print '<td class="nowrap">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
|
||||
@ -482,7 +484,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td class="center">';
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
} else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
|
||||
@ -406,11 +406,12 @@ print '<input name="nom" id="name" class="minwidth200" value="'.dol_escape_htmlt
|
||||
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ADDRESS">'.$langs->trans("CompanyAddress").'</label></td><td>';
|
||||
print '<textarea name="MAIN_INFO_SOCIETE_ADDRESS" id="MAIN_INFO_SOCIETE_ADDRESS" class="quatrevingtpercent" rows="'.ROWS_3.'">'.($conf->global->MAIN_INFO_SOCIETE_ADDRESS ? $conf->global->MAIN_INFO_SOCIETE_ADDRESS : GETPOST("MAIN_INFO_SOCIETE_ADDRESS", 'nohtml')).'</textarea></td></tr>'."\n";
|
||||
|
||||
// Zip
|
||||
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ZIP">'.$langs->trans("CompanyZip").'</label></td><td>';
|
||||
print '<input class="minwidth100" name="MAIN_INFO_SOCIETE_ZIP" id="MAIN_INFO_SOCIETE_ZIP" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ZIP ? $conf->global->MAIN_INFO_SOCIETE_ZIP : GETPOST("MAIN_INFO_SOCIETE_ZIP", 'alpha')).'"></td></tr>'."\n";
|
||||
print '<input class="width100" name="MAIN_INFO_SOCIETE_ZIP" id="MAIN_INFO_SOCIETE_ZIP" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ZIP ? $conf->global->MAIN_INFO_SOCIETE_ZIP : GETPOST("MAIN_INFO_SOCIETE_ZIP", 'alpha')).'"></td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_TOWN">'.$langs->trans("CompanyTown").'</label></td><td>';
|
||||
print '<input name="MAIN_INFO_SOCIETE_TOWN" class="minwidth100" id="MAIN_INFO_SOCIETE_TOWN" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TOWN ? $conf->global->MAIN_INFO_SOCIETE_TOWN : GETPOST("MAIN_INFO_SOCIETE_TOWN", 'nohtml')).'"></td></tr>'."\n";
|
||||
print '<input name="MAIN_INFO_SOCIETE_TOWN" class="minwidth200" id="MAIN_INFO_SOCIETE_TOWN" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TOWN ? $conf->global->MAIN_INFO_SOCIETE_TOWN : GETPOST("MAIN_INFO_SOCIETE_TOWN", 'nohtml')).'"></td></tr>'."\n";
|
||||
|
||||
// Country
|
||||
print '<tr class="oddeven"><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
|
||||
|
||||
@ -229,7 +229,11 @@ foreach ($dirmodels as $reldir)
|
||||
// Show example of numbering model
|
||||
print '<td class="nowrap">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>'; } elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
}
|
||||
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
|
||||
@ -410,7 +414,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td class="center">';
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'contract').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
} else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -229,7 +229,8 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td class="nowrap">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
@ -397,7 +398,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td class="center">';
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'sending').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
} else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
|
||||
@ -682,7 +682,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
{
|
||||
// Discard check of mandatory fields for country for some tables
|
||||
if ($value == 'country_id' && in_array($tablib[$id], array('DictionaryPublicHolidays', 'DictionaryVAT', 'DictionaryRegion', 'DictionaryCompanyType', 'DictionaryHolidayTypes', 'DictionaryRevenueStamp', 'DictionaryAccountancysystem', 'DictionaryAccountancyCategory'))) continue; // For some pages, country is not mandatory
|
||||
if ($value == 'country' && in_array($tablib[$id], array('DictionaryPublicHolidays', 'DictionaryCanton', 'DictionaryCompanyType', 'DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory
|
||||
if ($value == 'country' && in_array($tablib[$id], array('DictionaryPublicHolidays', 'DictionaryCanton', 'DictionaryCompanyType', 'DictionaryHolidayTypes', 'DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory
|
||||
// Discard check of mandatory fiedls for other fields
|
||||
if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue;
|
||||
if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
|
||||
@ -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"]);
|
||||
}
|
||||
|
||||
@ -223,21 +223,6 @@ $help_url = "EN:Module_EMail_Collector|FR:Module_Collecteur_de_courrier_électro
|
||||
|
||||
llxHeader('', 'EmailCollector', $help_url);
|
||||
|
||||
// Example : Adding jquery code
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
function init_myfunc()
|
||||
{
|
||||
jQuery("#myid").removeAttr(\'disabled\');
|
||||
jQuery("#myid").attr(\'disabled\',\'disabled\');
|
||||
}
|
||||
init_myfunc();
|
||||
jQuery("#mybutton").click(function() {
|
||||
init_myfunc();
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
|
||||
// Part to create
|
||||
if ($action == 'create') {
|
||||
print load_fiche_titre($langs->trans("NewEmailCollector", $langs->transnoentitiesnoconv("EmailCollector")));
|
||||
@ -433,6 +418,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
if (!$connection)
|
||||
{
|
||||
$morehtml .= 'Failed to open IMAP connection '.$connectstringsource;
|
||||
$morehtml .= '<br>'.imap_last_error();
|
||||
//var_dump(imap_errors())
|
||||
} else {
|
||||
$morehtml .= imap_num_msg($connection);
|
||||
}
|
||||
|
||||
@ -234,7 +234,8 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td class="nowrap">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
@ -414,7 +415,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td class="center">';
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'sending').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
} else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
|
||||
@ -238,8 +238,10 @@ foreach ($dirmodels as $reldir)
|
||||
// Show example of numbering model
|
||||
print '<td class="nowrap">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
|
||||
@ -409,7 +411,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td class="center">';
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'intervention').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
} else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
|
||||
@ -313,8 +313,10 @@ foreach ($dirmodels as $reldir)
|
||||
// Show example of numbering module
|
||||
print '<td class="nowrap">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
|
||||
@ -547,7 +549,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td class="center">';
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
} else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
|
||||
@ -291,8 +291,10 @@ foreach ($dirmodels as $reldir)
|
||||
// Show example of numbering model
|
||||
print '<td class="nowrap">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
|
||||
@ -465,7 +467,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td class="center">';
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'intervention').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
} else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
|
||||
@ -229,7 +229,10 @@ foreach ($dirmodels as $reldir)
|
||||
// Show example of numbering model
|
||||
print '<td class="nowrap">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>'; } elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
|
||||
@ -423,7 +426,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td class="center">';
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'contract').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
} else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
|
||||
@ -241,8 +241,8 @@ print '<input type="hidden" name="action" value="update">';
|
||||
clearstatcache();
|
||||
|
||||
print '<br>';
|
||||
print '<table summary="edit" class="noborder centpercent editmode">';
|
||||
print '<tr class="liste_titre"><th>'.$langs->trans("Language").'</th><th></th>';
|
||||
print '<table summary="edit" class="noborder centpercent editmode tableforfield">';
|
||||
print '<tr class="liste_titre"><th>'.img_picto('', 'language').' '.$langs->trans("Language").'</th><th></th>';
|
||||
print '</tr>';
|
||||
|
||||
// Default language
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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];
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -233,8 +233,10 @@ foreach ($dirmodels as $reldir)
|
||||
// Show example of numbering model
|
||||
print '<td class="nowrap">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
|
||||
@ -413,7 +415,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td class="center">';
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
} else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
|
||||
@ -171,8 +171,10 @@ foreach ($dirmodels as $reldir)
|
||||
// Show example of numbering module
|
||||
print '<td class="nowrap">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
|
||||
|
||||
@ -340,7 +340,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td class="center">';
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -347,7 +347,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td class="center">';
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -256,8 +256,10 @@ foreach ($dirmodels as $reldir)
|
||||
// Show example of numbering module
|
||||
print '<td class="nowrap">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
|
||||
@ -442,7 +444,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td class="center">';
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
} else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
|
||||
@ -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>';
|
||||
|
||||
@ -420,7 +420,7 @@ if ($mode == 'template' && $user->admin) {
|
||||
print '<td></td>';
|
||||
} else {
|
||||
print '<td>'.$printer->listprinterstemplates[$line]['name'].'</td>';
|
||||
print '<td>'.nl2br(htmlentities($printer->listprinterstemplates[$line]['template'])).'</td>';
|
||||
print '<td>'.dol_htmlentitiesbr($printer->listprinterstemplates[$line]['template']).'</td>';
|
||||
// edit icon
|
||||
print '<td><a class="editfielda paddingleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=template&action=edittemplate&templateid='.$printer->listprinterstemplates[$line]['rowid'].'">';
|
||||
print img_picto($langs->trans("Edit"), 'edit');
|
||||
|
||||
@ -240,7 +240,8 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td class="nowrap">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
@ -423,7 +424,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td class="center">';
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'reception').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
} else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
|
||||
@ -256,7 +256,10 @@ foreach ($arrayhandler as $key => $module)
|
||||
// Show example of numbering module
|
||||
print '<td class="nowrap">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>'; } elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
|
||||
|
||||
@ -638,7 +638,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td class="center">';
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
} else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
|
||||
@ -251,7 +251,8 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td class="nowrap">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
@ -425,7 +426,7 @@ foreach ($dirmodels as $reldir)
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'order').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@ -274,7 +274,8 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td class="nowrap">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
@ -438,7 +439,7 @@ foreach ($dirmodels as $reldir)
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'order').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@ -256,8 +256,10 @@ foreach ($dirmodels as $reldir)
|
||||
// Show example of numbering module
|
||||
print '<td class="nowrap">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
|
||||
@ -410,7 +412,7 @@ foreach ($dirmodels as $reldir)
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'order').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@ -251,8 +251,10 @@ foreach ($dirmodels as $reldir)
|
||||
// Show example of numbering module
|
||||
print '<td class="nowrap">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||
else print $tmp;
|
||||
print '</td>'."\n";
|
||||
|
||||
@ -435,7 +437,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td class="center">';
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
} else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,31 +85,37 @@ if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE))
|
||||
if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_UPGRADE) print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, $conf->global->MAIN_VERSION_LAST_UPGRADE));
|
||||
}
|
||||
|
||||
$version = DOL_VERSION;
|
||||
if (preg_match('/[a-z]+/i', $version)) $version = 'develop'; // If version contains text, it is not an official tagged version, so we use the full change log.
|
||||
print ' <a href="https://raw.githubusercontent.com/Dolibarr/dolibarr/'.$version.'/ChangeLog" target="_blank">'.$langs->trans("SeeChangeLog").'</a>';
|
||||
|
||||
$newversion = '';
|
||||
if (function_exists('curl_init'))
|
||||
{
|
||||
$conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10;
|
||||
print ' - ';
|
||||
if ($action == 'getlastversion')
|
||||
{
|
||||
if ($sfurl)
|
||||
{
|
||||
while (!empty($sfurl->channel[0]->item[$i]->title) && $i < 10000)
|
||||
{
|
||||
$title = $sfurl->channel[0]->item[$i]->title;
|
||||
if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg))
|
||||
{
|
||||
$newversion = $reg[1];
|
||||
$newversionarray = explode('.', $newversion);
|
||||
$versionarray = explode('.', $version);
|
||||
//var_dump($newversionarray);var_dump($versionarray);
|
||||
if (versioncompare($newversionarray, $versionarray) > 0) $version = $newversion;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10;
|
||||
print ' - ';
|
||||
if ($action == 'getlastversion') {
|
||||
if ($sfurl) {
|
||||
$i = 0;
|
||||
while (!empty($sfurl->channel[0]->item[$i]->title) && $i < 10000) {
|
||||
$title = $sfurl->channel[0]->item[$i]->title;
|
||||
$reg = array();
|
||||
if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg)) {
|
||||
$newversion = $reg[1];
|
||||
$newversionarray = explode('.', $newversion);
|
||||
$versionarray = explode('.', $version);
|
||||
//var_dump($newversionarray);var_dump($versionarray);
|
||||
if (versioncompare($newversionarray, $versionarray) > 0) $version = $newversion;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
// Show version
|
||||
print $langs->trans("LastStableVersion").' : <b>'.(($version != '0.0') ? $version : $langs->trans("Unknown")).'</b>';
|
||||
} else {
|
||||
if ($version != '0.0') {
|
||||
print ' <a href="https://raw.githubusercontent.com/Dolibarr/dolibarr/'.$version.'/ChangeLog" target="_blank">'.$langs->trans("SeeChangeLog").'</a>';
|
||||
}
|
||||
} else {
|
||||
print $langs->trans("LastStableVersion").' : <b>'.$langs->trans("UpdateServerOffline").'</b>';
|
||||
}
|
||||
} else {
|
||||
@ -118,12 +124,11 @@ if (function_exists('curl_init'))
|
||||
}
|
||||
|
||||
// Now show link to the changelog
|
||||
print ' - ';
|
||||
//print ' - ';
|
||||
|
||||
$version = DOL_VERSION;
|
||||
if (preg_match('/[a-z]+/i', $version)) $version = 'develop'; // If version contains text, it is not an official tagged version, so we use the full change log.
|
||||
|
||||
print '<a href="https://raw.githubusercontent.com/Dolibarr/dolibarr/'.$version.'/ChangeLog" target="_blank">'.$langs->trans("SeeChangeLog").'</a>';
|
||||
print '</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("VersionLastUpgrade").' ('.$langs->trans("Database").')</td><td>'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("VersionLastInstall").'</td><td>'.$conf->global->MAIN_VERSION_LAST_INSTALL.'</td></tr>'."\n";
|
||||
|
||||
@ -28,9 +28,7 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("install");
|
||||
$langs->load("errors");
|
||||
$langs->loadLangs(array("admin", "install", "errors"));
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
@ -95,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>)';
|
||||
@ -126,7 +124,7 @@ print '</table>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
$activatedExtensions = array_map('strtolower', getActivatedExtensions());
|
||||
$activatedExtensions = array();
|
||||
$loadedExtensions = array_map('strtolower', get_loaded_extensions(false));
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
@ -165,7 +163,6 @@ $name = "GD";
|
||||
|
||||
print "<tr>";
|
||||
print "<td>".$name."</td>";
|
||||
//print getTableColumn($name, $activatedExtensions);
|
||||
print getTableColumn($name, $loadedExtensions);
|
||||
print getTableColumnFunction($functions);
|
||||
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
|
||||
@ -176,7 +173,6 @@ $name = "Curl";
|
||||
|
||||
print "<tr>";
|
||||
print "<td>".$name."</td>";
|
||||
//print getTableColumn($name, $activatedExtensions);
|
||||
print getTableColumn($name, $loadedExtensions);
|
||||
print getTableColumnFunction($functions);
|
||||
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
|
||||
@ -189,7 +185,6 @@ if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@loc
|
||||
|
||||
print "<tr>";
|
||||
print "<td>".$name."</td>";
|
||||
//print getTableColumn($name, $activatedExtensions);
|
||||
print getTableColumn($name, $loadedExtensions);
|
||||
print getTableColumnFunction($functions);
|
||||
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
|
||||
@ -201,7 +196,6 @@ $name = "xDebug";
|
||||
|
||||
print "<tr>";
|
||||
print "<td>".$name."</td>";
|
||||
//print getTableColumn($name, $activatedExtensions);
|
||||
print getTableColumn($name, $loadedExtensions);
|
||||
print getTableColumnFunction($functions);
|
||||
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
|
||||
@ -240,7 +234,7 @@ foreach ($phparray as $key => $value)
|
||||
print '</tr>';
|
||||
} else {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$keyparam.'</td>';
|
||||
print '<td class="wordbreak">'.$keyparam.'</td>';
|
||||
$i = 0;
|
||||
foreach ($keyvalue as $keyparam2 => $keyvalue2)
|
||||
{
|
||||
@ -264,85 +258,6 @@ foreach ($phparray as $key => $value)
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
/**
|
||||
* Return all list with all activated, but possible not loaded PHP extensions
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getActivatedExtensions()
|
||||
{
|
||||
$file = trim(getConfigFilePath());
|
||||
$handle = fopen($file, "r");
|
||||
$content = fread($handle, filesize($file));
|
||||
|
||||
fclose($handle);
|
||||
|
||||
$configLines = explode("\r", $content);
|
||||
|
||||
// For compatibility with LF (Line Feed)
|
||||
if (empty($configLines) || count($configLines) < 2) {
|
||||
$configLines = explode("\n", $content);
|
||||
}
|
||||
|
||||
$extensions = array();
|
||||
$lastLine = "";
|
||||
|
||||
foreach ($configLines as $line)
|
||||
{
|
||||
$line = trim($line);
|
||||
|
||||
// ignore comment lines
|
||||
if (substr($line, 0, 1) === ";" || empty($line))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// var_dump($line);
|
||||
|
||||
// extension
|
||||
if (substr($line, 0, 9) === "extension" && substr($line, 0, 10) !== "extension_")
|
||||
{
|
||||
$value = trim(end(explode("=", $line)));
|
||||
|
||||
$extensions[] = $value === "gd2" ? "gd" : $value;
|
||||
}
|
||||
|
||||
// zend_extension
|
||||
if (substr($line, 0, 14) === "zend_extension")
|
||||
{
|
||||
$extensions[] = str_replace("[", "", str_replace("]", "", $lastLine));
|
||||
}
|
||||
|
||||
$lastLine = $line;
|
||||
}
|
||||
|
||||
return array_unique($extensions);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the path to the current used php config file
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function getConfigFilePath()
|
||||
{
|
||||
$phparray = phpinfo_array();
|
||||
|
||||
foreach ($phparray as $value)
|
||||
{
|
||||
foreach ($value as $keyparam => $keyvalue)
|
||||
{
|
||||
if (strtolower($keyparam) !== "loaded configuration file")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
return $keyvalue;
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a table column with a indicator (okay or warning), based on the given name and list
|
||||
@ -411,7 +326,7 @@ function getTableColumnFunction(array $functions)
|
||||
* Return a result column with a translated result text
|
||||
*
|
||||
* @param string $name The name of the PHP extension
|
||||
* @param array $activated A list with all activated PHP extensions
|
||||
* @param array $activated A list with all activated PHP extensions. Deprecated.
|
||||
* @param array $loaded A list with all loaded PHP extensions
|
||||
* @param array $functions A list with all PHP functions to check
|
||||
*
|
||||
|
||||
@ -240,6 +240,7 @@ foreach ($dirmodels as $reldir) {
|
||||
print '<td class="nowrap">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
|
||||
@ -363,7 +363,7 @@ if ($mode == 'overwrite')
|
||||
|
||||
if ($mode == 'searchkey')
|
||||
{
|
||||
$langcode = GETPOST('langcode') ?GETPOST('langcode') : $langs->defaultlang;
|
||||
$langcode = GETPOSTISSET('langcode') ? GETPOST('langcode') : $langs->defaultlang;
|
||||
|
||||
$newlang = new Translate('', $conf);
|
||||
$newlang->setDefaultLang($langcode);
|
||||
@ -384,8 +384,7 @@ if ($mode == 'searchkey')
|
||||
if (empty($langcode) || $langcode == '-1') $nbempty++;
|
||||
if (empty($transkey)) $nbempty++;
|
||||
if (empty($transvalue)) $nbempty++;
|
||||
if ($action == 'search' && ($nbempty > 999)) // 999 to disable this
|
||||
{
|
||||
if ($action == 'search' && ($nbempty > 999)) { // 999 to disable this
|
||||
setEventMessages($langs->trans("WarningAtLeastKeyOrTranslationRequired"), null, 'warnings');
|
||||
} else {
|
||||
// Search into dir of modules (the $modulesdir is already a list that loop on $conf->file->dol_document_root)
|
||||
|
||||
@ -312,7 +312,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td class="center">';
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'contract').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
} else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
|
||||
@ -241,7 +241,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td class="center">';
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'contract').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
} else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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.');
|
||||
}
|
||||
|
||||
|
||||
@ -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.
|
||||
*
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -383,21 +383,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
|
||||
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
// Example : Adding jquery code
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
function init_myfunc()
|
||||
{
|
||||
jQuery("#myid").removeAttr(\'disabled\');
|
||||
jQuery("#myid").attr(\'disabled\',\'disabled\');
|
||||
}
|
||||
init_myfunc();
|
||||
jQuery("#mybutton").click(function() {
|
||||
init_myfunc();
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
|
||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||
|
||||
$param = '';
|
||||
@ -469,7 +454,7 @@ $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||
|
||||
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||
|
||||
|
||||
|
||||
@ -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') {
|
||||
|
||||
@ -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).")";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -145,7 +145,7 @@ print '</tr>';
|
||||
// Description
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td >';
|
||||
print '<td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('description', $object->description, '', 200, 'dolibarr_notes', '', false, true, $conf->fckeditor->enabled, ROWS_6, '90%');
|
||||
$doleditor->Create();
|
||||
@ -154,7 +154,7 @@ print '</td></tr>';
|
||||
// Color
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("Color").'</td>';
|
||||
print '<td >';
|
||||
print '<td>';
|
||||
print $formother->selectColor($object->color, 'color');
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -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>";
|
||||
|
||||
@ -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;
|
||||
@ -1104,7 +1104,7 @@ if ($action == 'create')
|
||||
// Categories
|
||||
print '<tr><td>'.$langs->trans("Categories").'</td><td>';
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1);
|
||||
print $form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, 'minwidth300 quatrevingtpercent', 0, 0);
|
||||
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, 'minwidth300 quatrevingtpercent widthcentpercentminusx', 0, 0);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
@ -1578,7 +1578,7 @@ if ($id > 0)
|
||||
foreach ($cats as $cat) {
|
||||
$arrayselected[] = $cat->id;
|
||||
}
|
||||
print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, '100%');
|
||||
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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);
|
||||
@ -1492,19 +1492,19 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
|
||||
if ($nonew <= 0)
|
||||
{
|
||||
print '<div class="tagtr"><div class="nowrap tagtd">';
|
||||
print '<div class="tagtr"><div class="nowrap tagtd"><div class="left inline-block">';
|
||||
print '<a class="dayevent-aday" style="color: #666" href="'.$urltoshow.'">';
|
||||
if ($showinfo) print dol_print_date($curtime, 'daytextshort');
|
||||
else print dol_print_date($curtime, '%d');
|
||||
print '</a>';
|
||||
print '</div><div class="nowrap tagtd right">';
|
||||
print '</div><div class="nowrap floatright inline-block marginrightonly">';
|
||||
if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create)
|
||||
{
|
||||
print '<a class="cursoradd" href="'.$urltocreate.'">'; // Explicit link, usefull for nojs interfaces
|
||||
print img_picto($langs->trans("NewAction"), 'edit_add.png');
|
||||
print '</a>';
|
||||
}
|
||||
print '</div></div>'."\n";
|
||||
print '</div></div></div>'."\n";
|
||||
}
|
||||
|
||||
if ($nonew < 0)
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -86,6 +86,15 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('thirdpartycomm', 'globalcard'));
|
||||
|
||||
// Security check
|
||||
$result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', 0);
|
||||
|
||||
if ($object->id > 0) {
|
||||
if (!($object->client > 0) || empty($user->rights->societe->lire)) {
|
||||
accessforbidden();
|
||||
}
|
||||
}
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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');
|
||||
@ -366,9 +366,6 @@ if (empty($reshook))
|
||||
$object->statut = Propal::STATUS_DRAFT;
|
||||
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
|
||||
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
|
||||
|
||||
// the create is done below and further more the existing create_from function is quite hilarating
|
||||
//$id = $object->create_from($user);
|
||||
} else {
|
||||
setEventMessages($langs->trans("ErrorFailedToCopyProposal", GETPOST('copie_propal')), null, 'errors');
|
||||
}
|
||||
@ -550,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)
|
||||
{
|
||||
@ -1347,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) {
|
||||
@ -2411,7 +2408,8 @@ if ($action == 'create')
|
||||
if ($action != 'editline')
|
||||
{
|
||||
// Validate
|
||||
if ($object->statut == Propal::STATUS_DRAFT && $object->total_ttc >= 0 && count($object->lines) > 0)
|
||||
if (($object->statut == Propal::STATUS_DRAFT && $object->total_ttc >= 0 && count($object->lines) > 0)
|
||||
|| ($object->statut == Propal::STATUS_DRAFT && !empty($conf->global->PROPAL_ENABLE_NEGATIVE) && count($object->lines) > 0))
|
||||
{
|
||||
if ($usercanvalidate)
|
||||
{
|
||||
|
||||
@ -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;
|
||||
@ -208,7 +208,6 @@ class Propal extends CommonObject
|
||||
public $demand_reason_id;
|
||||
public $demand_reason_code;
|
||||
|
||||
public $products = array();
|
||||
public $extraparams = array();
|
||||
|
||||
/**
|
||||
@ -355,15 +354,13 @@ class Propal extends CommonObject
|
||||
$this->socid = $socid;
|
||||
$this->id = $propalid;
|
||||
|
||||
$this->products = array();
|
||||
|
||||
$this->duree_validite = ((int) $conf->global->PROPALE_VALIDITY_DURATION);
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Add line into array products
|
||||
* Add line into array ->lines
|
||||
* $this->thirdparty should be loaded
|
||||
*
|
||||
* @param int $idproduct Product Id to add
|
||||
@ -372,7 +369,6 @@ class Propal extends CommonObject
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*
|
||||
* TODO Replace calls to this function by generation objet Ligne
|
||||
* inserted into table $this->products
|
||||
*/
|
||||
public function add_product($idproduct, $qty, $remise_percent = 0)
|
||||
{
|
||||
@ -1279,24 +1275,6 @@ class Propal extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Insert into DB a proposal object completely defined by its data members (ex, results from copy).
|
||||
*
|
||||
* @param User $user User that create
|
||||
* @return int Id of the new object if ok, <0 if ko
|
||||
* @see create()
|
||||
*/
|
||||
public function create_from($user)
|
||||
{
|
||||
// phpcs:enable
|
||||
// i love this function because $this->products is not used in create function...
|
||||
$this->products = $this->lines;
|
||||
|
||||
return $this->create($user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load an object from its id and create a new one in database
|
||||
*
|
||||
@ -1525,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;
|
||||
@ -2944,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;
|
||||
@ -2977,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;
|
||||
@ -2988,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++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -37,11 +37,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
$WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
|
||||
$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
|
||||
|
||||
$mode = GETPOST("mode") ?GETPOST("mode") : 'customer';
|
||||
$mode = GETPOSTISSET("mode") ? GETPOST("mode", 'aZ09') : 'customer';
|
||||
if ($mode == 'customer' && !$user->rights->propale->lire) accessforbidden();
|
||||
if ($mode == 'supplier' && !$user->rights->supplier_proposal->lire) accessforbidden();
|
||||
|
||||
$object_status = GETPOST('object_status');
|
||||
$object_status = GETPOST('object_status', 'intcomma');
|
||||
$typent_id = GETPOST('typent_id', 'int');
|
||||
$categ_id = GETPOST('categ_id', 'categ_id');
|
||||
|
||||
@ -55,7 +55,7 @@ if ($user->socid > 0)
|
||||
}
|
||||
|
||||
$nowyear = strftime("%Y", dol_now());
|
||||
$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
|
||||
$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear;
|
||||
//$startyear=$year-2;
|
||||
$startyear = $year - 1;
|
||||
$endyear = $year;
|
||||
|
||||
@ -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');
|
||||
@ -453,26 +453,14 @@ if (empty($reshook))
|
||||
if (!$error)
|
||||
{
|
||||
$object_id = $object->create($user);
|
||||
|
||||
// If some invoice's lines already known
|
||||
$NBLINES = 8;
|
||||
for ($i = 1; $i <= $NBLINES; $i++) {
|
||||
if ($_POST['idprod'.$i]) {
|
||||
$xid = 'idprod'.$i;
|
||||
$xqty = 'qty'.$i;
|
||||
$xremise = 'remise_percent'.$i;
|
||||
$object->add_product($_POST[$xid], $_POST[$xqty], $_POST[$xremise]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Insert default contacts if defined
|
||||
if ($object_id > 0)
|
||||
{
|
||||
if (GETPOST('contactid'))
|
||||
{
|
||||
$result = $object->add_contact(GETPOST('contactid'), 'CUSTOMER', 'external');
|
||||
if (GETPOST('contactid', 'int')) {
|
||||
$result = $object->add_contact(GETPOST('contactid', 'int'), 'CUSTOMER', 'external');
|
||||
if ($result < 0) {
|
||||
setEventMessages($langs->trans("ErrorFailedToAddContact"), null, 'errors');
|
||||
$error++;
|
||||
@ -931,6 +919,7 @@ if (empty($reshook))
|
||||
|
||||
if ($result > 0) {
|
||||
$ret = $object->fetch($object->id); // Reload to get new records
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||
// Define output language
|
||||
@ -1378,7 +1367,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) {
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -199,6 +199,7 @@ class Commande extends CommonOrder
|
||||
public $rang;
|
||||
public $special_code;
|
||||
public $source; // Order mode. How we received order (by phone, by email, ...)
|
||||
|
||||
public $extraparams = array();
|
||||
|
||||
public $linked_objects = array();
|
||||
@ -368,8 +369,6 @@ class Commande extends CommonOrder
|
||||
|
||||
$this->remise = 0;
|
||||
$this->remise_percent = 0;
|
||||
|
||||
$this->products = array();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1360,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;
|
||||
@ -1690,7 +1689,6 @@ class Commande extends CommonOrder
|
||||
* @return void
|
||||
*
|
||||
* TODO Remplacer les appels a cette fonction par generation objet Ligne
|
||||
* insere dans tableau $this->products
|
||||
*/
|
||||
public function add_product($idproduct, $qty, $remise_percent = 0.0, $date_start = '', $date_end = '')
|
||||
{
|
||||
@ -1752,15 +1750,13 @@ class Commande extends CommonOrder
|
||||
$prods_arbo = $prod->get_arbo_each_prod();
|
||||
if(count($prods_arbo) > 0)
|
||||
{
|
||||
foreach($prods_arbo as $key => $value)
|
||||
{
|
||||
// print "id : ".$value[1].' :qty: '.$value[0].'<br>';
|
||||
if(! in_array($value[1],$this->products))
|
||||
$this->add_product($value[1], $value[0]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
foreach($prods_arbo as $key => $value)
|
||||
{
|
||||
// print "id : ".$value[1].' :qty: '.$value[0].'<br>';
|
||||
if not in lines {
|
||||
$this->add_product($value[1], $value[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
**/
|
||||
}
|
||||
@ -1871,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;
|
||||
@ -3086,6 +3082,7 @@ class Commande extends CommonOrder
|
||||
|
||||
// Clean vat code
|
||||
$vat_src_code = '';
|
||||
$reg = array();
|
||||
if (preg_match('/\((.*)\)/', $txtva, $reg))
|
||||
{
|
||||
$vat_src_code = $reg[1];
|
||||
@ -3276,6 +3273,7 @@ class Commande extends CommonOrder
|
||||
$sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? $this->cond_reglement_id : "null").",";
|
||||
$sql .= " fk_mode_reglement=".(isset($this->mode_reglement_id) ? $this->mode_reglement_id : "null").",";
|
||||
$sql .= " fk_account=".($this->fk_account > 0 ? $this->fk_account : "null").",";
|
||||
$sql .= " fk_input_reason=".($this->demand_reason_id > 0 ? $this->demand_reason_id : "null").",";
|
||||
$sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").",";
|
||||
$sql .= " note_public=".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null").",";
|
||||
$sql .= " model_pdf=".(isset($this->modelpdf) ? "'".$this->db->escape($this->modelpdf)."'" : "null").",";
|
||||
@ -3361,7 +3359,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;
|
||||
@ -3394,7 +3392,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;
|
||||
@ -3405,7 +3403,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++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -109,7 +109,7 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$sortorder = GETPOST("sortorder", 'alpha');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1
|
||||
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
@ -142,38 +142,38 @@ if (empty($user->socid)) $fieldstosearchall["c.note_private"] = "NotePrivate";
|
||||
|
||||
$checkedtypetiers = 0;
|
||||
$arrayfields = array(
|
||||
'c.ref'=>array('label'=>"Ref", 'checked'=>1),
|
||||
'c.ref_client'=>array('label'=>"RefCustomerOrder", 'checked'=>1),
|
||||
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1)),
|
||||
'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1)),
|
||||
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1),
|
||||
's.town'=>array('label'=>"Town", 'checked'=>1),
|
||||
's.zip'=>array('label'=>"Zip", 'checked'=>1),
|
||||
'state.nom'=>array('label'=>"StateShort", 'checked'=>0),
|
||||
'country.code_iso'=>array('label'=>"Country", 'checked'=>0),
|
||||
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers),
|
||||
'c.date_commande'=>array('label'=>"OrderDateShort", 'checked'=>1),
|
||||
'c.date_delivery'=>array('label'=>"DateDeliveryPlanned", 'checked'=>1, 'enabled'=>empty($conf->global->ORDER_DISABLE_DELIVERY_DATE)),
|
||||
'c.total_ht'=>array('label'=>"AmountHT", 'checked'=>1),
|
||||
'c.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0),
|
||||
'c.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0),
|
||||
'c.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
|
||||
'c.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
|
||||
'c.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
|
||||
'c.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
|
||||
'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
|
||||
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>10),
|
||||
'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
|
||||
'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
|
||||
'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>500),
|
||||
'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES))),
|
||||
'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES))),
|
||||
'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
||||
'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'position'=>1000, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))),
|
||||
'shippable'=>array('label'=>"Shippable", 'checked'=>1, 'position'=>1000, 'enabled'=>(!empty($conf->expedition->enabled)))
|
||||
'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)
|
||||
);
|
||||
// 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);
|
||||
@ -831,27 +831,12 @@ if ($resql)
|
||||
print '<td class="liste_titre">';
|
||||
print '</td>';
|
||||
}
|
||||
// Status
|
||||
if (!empty($arrayfields['c.fk_statut']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre maxwidthonsmartphone right">';
|
||||
$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>';
|
||||
}
|
||||
// Shippable
|
||||
if (!empty($arrayfields['shippable']['checked']))
|
||||
{
|
||||
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 {
|
||||
@ -866,6 +851,21 @@ if ($resql)
|
||||
print $form->selectyesno('search_billed', $search_billed, 1, 0, 1, 1);
|
||||
print '</td>';
|
||||
}
|
||||
// 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>';
|
||||
}
|
||||
// Action column
|
||||
print '<td class="liste_titre" align="middle">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
@ -878,8 +878,8 @@ if ($resql)
|
||||
print '<tr class="liste_titre">';
|
||||
if (!empty($arrayfields['c.ref']['checked'])) print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], 'c.ref', '', $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['c.ref_client']['checked'])) print_liste_field_titre($arrayfields['c.ref_client']['label'], $_SERVER["PHP_SELF"], 'c.ref_client', '', $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['p.title']['checked'])) print_liste_field_titre($arrayfields['p.title']['label'], $_SERVER["PHP_SELF"], "p.title", "", $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['p.title']['checked'])) print_liste_field_titre($arrayfields['p.title']['label'], $_SERVER["PHP_SELF"], "p.title", "", $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], 's.nom', '', $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder);
|
||||
@ -909,9 +909,9 @@ if ($resql)
|
||||
if (!empty($arrayfields['c.date_cloture']['checked'])) print_liste_field_titre($arrayfields['c.date_cloture']['label'], $_SERVER["PHP_SELF"], "c.date_cloture", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
|
||||
if (!empty($arrayfields['c.note_public']['checked'])) print_liste_field_titre($arrayfields['c.note_public']['label'], $_SERVER["PHP_SELF"], "c.note_public", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (!empty($arrayfields['c.note_private']['checked'])) print_liste_field_titre($arrayfields['c.note_private']['label'], $_SERVER["PHP_SELF"], "c.note_private", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (!empty($arrayfields['c.fk_statut']['checked'])) print_liste_field_titre($arrayfields['c.fk_statut']['label'], $_SERVER["PHP_SELF"], "c.fk_statut", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (!empty($arrayfields['shippable']['checked'])) print_liste_field_titre($arrayfields['shippable']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (!empty($arrayfields['c.facture']['checked'])) print_liste_field_titre($arrayfields['c.facture']['label'], $_SERVER["PHP_SELF"], 'c.facture', '', $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (!empty($arrayfields['c.fk_statut']['checked'])) print_liste_field_titre($arrayfields['c.fk_statut']['label'], $_SERVER["PHP_SELF"], "c.fk_statut", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'maxwidthsearch center ');
|
||||
print '</tr>'."\n";
|
||||
|
||||
@ -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;
|
||||
@ -1218,13 +1218,6 @@ if ($resql)
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Status
|
||||
if (!empty($arrayfields['c.fk_statut']['checked']))
|
||||
{
|
||||
print '<td class="nowrap right">'.$generic_commande->LibStatut($obj->fk_statut, $obj->billed, 5, 1).'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Show shippable Icon (this creates subloops, so may be slow)
|
||||
if (!empty($arrayfields['shippable']['checked']))
|
||||
{
|
||||
@ -1242,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 {
|
||||
@ -1252,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 . ' ' . 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.' '.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) {
|
||||
@ -1288,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 . ' ' . 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.' '.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') . ' : ' . $text_stock_reel . '</span>';
|
||||
$text_warning .= '<span class="warning">'.$langs->trans('Available').' : '.$text_stock_reel.'</span>';
|
||||
}
|
||||
if ($generic_product->stock_reel < $generic_commande->lines[$lig]->qty) {
|
||||
$notshippable++;
|
||||
$text_info .= '<span class="warning">' . $langs->trans('Available') . ' : ' . $text_stock_reel . '</span>';
|
||||
$text_info .= '<span class="warning">'.$langs->trans('Available').' : '.$text_stock_reel.'</span>';
|
||||
} else {
|
||||
$text_info .= '<span class="ok">' . $langs->trans('Available') . ' : ' . $text_stock_reel . '</span>';
|
||||
$text_info .= '<span class="ok">'.$langs->trans('Available').' : '.$text_stock_reel.'</span>';
|
||||
}
|
||||
if (!empty($conf->fournisseur->enabled)) {
|
||||
$text_info .= ' ' . $langs->trans('SupplierOrder') . ' : ' . $stock_order_supplier . '<br>';
|
||||
$text_info .= ' '.$langs->trans('SupplierOrder').' : '.$stock_order_supplier.'<br>';
|
||||
} else {
|
||||
$text_info .= '<br>';
|
||||
}
|
||||
@ -1310,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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1321,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>';
|
||||
@ -1334,6 +1327,13 @@ if ($resql)
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// 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']++;
|
||||
}
|
||||
|
||||
// Action column
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
|
||||
@ -38,11 +38,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||
$WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
|
||||
$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
|
||||
|
||||
$mode = GETPOST("mode") ?GETPOST("mode") : 'customer';
|
||||
$mode = GETPOSTISSET("mode") ? GETPOST("mode", 'aZ09') : 'customer';
|
||||
if ($mode == 'customer' && !$user->rights->commande->lire) accessforbidden();
|
||||
if ($mode == 'supplier' && !$user->rights->fournisseur->commande->lire) accessforbidden();
|
||||
|
||||
$object_status = GETPOST('object_status');
|
||||
$object_status = GETPOST('object_status', 'intcomma');
|
||||
$typent_id = GETPOST('typent_id', 'int');
|
||||
$categ_id = GETPOST('categ_id', 'categ_id');
|
||||
|
||||
@ -302,11 +302,11 @@ if ($mode == 'customer')
|
||||
Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"),
|
||||
Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceled")
|
||||
);
|
||||
print $form->selectarray('object_status', $liststatus, GETPOST('object_status', 'int'), -4);
|
||||
print $form->selectarray('object_status', $liststatus, GETPOST('object_status', 'intcomma'), -4);
|
||||
}
|
||||
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
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
@ -408,7 +407,7 @@ if ($action == 'create')
|
||||
$arrayselected[] = $cat->id;
|
||||
}
|
||||
}
|
||||
print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, '100%');
|
||||
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -905,7 +904,7 @@ if ($action == 'create')
|
||||
$arrayselected[] = $cat->id;
|
||||
}
|
||||
}
|
||||
print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, '100%');
|
||||
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
|
||||
@ -771,11 +771,11 @@ print '<table class="notopnoleftnoright" width="100%">';
|
||||
print '<tr><td class="right">'.$morehtml.' ';
|
||||
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>';
|
||||
|
||||
|
||||
@ -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>';
|
||||
|
||||
@ -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)
|
||||
{
|
||||
@ -1233,7 +1243,7 @@ if ($action == 'create')
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Author").'</td><td>'.$author->getFullName($langs)."</td></tr>";
|
||||
|
||||
@ -1262,7 +1272,7 @@ if ($action == 'create')
|
||||
|
||||
// Payment term
|
||||
print '<tr><td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||
print $langs->trans('PaymentConditionsShort');
|
||||
print '</td>';
|
||||
if ($action != 'editconditions' && $user->rights->facture->creer)
|
||||
@ -1452,7 +1462,7 @@ if ($action == 'create')
|
||||
$title = $langs->trans("Recurrence");
|
||||
//print load_fiche_titre($title, '', 'calendar');
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
print '<tr><td colspan="2"><span class="fa fa-calendar"></span> '.$title.'</td></tr>';
|
||||
|
||||
@ -1573,7 +1583,7 @@ if ($action == 'create')
|
||||
}
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent">';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
// Nb of generation already done
|
||||
print '<tr><td style="width: 50%">'.$langs->trans("NbOfGenerationDone").'</td>';
|
||||
|
||||
@ -358,26 +358,23 @@ if (empty($reshook))
|
||||
if ($object->retained_warranty_date_limit < $object->date) $object->retained_warranty_date_limit = $object->date;
|
||||
$result = $object->update($user);
|
||||
if ($result < 0) dol_print_error($db, $object->error);
|
||||
} elseif ($action == 'setretainedwarranty' && $user->rights->facture->creer)
|
||||
{
|
||||
} elseif ($action == 'setretainedwarranty' && $user->rights->facture->creer) {
|
||||
$object->fetch($id);
|
||||
$result = $object->setRetainedWarranty(GETPOST('retained_warranty', 'float'));
|
||||
if ($result < 0)
|
||||
dol_print_error($db, $object->error);
|
||||
} elseif ($action == 'setretainedwarrantydatelimit' && $user->rights->facture->creer)
|
||||
{
|
||||
} elseif ($action == 'setretainedwarrantydatelimit' && $user->rights->facture->creer) {
|
||||
$object->fetch($id);
|
||||
$result = $object->setRetainedWarrantyDateLimit(GETPOST('retained_warranty_date_limit', 'float'));
|
||||
if ($result < 0)
|
||||
dol_print_error($db, $object->error);
|
||||
} // Multicurrency Code
|
||||
} // Multicurrency Code
|
||||
elseif ($action == 'setmulticurrencycode' && $usercancreate) {
|
||||
$result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha'));
|
||||
} // Multicurrency rate
|
||||
elseif ($action == 'setmulticurrencyrate' && $usercancreate) {
|
||||
$result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')), GETPOST('calculation_mode', 'int'));
|
||||
} elseif ($action == 'setinvoicedate' && $usercancreate)
|
||||
{
|
||||
} elseif ($action == 'setinvoicedate' && $usercancreate) {
|
||||
$object->fetch($id);
|
||||
$old_date_lim_reglement = $object->date_lim_reglement;
|
||||
$date = dol_mktime(12, 0, 0, $_POST['invoicedatemonth'], $_POST['invoicedateday'], $_POST['invoicedateyear']);
|
||||
@ -395,8 +392,7 @@ if (empty($reshook))
|
||||
if ($result < 0) {
|
||||
dol_print_error($db, $object->error);
|
||||
}
|
||||
} elseif ($action == 'setdate_pointoftax' && $usercancreate)
|
||||
{
|
||||
} elseif ($action == 'setdate_pointoftax' && $usercancreate) {
|
||||
$object->fetch($id);
|
||||
$date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']);
|
||||
$object->date_pointoftax = $date_pointoftax;
|
||||
@ -2668,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) {
|
||||
@ -3419,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
|
||||
@ -3649,8 +3646,7 @@ if ($action == 'create')
|
||||
}
|
||||
|
||||
print '</form>';
|
||||
} elseif ($id > 0 || !empty($ref))
|
||||
{
|
||||
} elseif ($id > 0 || !empty($ref)) {
|
||||
/*
|
||||
* Show object in view mode
|
||||
*/
|
||||
@ -3896,6 +3892,7 @@ if ($action == 'create')
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', "yes", 1);
|
||||
}
|
||||
if ($action == 'paid' && $resteapayer > 0) {
|
||||
$close = array();
|
||||
// Code
|
||||
$i = 0;
|
||||
$close[$i]['code'] = 'discount_vat'; // escompte
|
||||
@ -3922,7 +3919,7 @@ if ($action == 'create')
|
||||
$i++;
|
||||
// arrayreasons[code]=reason
|
||||
foreach ($close as $key => $val) {
|
||||
$arrayreasons[$close [$key]['code']] = $close[$key]['reason'];
|
||||
$arrayreasons[$close[$key]['code']] = $close[$key]['reason'];
|
||||
}
|
||||
|
||||
// Cree un tableau formulaire
|
||||
@ -4073,24 +4070,26 @@ if ($action == 'create')
|
||||
|
||||
// Type
|
||||
print '<tr><td class="titlefield fieldname_type">'.$langs->trans('Type').'</td><td class="valuefield fieldname_type">';
|
||||
print '<span class="badgeneutral">';
|
||||
print $object->getLibType();
|
||||
print '</span>';
|
||||
if ($object->module_source) {
|
||||
print ' <span class="opacitymediumbycolor">('.$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);
|
||||
$facreplaced->fetch($object->fk_facture_source);
|
||||
print ' <span class="opacitymediumbycolor">('.$langs->transnoentities("ReplaceInvoice", $facreplaced->getNomUrl(1)).')</span>';
|
||||
print ' <span class="opacitymediumbycolor paddingleft">('.$langs->transnoentities("ReplaceInvoice", $facreplaced->getNomUrl(1)).')</span>';
|
||||
}
|
||||
if ($object->type == Facture::TYPE_CREDIT_NOTE && !empty($object->fk_facture_source)) {
|
||||
$facusing = new Facture($db);
|
||||
$facusing->fetch($object->fk_facture_source);
|
||||
print ' <span class="opacitymediumbycolor">('.$langs->transnoentities("CorrectInvoice", $facusing->getNomUrl(1)).')</span>';
|
||||
print ' <span class="opacitymediumbycolor paddingleft">('.$langs->transnoentities("CorrectInvoice", $facusing->getNomUrl(1)).')</span>';
|
||||
}
|
||||
|
||||
$facidavoir = $object->getListIdAvoirFromInvoice();
|
||||
if (count($facidavoir) > 0) {
|
||||
print ' <span class="opacitymediumbycolor">('.$langs->transnoentities("InvoiceHasAvoir");
|
||||
print ' <span class="opacitymediumbycolor paddingleft">('.$langs->transnoentities("InvoiceHasAvoir");
|
||||
$i = 0;
|
||||
foreach ($facidavoir as $id) {
|
||||
if ($i == 0)
|
||||
@ -4105,14 +4104,16 @@ if ($action == 'create')
|
||||
if ($objectidnext > 0) {
|
||||
$facthatreplace = new Facture($db);
|
||||
$facthatreplace->fetch($objectidnext);
|
||||
print ' <span class="opacitymediumbycolor">('.$langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)).')</span>';
|
||||
print ' <span class="opacitymediumbycolor paddingleft">('.$langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)).')</span>';
|
||||
}
|
||||
|
||||
if ($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) {
|
||||
$discount = new DiscountAbsolute($db);
|
||||
$result = $discount->fetch(0, $object->id);
|
||||
if ($result > 0) {
|
||||
print '. <span class="opacitymediumbycolor">'.$langs->trans("CreditNoteConvertedIntoDiscount", $object->getLibType(1), $discount->getNomUrl(1, 'discount')).'</span><br>';
|
||||
print ' <span class="opacitymediumbycolor paddingleft">';
|
||||
print $langs->transnoentities("CreditNoteConvertedIntoDiscount", $object->getLibType(1), $discount->getNomUrl(1, 'discount'));
|
||||
print '</span><br>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -4121,10 +4122,9 @@ if ($action == 'create')
|
||||
$tmptemplate = new FactureRec($db);
|
||||
$result = $tmptemplate->fetch($object->fk_fac_rec_source);
|
||||
if ($result > 0) {
|
||||
print '. <span class="opacitymediumbycolor">'.$langs->trans(
|
||||
"GeneratedFromTemplate",
|
||||
'<a href="'.DOL_MAIN_URL_ROOT.'/compta/facture/card-rec.php?facid='.$tmptemplate->id.'">'.$tmptemplate->ref.'</a>'
|
||||
).'</span>';
|
||||
print ' <span class="opacitymediumbycolor paddingleft">';
|
||||
print $langs->transnoentities("GeneratedFromTemplate", '<a href="'.DOL_MAIN_URL_ROOT.'/compta/facture/card-rec.php?facid='.$tmptemplate->id.'">'.dol_escape_htmltag($tmptemplate->ref).'</a>');
|
||||
print '</span>';
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
@ -4132,13 +4132,11 @@ if ($action == 'create')
|
||||
// Relative and absolute discounts
|
||||
print '<!-- Discounts -->'."\n";
|
||||
print '<tr><td>'.$langs->trans('Discounts');
|
||||
|
||||
print '</td><td>';
|
||||
$thirdparty = $soc;
|
||||
$discount_type = 0;
|
||||
$backtopage = urlencode($_SERVER["PHP_SELF"].'?facid='.$object->id);
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
// Date invoice
|
||||
@ -4154,7 +4152,7 @@ if ($action == 'create')
|
||||
if ($action == 'editinvoicedate') {
|
||||
$form->form_date($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->date, 'invoicedate');
|
||||
} else {
|
||||
print dol_print_date($object->date, 'day');
|
||||
print '<span class="valuedate">'.dol_print_date($object->date, 'day').'</span>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
@ -4173,7 +4171,7 @@ if ($action == 'create')
|
||||
if ($action == 'editdate_pointoftax') {
|
||||
$form->form_date($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->date_pointoftax, 'date_pointoftax');
|
||||
} else {
|
||||
print dol_print_date($object->date_pointoftax, 'day');
|
||||
print '<span class="valuedate">'.dol_print_date($object->date_pointoftax, 'day').'</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -4213,7 +4211,7 @@ if ($action == 'create')
|
||||
if ($action == 'editpaymentterm') {
|
||||
$form->form_date($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->date_lim_reglement, 'paymentterm');
|
||||
} else {
|
||||
print dol_print_date($object->date_lim_reglement, 'day');
|
||||
print '<span class="valuedate">'.dol_print_date($object->date_lim_reglement, 'day').'</span>';
|
||||
if ($object->hasDelay()) {
|
||||
print img_warning($langs->trans('Late'));
|
||||
}
|
||||
@ -4788,10 +4786,13 @@ if ($action == 'create')
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE) {
|
||||
// Total already paid
|
||||
print '<tr><td colspan="'.$nbcols.'" class="right">';
|
||||
if ($object->type != Facture::TYPE_DEPOSIT)
|
||||
print '<span class="opacitymedium">';
|
||||
if ($object->type != Facture::TYPE_DEPOSIT) {
|
||||
print $langs->trans('AlreadyPaidNoCreditNotesNoDeposits');
|
||||
else print $langs->trans('AlreadyPaid');
|
||||
print ' :</td><td class="right'.(($totalpaye > 0) ? ' amountalreadypaid' : '').'">'.price($totalpaye).'</td><td> </td></tr>';
|
||||
} else {
|
||||
print $langs->trans('AlreadyPaid');
|
||||
}
|
||||
print '</span></td><td class="right'.(($totalpaye > 0) ? ' amountalreadypaid' : '').'">'.price($totalpaye).'</td><td> </td></tr>';
|
||||
|
||||
$resteapayeraffiche = $resteapayer;
|
||||
$cssforamountpaymentcomplete = 'amountpaymentcomplete';
|
||||
@ -4812,12 +4813,14 @@ if ($action == 'create')
|
||||
$obj = $db->fetch_object($resql);
|
||||
$invoice->fetch($obj->fk_facture_source);
|
||||
print '<tr><td colspan="'.$nbcols.'" class="right">';
|
||||
print '<span class="opacitymedium">';
|
||||
if ($invoice->type == Facture::TYPE_CREDIT_NOTE)
|
||||
print $langs->trans("CreditNote").' ';
|
||||
if ($invoice->type == Facture::TYPE_DEPOSIT)
|
||||
print $langs->trans("Deposit").' ';
|
||||
print $invoice->getNomUrl(0);
|
||||
print ' :</td>';
|
||||
print '</span>';
|
||||
print '</td>';
|
||||
print '<td class="right">'.price($obj->amount_ttc).'</td>';
|
||||
print '<td class="right">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=unlinkdiscount&discountid='.$obj->rowid.'">'.img_delete().'</a>';
|
||||
@ -4835,7 +4838,9 @@ if ($action == 'create')
|
||||
// Paye partiellement 'escompte'
|
||||
if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'discount_vat') {
|
||||
print '<tr><td colspan="'.$nbcols.'" class="nowrap right">';
|
||||
print $form->textwithpicto($langs->trans("Discount").':', $langs->trans("HelpEscompte"), - 1);
|
||||
print '<span class="opacitymedium">';
|
||||
print $form->textwithpicto($langs->trans("Discount"), $langs->trans("HelpEscompte"), - 1);
|
||||
print '</span>';
|
||||
print '</td><td class="right">'.price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye, 'MT')).'</td><td> </td></tr>';
|
||||
$resteapayeraffiche = 0;
|
||||
$cssforamountpaymentcomplete = 'amountpaymentneutral';
|
||||
@ -4843,7 +4848,9 @@ if ($action == 'create')
|
||||
// Paye partiellement ou Abandon 'badcustomer'
|
||||
if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'badcustomer') {
|
||||
print '<tr><td colspan="'.$nbcols.'" class="nowrap right">';
|
||||
print $form->textwithpicto($langs->trans("Abandoned").':', $langs->trans("HelpAbandonBadCustomer"), - 1);
|
||||
print '<span class="opacitymedium">';
|
||||
print $form->textwithpicto($langs->trans("Abandoned"), $langs->trans("HelpAbandonBadCustomer"), - 1);
|
||||
print '</span>';
|
||||
print '</td><td class="right">'.price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye, 'MT')).'</td><td> </td></tr>';
|
||||
// $resteapayeraffiche=0;
|
||||
$cssforamountpaymentcomplete = 'amountpaymentneutral';
|
||||
@ -4851,7 +4858,9 @@ if ($action == 'create')
|
||||
// Paye partiellement ou Abandon 'product_returned'
|
||||
if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'product_returned') {
|
||||
print '<tr><td colspan="'.$nbcols.'" class="nowrap right">';
|
||||
print $form->textwithpicto($langs->trans("ProductReturned").':', $langs->trans("HelpAbandonProductReturned"), - 1);
|
||||
print '<span class="opacitymedium">';
|
||||
print $form->textwithpicto($langs->trans("ProductReturned"), $langs->trans("HelpAbandonProductReturned"), - 1);
|
||||
print '</span>';
|
||||
print '</td><td class="right">'.price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye, 'MT')).'</td><td> </td></tr>';
|
||||
$resteapayeraffiche = 0;
|
||||
$cssforamountpaymentcomplete = 'amountpaymentneutral';
|
||||
@ -4862,20 +4871,27 @@ if ($action == 'create')
|
||||
$text = $langs->trans("HelpAbandonOther");
|
||||
if ($object->close_note)
|
||||
$text .= '<br><br><b>'.$langs->trans("Reason").'</b>:'.$object->close_note;
|
||||
print $form->textwithpicto($langs->trans("Abandoned").':', $text, - 1);
|
||||
print '<span class="opacitymedium">';
|
||||
print $form->textwithpicto($langs->trans("Abandoned"), $text, - 1);
|
||||
print '</span>';
|
||||
print '</td><td class="right">'.price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye, 'MT')).'</td><td> </td></tr>';
|
||||
$resteapayeraffiche = 0;
|
||||
$cssforamountpaymentcomplete = 'amountpaymentneutral';
|
||||
}
|
||||
|
||||
// Billed
|
||||
print '<tr><td colspan="'.$nbcols.'" class="right">'.$langs->trans("Billed").' :</td><td class="right">'.price($object->total_ttc).'</td><td> </td></tr>';
|
||||
print '<tr><td colspan="'.$nbcols.'" class="right">';
|
||||
print '<span class="opacitymedium">';
|
||||
print $langs->trans("Billed");
|
||||
print '</td><td class="right">'.price($object->total_ttc).'</td><td> </td></tr>';
|
||||
// Remainder to pay
|
||||
print '<tr><td colspan="'.$nbcols.'" class="right">';
|
||||
print '<span class="opacitymedium">';
|
||||
print $langs->trans('RemainderToPay');
|
||||
if ($resteapayeraffiche < 0)
|
||||
print ' ('.$langs->trans('ExcessReceived').')';
|
||||
print ' :</td>';
|
||||
print '</span>';
|
||||
print '</td>';
|
||||
print '<td class="right'.($resteapayeraffiche ? ' amountremaintopay' : (' '.$cssforamountpaymentcomplete)).'">'.price($resteapayeraffiche).'</td>';
|
||||
print '<td class="nowrap"> </td></tr>';
|
||||
|
||||
|
||||
@ -74,7 +74,7 @@ class Facture extends CommonInvoice
|
||||
public $fk_element = 'fk_facture';
|
||||
|
||||
/**
|
||||
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||
* @var string String with name of icon for myobject.
|
||||
*/
|
||||
public $picto = 'bill';
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -176,11 +176,6 @@ class Facture extends CommonInvoice
|
||||
*/
|
||||
public $fk_bank;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
public $products = array();
|
||||
|
||||
/**
|
||||
* @var FactureLigne[]
|
||||
*/
|
||||
@ -1077,7 +1072,6 @@ class Facture extends CommonInvoice
|
||||
$facture->origin_id = $this->origin_id;
|
||||
|
||||
$facture->lines = $this->lines; // Array of lines of invoice
|
||||
$facture->products = $this->lines; // Tant que products encore utilise
|
||||
$facture->situation_counter = $this->situation_counter;
|
||||
$facture->situation_cycle_ref = $this->situation_cycle_ref;
|
||||
$facture->situation_final = $this->situation_final;
|
||||
@ -1179,7 +1173,6 @@ class Facture extends CommonInvoice
|
||||
$object->ref_client = '';
|
||||
$object->close_code = '';
|
||||
$object->close_note = '';
|
||||
$object->products = $object->lines; // For backward compatibility
|
||||
if ($conf->global->MAIN_DONT_KEEP_NOTE_ON_CLONING == 1) {
|
||||
$object->note_private = '';
|
||||
$object->note_public = '';
|
||||
@ -1191,7 +1184,6 @@ class Facture extends CommonInvoice
|
||||
if (($object->lines[$i]->info_bits & 0x02) == 0x02) // We do not clone line of discounts
|
||||
{
|
||||
unset($object->lines[$i]);
|
||||
unset($object->products[$i]); // Tant que products encore utilise
|
||||
}
|
||||
// Bloc to update dates of service (month by month only if previously filled at 1d near start or end of month)
|
||||
// If it's a service with start and end dates
|
||||
@ -1339,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;
|
||||
@ -1432,11 +1424,11 @@ class Facture extends CommonInvoice
|
||||
$label = '';
|
||||
|
||||
if ($user->rights->facture->lire) {
|
||||
$label = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("Invoice").'</u>';
|
||||
if ($this->type == self::TYPE_REPLACEMENT) $label = '<u class="paddingrightonly">'.$langs->transnoentitiesnoconv("ReplacementInvoice").'</u>';
|
||||
if ($this->type == self::TYPE_CREDIT_NOTE) $label = '<u class="paddingrightonly">'.$langs->transnoentitiesnoconv("CreditNote").'</u>';
|
||||
if ($this->type == self::TYPE_DEPOSIT) $label = '<u class="paddingrightonly">'.$langs->transnoentitiesnoconv("Deposit").'</u>';
|
||||
if ($this->type == self::TYPE_SITUATION) $label = '<u class="paddingrightonly">'.$langs->transnoentitiesnoconv("InvoiceSituation").'</u>';
|
||||
$label = img_picto('', $picto).' <u class="paddingrightonly">'.$langs->trans("Invoice").'</u>';
|
||||
if ($this->type == self::TYPE_REPLACEMENT) $label = img_picto('', $picto).' <u class="paddingrightonly">'.$langs->transnoentitiesnoconv("ReplacementInvoice").'</u>';
|
||||
if ($this->type == self::TYPE_CREDIT_NOTE) $label = img_picto('', $picto).' <u class="paddingrightonly">'.$langs->transnoentitiesnoconv("CreditNote").'</u>';
|
||||
if ($this->type == self::TYPE_DEPOSIT) $label = img_picto('', $picto).' <u class="paddingrightonly">'.$langs->transnoentitiesnoconv("Deposit").'</u>';
|
||||
if ($this->type == self::TYPE_SITUATION) $label = img_picto('', $picto).' <u class="paddingrightonly">'.$langs->transnoentitiesnoconv("InvoiceSituation").'</u>';
|
||||
if (isset($this->statut) && isset($this->alreadypaid)) {
|
||||
$label .= ' '.$this->getLibStatut(5, $this->alreadypaid);
|
||||
}
|
||||
@ -3295,6 +3287,7 @@ class Facture extends CommonInvoice
|
||||
$localtaxes_type = getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc);
|
||||
|
||||
// Clean vat code
|
||||
$reg = array();
|
||||
$vat_src_code = '';
|
||||
if (preg_match('/\((.*)\)/', $txtva, $reg))
|
||||
{
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -192,10 +192,10 @@ function getPieChart($socid = 0)
|
||||
{
|
||||
$dolgraph = new DolGraph();
|
||||
$dolgraph->SetData($dataseries);
|
||||
$dolgraph->setShowLegend(1);
|
||||
$dolgraph->setShowLegend(2);
|
||||
$dolgraph->setShowPercent(1);
|
||||
$dolgraph->SetType(['pie']);
|
||||
$dolgraph->setWidth('100%');
|
||||
$dolgraph->setHeight('200');
|
||||
$dolgraph->draw('idgraphthirdparties');
|
||||
|
||||
$result .= '<tr>';
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user