Merge HEAD, branch 'develop' of github.com:Dolibarr/dolibarr into develop
This commit is contained in:
commit
7c08e3330c
16
ChangeLog
16
ChangeLog
@ -67,7 +67,6 @@ NEW: add search param for close date on order list
|
|||||||
NEW: add show preview for mail attachement on form mail
|
NEW: add show preview for mail attachement on form mail
|
||||||
NEW: add State/Province origin for products
|
NEW: add State/Province origin for products
|
||||||
NEW: add the workflow interaction close intervention on closing ticket
|
NEW: add the workflow interaction close intervention on closing ticket
|
||||||
NEW: add third order printer to TakePOS
|
|
||||||
NEW: add tracking number in list and search_all items
|
NEW: add tracking number in list and search_all items
|
||||||
NEW: add vcard for adherent and user
|
NEW: add vcard for adherent and user
|
||||||
NEW: add week number for month view in agenda
|
NEW: add week number for month view in agenda
|
||||||
@ -88,16 +87,14 @@ NEW: can edit the list of sending email profiles
|
|||||||
NEW: can enable/disable users in bulk actions
|
NEW: can enable/disable users in bulk actions
|
||||||
NEW: can filter on accounting system ref in export of chart of account
|
NEW: can filter on accounting system ref in export of chart of account
|
||||||
NEW: can filter on container type, language and tags in the list of web pages
|
NEW: can filter on container type, language and tags in the list of web pages
|
||||||
NEW: can hide eatby, sellby dates with option PRODUCT_DISABLE_SELLBY and PRODUCT_DISABLE_EATBY
|
NEW: can hide eatby, sellby dates with option PRODUCT_DISABLE_EATBY and PRODUCT_DISABLE_SELLBY
|
||||||
NEW: can import proposals, sales orders, supplier invoices
|
NEW: can import proposals, sales orders, supplier invoices
|
||||||
NEW: can set a dedicated SMTP config for sending email from public ticket interface
|
NEW: can set a dedicated SMTP config for sending email from public ticket interface
|
||||||
NEW: can set tags/categories to website pages
|
NEW: can set tags/categories to website pages
|
||||||
NEW: can set type of price without tax per default for new sale price creation
|
NEW: can set type of price without tax per default for new sale price creation
|
||||||
NEW: can use desired stock of a given warehouse for replenishment
|
NEW: can use desired stock of a given warehouse for replenishment
|
||||||
NEW: change thirdparty with barcode scan in TakePOS
|
|
||||||
NEW: common behavior for monthly leave list view
|
NEW: common behavior for monthly leave list view
|
||||||
NEW: convert all subscription in datetime
|
NEW: convert all subscription in datetime
|
||||||
NEW: can create a thirdparty customer from TakePOS
|
|
||||||
NEW: date shipment from order accepts hours
|
NEW: date shipment from order accepts hours
|
||||||
NEW: price level compatibility for variant
|
NEW: price level compatibility for variant
|
||||||
NEW: delayed payment in TakePOS
|
NEW: delayed payment in TakePOS
|
||||||
@ -159,6 +156,9 @@ NEW: show tags and status in search list of website pages
|
|||||||
NEW: show user on external calender events (when found)
|
NEW: show user on external calender events (when found)
|
||||||
NEW: subject title with company name instead of application title in ticket message
|
NEW: subject title with company name instead of application title in ticket message
|
||||||
NEW: Support for Samba4 AD
|
NEW: Support for Samba4 AD
|
||||||
|
NEW: TakePOS add third order printer
|
||||||
|
NEW: TakePOS can change thirdparty with barcode scan
|
||||||
|
NEW: TakePOS can create a thirdparty customer from TakePOS frontend
|
||||||
NEW: TakePOS connector compatibility with RECEIPT PRINTERS module
|
NEW: TakePOS connector compatibility with RECEIPT PRINTERS module
|
||||||
NEW: TakePOS Gift Receipt
|
NEW: TakePOS Gift Receipt
|
||||||
NEW: TakePOS Multicurrency compatibility
|
NEW: TakePOS Multicurrency compatibility
|
||||||
@ -185,7 +185,7 @@ NEW: add substitution key __MEMBER_TYPE__
|
|||||||
NEW: add substitution key __TYPE__
|
NEW: add substitution key __TYPE__
|
||||||
NEW: add function dolButtonToOpenUrlInDialogPopup() to be able to open page into a popup
|
NEW: add function dolButtonToOpenUrlInDialogPopup() to be able to open page into a popup
|
||||||
NEW: show line number on intervention card (via MAIN_VIEW_LINE_NUMBER)
|
NEW: show line number on intervention card (via MAIN_VIEW_LINE_NUMBER)
|
||||||
NEW: Add some fields to link website page to an other object
|
NEW: add some fields to link website page to an other object
|
||||||
NEW: fill ECM src object fields in dol_add_file_process
|
NEW: fill ECM src object fields in dol_add_file_process
|
||||||
NEW: conf to allow to show the full tree in warehouse popup
|
NEW: conf to allow to show the full tree in warehouse popup
|
||||||
NEW: can use parameter ?THEME_DARKMODEENABLED=2 for a preview of theme in dark mode
|
NEW: can use parameter ?THEME_DARKMODEENABLED=2 for a preview of theme in dark mode
|
||||||
@ -201,7 +201,7 @@ NEW: standardizes API thirdparties by email like other object
|
|||||||
NEW: Thirdparty REST API: endpoint to set price level
|
NEW: Thirdparty REST API: endpoint to set price level
|
||||||
NEW: use new category API for project list view
|
NEW: use new category API for project list view
|
||||||
NEW: Triggers Attributes and Attributes values
|
NEW: Triggers Attributes and Attributes values
|
||||||
NEW: added incoterms data into the substitution array
|
NEW: add incoterms data into the substitution array
|
||||||
NEW: add send context for ticket
|
NEW: add send context for ticket
|
||||||
NEW: add a message in error_log after detection of SQL or script injection
|
NEW: add a message in error_log after detection of SQL or script injection
|
||||||
NEW: add validation of MX domain for emails
|
NEW: add validation of MX domain for emails
|
||||||
@ -211,7 +211,7 @@ NEW: add param to not show links when output tags
|
|||||||
|
|
||||||
APIs
|
APIs
|
||||||
NEW: API get contacts list of a given order
|
NEW: API get contacts list of a given order
|
||||||
NEW: API endpoint getContacts and Clean results
|
NEW: API endpoint getContacts and clean results
|
||||||
NEW: API can update a payment
|
NEW: API can update a payment
|
||||||
NEW: API get member by thirdparty
|
NEW: API get member by thirdparty
|
||||||
NEW: API get thirdparty by barcode
|
NEW: API get thirdparty by barcode
|
||||||
@ -223,7 +223,7 @@ NEW: get state dictionary by REST API
|
|||||||
NEW: improve Product API for product variants
|
NEW: improve Product API for product variants
|
||||||
|
|
||||||
HOOKs
|
HOOKs
|
||||||
NEW: Hook on propal card
|
NEW: add hook on propal card
|
||||||
NEW: add hooks on newpayment page to allow external payment modules
|
NEW: add hooks on newpayment page to allow external payment modules
|
||||||
NEW: add hooks on stats pages
|
NEW: add hooks on stats pages
|
||||||
NEW: add formConfirm hook on product page
|
NEW: add formConfirm hook on product page
|
||||||
|
|||||||
@ -88,6 +88,7 @@ if (empty($search_date_start) && !GETPOSTISSET('formfilteraction'))
|
|||||||
} else {
|
} else {
|
||||||
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
|
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
|
||||||
$year_start = dol_print_date(dol_now(), '%Y');
|
$year_start = dol_print_date(dol_now(), '%Y');
|
||||||
|
if (dol_print_date(dol_now(), '%m') < $month_start) $year_start--; // If current month is lower that starting fiscal month, we start last year
|
||||||
$year_end = $year_start + 1;
|
$year_end = $year_start + 1;
|
||||||
$month_end = $month_start - 1;
|
$month_end = $month_start - 1;
|
||||||
if ($month_end < 1)
|
if ($month_end < 1)
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2020 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2020 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -73,16 +73,22 @@ if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Load variable for pagination
|
// Load variable for pagination
|
||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page < 0) { $page = 0; }
|
if (empty($page) || $page < 0) {
|
||||||
|
$page = 0;
|
||||||
|
}
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
if ($sortorder == "") $sortorder = "ASC";
|
if ($sortorder == "") {
|
||||||
if ($sortfield == "") $sortfield = "t.doc_date,t.rowid";
|
$sortorder = "ASC";
|
||||||
|
}
|
||||||
|
if ($sortfield == "") {
|
||||||
|
$sortfield = "t.doc_date,t.rowid";
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$object = new BookKeeping($db);
|
$object = new BookKeeping($db);
|
||||||
@ -105,11 +111,12 @@ if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('searc
|
|||||||
} else {
|
} else {
|
||||||
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
|
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
|
||||||
$year_start = dol_print_date(dol_now(), '%Y');
|
$year_start = dol_print_date(dol_now(), '%Y');
|
||||||
if (dol_print_date(dol_now(), '%m') < $month_start) $year_start--; // If current month is lower that starting fiscal month, we start last year
|
if (dol_print_date(dol_now(), '%m') < $month_start) {
|
||||||
|
$year_start--; // If current month is lower that starting fiscal month, we start last year
|
||||||
|
}
|
||||||
$year_end = $year_start + 1;
|
$year_end = $year_start + 1;
|
||||||
$month_end = $month_start - 1;
|
$month_end = $month_start - 1;
|
||||||
if ($month_end < 1)
|
if ($month_end < 1) {
|
||||||
{
|
|
||||||
$month_end = 12;
|
$month_end = 12;
|
||||||
$year_end--;
|
$year_end--;
|
||||||
}
|
}
|
||||||
@ -130,7 +137,9 @@ $arrayfields = array(
|
|||||||
't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1),
|
't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields['t.lettering_code']);
|
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
|
||||||
|
unset($arrayfields['t.lettering_code']);
|
||||||
|
}
|
||||||
|
|
||||||
if ($search_date_start && empty($search_date_startyear)) {
|
if ($search_date_start && empty($search_date_startyear)) {
|
||||||
$tmparray = dol_getdate($search_date_start);
|
$tmparray = dol_getdate($search_date_start);
|
||||||
@ -149,19 +158,23 @@ if ($search_date_end && empty($search_date_endyear)) {
|
|||||||
/*
|
/*
|
||||||
* Action
|
* Action
|
||||||
*/
|
*/
|
||||||
if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; }
|
if (GETPOST('cancel', 'alpha')) {
|
||||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; }
|
$action = 'list'; $massaction = '';
|
||||||
|
}
|
||||||
|
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
|
||||||
|
$massaction = '';
|
||||||
|
}
|
||||||
|
|
||||||
$parameters = array('socid'=>$socid);
|
$parameters = array('socid'=>$socid);
|
||||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($reshook))
|
if (empty($reshook)) {
|
||||||
{
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||||
|
|
||||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
|
||||||
{
|
|
||||||
$search_doc_date = '';
|
$search_doc_date = '';
|
||||||
$search_accountancy_code = '';
|
$search_accountancy_code = '';
|
||||||
$search_accountancy_code_start = '';
|
$search_accountancy_code_start = '';
|
||||||
@ -279,8 +292,7 @@ if ($action == 'delbookkeepingyearconfirm' && $user->rights->accounting->mouveme
|
|||||||
$deljournal = 0;
|
$deljournal = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($delmonth) || !empty($delyear) || !empty($deljournal))
|
if (!empty($delmonth) || !empty($delyear) || !empty($deljournal)) {
|
||||||
{
|
|
||||||
$result = $object->deleteByYearAndJournal($delyear, $deljournal, '', ($delmonth > 0 ? $delmonth : 0));
|
$result = $object->deleteByYearAndJournal($delyear, $deljournal, '', ($delmonth > 0 ? $delmonth : 0));
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
@ -393,7 +405,9 @@ if ($action == 'delbookkeepingyear') {
|
|||||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="list">';
|
print '<input type="hidden" name="action" value="list">';
|
||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
if ($optioncss != '') {
|
||||||
|
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
|
}
|
||||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
@ -409,8 +423,12 @@ if (empty($reshook)) {
|
|||||||
$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);
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
$param .= '&contextpage='.urlencode($contextpage);
|
||||||
|
}
|
||||||
|
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||||
|
$param .= '&limit='.urlencode($limit);
|
||||||
|
}
|
||||||
|
|
||||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $result, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $result, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||||
|
|
||||||
@ -418,11 +436,16 @@ print info_admin($langs->trans("WarningRecordWithoutSubledgerAreExcluded"));
|
|||||||
|
|
||||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
if ($massactionbutton) $selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
|
if ($massactionbutton) {
|
||||||
|
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
|
||||||
|
}
|
||||||
|
|
||||||
// Reverse sort order
|
// Reverse sort order
|
||||||
if (preg_match('/^asc/i', $sortorder)) $sortorder = "asc";
|
if (preg_match('/^asc/i', $sortorder)) {
|
||||||
else $sortorder = "desc";
|
$sortorder = "asc";
|
||||||
|
} else {
|
||||||
|
$sortorder = "desc";
|
||||||
|
}
|
||||||
|
|
||||||
$moreforfilter = '';
|
$moreforfilter = '';
|
||||||
|
|
||||||
@ -439,8 +462,11 @@ $moreforfilter .= '</div>';
|
|||||||
|
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
|
if (empty($reshook)) {
|
||||||
else $moreforfilter = $hookmanager->resPrint;
|
$moreforfilter .= $hookmanager->resPrint;
|
||||||
|
} else {
|
||||||
|
$moreforfilter = $hookmanager->resPrint;
|
||||||
|
}
|
||||||
|
|
||||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||||
print $moreforfilter;
|
print $moreforfilter;
|
||||||
@ -470,8 +496,7 @@ if (!empty($arrayfields['t.doc_date']['checked'])) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Movement number
|
// Movement number
|
||||||
if (!empty($arrayfields['t.piece_num']['checked']))
|
if (!empty($arrayfields['t.piece_num']['checked'])) {
|
||||||
{
|
|
||||||
print '<td class="liste_titre"><input type="text" name="search_mvt_num" size="6" value="'.dol_escape_htmltag($search_mvt_num).'"></td>';
|
print '<td class="liste_titre"><input type="text" name="search_mvt_num" size="6" value="'.dol_escape_htmltag($search_mvt_num).'"></td>';
|
||||||
}
|
}
|
||||||
// Ref document
|
// Ref document
|
||||||
@ -491,8 +516,7 @@ if (!empty($arrayfields['t.credit']['checked'])) {
|
|||||||
print '<td class="liste_titre right"><input type="text" class="flat" name="search_credit" size="4" value="'.dol_escape_htmltag($search_credit).'"></td>';
|
print '<td class="liste_titre right"><input type="text" class="flat" name="search_credit" size="4" value="'.dol_escape_htmltag($search_credit).'"></td>';
|
||||||
}
|
}
|
||||||
// Lettering code
|
// Lettering code
|
||||||
if (!empty($arrayfields['t.lettering_code']['checked']))
|
if (!empty($arrayfields['t.lettering_code']['checked'])) {
|
||||||
{
|
|
||||||
print '<td class="liste_titre center">';
|
print '<td class="liste_titre center">';
|
||||||
print '<input type="text" size="3" class="flat" name="search_lettering_code" value="'.$search_lettering_code.'"/>';
|
print '<input type="text" size="3" class="flat" name="search_lettering_code" value="'.$search_lettering_code.'"/>';
|
||||||
print '<br><span class="nowrap"><input type="checkbox" name="search_reconciled_option" value="notreconciled"'.($search_not_reconciled == 'notreconciled' ? ' checked' : '').'>'.$langs->trans("NotReconciled").'</span>';
|
print '<br><span class="nowrap"><input type="checkbox" name="search_reconciled_option" value="notreconciled"'.($search_not_reconciled == 'notreconciled' ? ' checked' : '').'>'.$langs->trans("NotReconciled").'</span>';
|
||||||
@ -512,14 +536,30 @@ print '</td>';
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (!empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, '', $sortfield, $sortorder, 'center ');
|
if (!empty($arrayfields['t.code_journal']['checked'])) {
|
||||||
if (!empty($arrayfields['t.doc_date']['checked'])) print_liste_field_titre($arrayfields['t.doc_date']['label'], $_SERVER['PHP_SELF'], "t.doc_date", "", $param, '', $sortfield, $sortorder, 'center ');
|
print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
if (!empty($arrayfields['t.piece_num']['checked'])) print_liste_field_titre($arrayfields['t.piece_num']['label'], $_SERVER['PHP_SELF'], "t.piece_num", "", $param, '', $sortfield, $sortorder);
|
}
|
||||||
if (!empty($arrayfields['t.doc_ref']['checked'])) print_liste_field_titre($arrayfields['t.doc_ref']['label'], $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder);
|
if (!empty($arrayfields['t.doc_date']['checked'])) {
|
||||||
if (!empty($arrayfields['t.label_operation']['checked'])) print_liste_field_titre($arrayfields['t.label_operation']['label'], $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['t.doc_date']['label'], $_SERVER['PHP_SELF'], "t.doc_date", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
if (!empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arrayfields['t.debit']['label'], $_SERVER['PHP_SELF'], "t.debit", "", $param, '', $sortfield, $sortorder, 'right ');
|
}
|
||||||
if (!empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, '', $sortfield, $sortorder, 'right ');
|
if (!empty($arrayfields['t.piece_num']['checked'])) {
|
||||||
if (!empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, '', $sortfield, $sortorder, 'center ');
|
print_liste_field_titre($arrayfields['t.piece_num']['label'], $_SERVER['PHP_SELF'], "t.piece_num", "", $param, '', $sortfield, $sortorder);
|
||||||
|
}
|
||||||
|
if (!empty($arrayfields['t.doc_ref']['checked'])) {
|
||||||
|
print_liste_field_titre($arrayfields['t.doc_ref']['label'], $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder);
|
||||||
|
}
|
||||||
|
if (!empty($arrayfields['t.label_operation']['checked'])) {
|
||||||
|
print_liste_field_titre($arrayfields['t.label_operation']['label'], $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder);
|
||||||
|
}
|
||||||
|
if (!empty($arrayfields['t.debit']['checked'])) {
|
||||||
|
print_liste_field_titre($arrayfields['t.debit']['label'], $_SERVER['PHP_SELF'], "t.debit", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
|
}
|
||||||
|
if (!empty($arrayfields['t.credit']['checked'])) {
|
||||||
|
print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
|
}
|
||||||
|
if (!empty($arrayfields['t.lettering_code']['checked'])) {
|
||||||
|
print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
|
}
|
||||||
// Hook fields
|
// Hook fields
|
||||||
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
@ -538,8 +578,7 @@ $displayed_account_number = null; // Start with undefined to be able to distingu
|
|||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$totalarray = array();
|
$totalarray = array();
|
||||||
while ($i < min($num, $limit))
|
while ($i < min($num, $limit)) {
|
||||||
{
|
|
||||||
$line = $object->lines[$i];
|
$line = $object->lines[$i];
|
||||||
|
|
||||||
$total_debit += $line->debit;
|
$total_debit += $line->debit;
|
||||||
@ -571,8 +610,7 @@ while ($i < min($num, $limit))
|
|||||||
$balance = $sous_total_debit - $sous_total_credit;
|
$balance = $sous_total_debit - $sous_total_credit;
|
||||||
print '<tr class="liste_total">';
|
print '<tr class="liste_total">';
|
||||||
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("Balance").':</td>';
|
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("Balance").':</td>';
|
||||||
if ($balance > 0)
|
if ($balance > 0) {
|
||||||
{
|
|
||||||
print '<td class="nowraponall right">';
|
print '<td class="nowraponall right">';
|
||||||
print price($sous_total_debit - $sous_total_credit);
|
print price($sous_total_debit - $sous_total_credit);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -595,7 +633,9 @@ while ($i < min($num, $limit))
|
|||||||
} else {
|
} else {
|
||||||
// Should not happen: subledger account must be null or a non empty value
|
// Should not happen: subledger account must be null or a non empty value
|
||||||
print '<span class="error">'.$langs->trans("Unknown");
|
print '<span class="error">'.$langs->trans("Unknown");
|
||||||
if ($line->subledger_label) print ' ('.$line->subledger_label.')';
|
if ($line->subledger_label) {
|
||||||
|
print ' ('.$line->subledger_label.')';
|
||||||
|
}
|
||||||
$htmltext = 'EmptyStringForSubledgerAccountButSubledgerLabelDefined';
|
$htmltext = 'EmptyStringForSubledgerAccountButSubledgerLabelDefined';
|
||||||
print $form->textwithpicto('', $htmltext);
|
print $form->textwithpicto('', $htmltext);
|
||||||
print '</span>';
|
print '</span>';
|
||||||
@ -614,38 +654,39 @@ while ($i < min($num, $limit))
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
// Journal code
|
// Journal code
|
||||||
if (!empty($arrayfields['t.code_journal']['checked']))
|
if (!empty($arrayfields['t.code_journal']['checked'])) {
|
||||||
{
|
|
||||||
$accountingjournal = new AccountingJournal($db);
|
$accountingjournal = new AccountingJournal($db);
|
||||||
$result = $accountingjournal->fetch('', $line->code_journal);
|
$result = $accountingjournal->fetch('', $line->code_journal);
|
||||||
$journaltoshow = (($result > 0) ? $accountingjournal->getNomUrl(0, 0, 0, '', 0) : $line->code_journal);
|
$journaltoshow = (($result > 0) ? $accountingjournal->getNomUrl(0, 0, 0, '', 0) : $line->code_journal);
|
||||||
print '<td class="center">'.$journaltoshow.'</td>';
|
print '<td class="center">'.$journaltoshow.'</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Document date
|
// Document date
|
||||||
if (!empty($arrayfields['t.doc_date']['checked']))
|
if (!empty($arrayfields['t.doc_date']['checked'])) {
|
||||||
{
|
|
||||||
print '<td class="center">'.dol_print_date($line->doc_date, 'day').'</td>';
|
print '<td class="center">'.dol_print_date($line->doc_date, 'day').'</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Piece number
|
// Piece number
|
||||||
if (!empty($arrayfields['t.piece_num']['checked']))
|
if (!empty($arrayfields['t.piece_num']['checked'])) {
|
||||||
{
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$object->id = $line->id;
|
$object->id = $line->id;
|
||||||
$object->piece_num = $line->piece_num;
|
$object->piece_num = $line->piece_num;
|
||||||
print $object->getNomUrl(1, '', 0, '', 1);
|
print $object->getNomUrl(1, '', 0, '', 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Document ref
|
// Document ref
|
||||||
if (!empty($arrayfields['t.doc_ref']['checked']))
|
if (!empty($arrayfields['t.doc_ref']['checked'])) {
|
||||||
{
|
if ($line->doc_type == 'customer_invoice') {
|
||||||
if ($line->doc_type == 'customer_invoice')
|
|
||||||
{
|
|
||||||
$langs->loadLangs(array('bills'));
|
$langs->loadLangs(array('bills'));
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
@ -657,8 +698,7 @@ while ($i < min($num, $limit))
|
|||||||
$filedir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($line->doc_ref);
|
$filedir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($line->doc_ref);
|
||||||
$urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id;
|
$urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id;
|
||||||
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
|
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
|
||||||
} elseif ($line->doc_type == 'supplier_invoice')
|
} elseif ($line->doc_type == 'supplier_invoice') {
|
||||||
{
|
|
||||||
$langs->loadLangs(array('bills'));
|
$langs->loadLangs(array('bills'));
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||||
@ -670,8 +710,7 @@ while ($i < min($num, $limit))
|
|||||||
$filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($line->fk_doc, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
|
$filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($line->fk_doc, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
|
||||||
$subdir = get_exdir($objectstatic->id, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
|
$subdir = get_exdir($objectstatic->id, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
|
||||||
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $subdir, $filedir);
|
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $subdir, $filedir);
|
||||||
} elseif ($line->doc_type == 'expense_report')
|
} elseif ($line->doc_type == 'expense_report') {
|
||||||
{
|
|
||||||
$langs->loadLangs(array('trips'));
|
$langs->loadLangs(array('trips'));
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
||||||
@ -683,8 +722,7 @@ while ($i < min($num, $limit))
|
|||||||
$filedir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($line->doc_ref);
|
$filedir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($line->doc_ref);
|
||||||
$urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id;
|
$urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id;
|
||||||
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
|
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
|
||||||
} elseif ($line->doc_type == 'bank')
|
} elseif ($line->doc_type == 'bank') {
|
||||||
{
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
$objectstatic = new AccountLine($db);
|
$objectstatic = new AccountLine($db);
|
||||||
$objectstatic->fetch($line->fk_doc);
|
$objectstatic->fetch($line->fk_doc);
|
||||||
@ -698,8 +736,7 @@ while ($i < min($num, $limit))
|
|||||||
// Picto + Ref
|
// Picto + Ref
|
||||||
print '<td class="nobordernopadding">';
|
print '<td class="nobordernopadding">';
|
||||||
|
|
||||||
if ($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice' || $line->doc_type == 'expense_report')
|
if ($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice' || $line->doc_type == 'expense_report') {
|
||||||
{
|
|
||||||
print $objectstatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1);
|
print $objectstatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1);
|
||||||
print $documentlink;
|
print $documentlink;
|
||||||
} elseif ($line->doc_type == 'bank') {
|
} elseif ($line->doc_type == 'bank') {
|
||||||
@ -712,7 +749,9 @@ while ($i < min($num, $limit))
|
|||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Label operation
|
// Label operation
|
||||||
@ -720,31 +759,41 @@ while ($i < min($num, $limit))
|
|||||||
// Affiche un lien vers la facture client/fournisseur
|
// Affiche un lien vers la facture client/fournisseur
|
||||||
$doc_ref = preg_replace('/\(.*\)/', '', $line->doc_ref);
|
$doc_ref = preg_replace('/\(.*\)/', '', $line->doc_ref);
|
||||||
print strlen(length_accounta($line->subledger_account)) == 0 ? '<td>'.$line->label_operation.'</td>' : '<td>'.$line->label_operation.'<br><span style="font-size:0.8em">('.length_accounta($line->subledger_account).')</span></td>';
|
print strlen(length_accounta($line->subledger_account)) == 0 ? '<td>'.$line->label_operation.'</td>' : '<td>'.$line->label_operation.'<br><span style="font-size:0.8em">('.length_accounta($line->subledger_account).')</span></td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Amount debit
|
// Amount debit
|
||||||
if (!empty($arrayfields['t.debit']['checked']))
|
if (!empty($arrayfields['t.debit']['checked'])) {
|
||||||
{
|
|
||||||
print '<td class="nowrap right">'.($line->debit ? price($line->debit) : '').'</td>';
|
print '<td class="nowrap right">'.($line->debit ? price($line->debit) : '').'</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) {
|
||||||
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totaldebit';
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['pos'][$totalarray['nbfield']] = 'totaldebit';
|
||||||
|
}
|
||||||
$totalarray['val']['totaldebit'] += $line->debit;
|
$totalarray['val']['totaldebit'] += $line->debit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Amount credit
|
// Amount credit
|
||||||
if (!empty($arrayfields['t.credit']['checked'])) {
|
if (!empty($arrayfields['t.credit']['checked'])) {
|
||||||
print '<td class="nowrap right">'.($line->credit ? price($line->credit) : '').'</td>';
|
print '<td class="nowrap right">'.($line->credit ? price($line->credit) : '').'</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) {
|
||||||
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalcredit';
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['pos'][$totalarray['nbfield']] = 'totalcredit';
|
||||||
|
}
|
||||||
$totalarray['val']['totalcredit'] += $line->credit;
|
$totalarray['val']['totalcredit'] += $line->credit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lettering code
|
// Lettering code
|
||||||
if (!empty($arrayfields['t.lettering_code']['checked']))
|
if (!empty($arrayfields['t.lettering_code']['checked'])) {
|
||||||
{
|
|
||||||
print '<td class="center">'.$line->lettering_code.'</td>';
|
print '<td class="center">'.$line->lettering_code.'</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fields from hook
|
// Fields from hook
|
||||||
@ -763,7 +812,9 @@ while ($i < min($num, $limit))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
// Comptabilise le sous-total
|
// Comptabilise le sous-total
|
||||||
$sous_total_debit += $line->debit;
|
$sous_total_debit += $line->debit;
|
||||||
@ -795,8 +846,7 @@ if ($num > 0) {
|
|||||||
$balance = $sous_total_debit - $sous_total_credit;
|
$balance = $sous_total_debit - $sous_total_credit;
|
||||||
print '<tr class="liste_total">';
|
print '<tr class="liste_total">';
|
||||||
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("Balance").':</td>';
|
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("Balance").':</td>';
|
||||||
if ($balance > 0)
|
if ($balance > 0) {
|
||||||
{
|
|
||||||
print '<td class="nowraponall right">';
|
print '<td class="nowraponall right">';
|
||||||
print price($sous_total_debit - $sous_total_credit);
|
print price($sous_total_debit - $sous_total_credit);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -42,9 +42,12 @@ $massaction = GETPOST('massaction', 'alpha');
|
|||||||
$show_files = GETPOST('show_files', 'int');
|
$show_files = GETPOST('show_files', 'int');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
$socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('id', 'int');
|
// $socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('id', 'int');
|
||||||
|
// Security check
|
||||||
|
$socid = GETPOSTINT("socid");
|
||||||
|
// if ($user->socid) $socid=$user->socid;
|
||||||
|
|
||||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOSTISSET('limit') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
@ -54,10 +57,12 @@ if (empty($page) || $page == - 1) {
|
|||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
if ($sortorder == "")
|
if ($sortorder == "") {
|
||||||
$sortorder = "ASC";
|
$sortorder = "ASC";
|
||||||
if ($sortfield == "")
|
}
|
||||||
|
if ($sortfield == "") {
|
||||||
$sortfield = "bk.doc_date";
|
$sortfield = "bk.doc_date";
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int'));
|
$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int'));
|
||||||
@ -81,16 +86,11 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Security check
|
|
||||||
$socid = GETPOST("socid", 'int');
|
|
||||||
// if ($user->socid) $socid=$user->socid;
|
|
||||||
|
|
||||||
$lettering = new Lettering($db);
|
$lettering = new Lettering($db);
|
||||||
$object = new Societe($db);
|
$object = new Societe($db);
|
||||||
$object->id = $socid;
|
$object->id = $socid;
|
||||||
$result = $object->fetch($socid);
|
$result = $object->fetch($socid);
|
||||||
if ($result < 0)
|
if ($result < 0) {
|
||||||
{
|
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -251,7 +251,9 @@ if ($resql) {
|
|||||||
$tmp = '';
|
$tmp = '';
|
||||||
|
|
||||||
while ($obj = $db->fetch_object($resql)) {
|
while ($obj = $db->fetch_object($resql)) {
|
||||||
if ($tmp != $obj->lettering_code || empty($tmp)) $tmp = $obj->lettering_code;
|
if ($tmp != $obj->lettering_code || empty($tmp)) {
|
||||||
|
$tmp = $obj->lettering_code;
|
||||||
|
}
|
||||||
/*if ($tmp != $obj->lettering_code || empty($obj->lettering_code))*/ $solde += ($obj->credit - $obj->debit);
|
/*if ($tmp != $obj->lettering_code || empty($obj->lettering_code))*/ $solde += ($obj->credit - $obj->debit);
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|||||||
@ -41,7 +41,11 @@ $massaction = GETPOST('massaction', 'alpha');
|
|||||||
$show_files = GETPOST('show_files', 'int');
|
$show_files = GETPOST('show_files', 'int');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
$socid = GETPOST('socid', 'int') ? ((int) GETPOST('socid', 'int')) : ((int) GETPOST('id', 'int'));
|
// $socid = GETPOST('socid', 'int') ? ((int) GETPOST('socid', 'int')) : ((int) GETPOST('id', 'int'));
|
||||||
|
// Security check
|
||||||
|
$socid = GETPOSTINT("socid");
|
||||||
|
// if ($user->socid) $socid=$user->socid;
|
||||||
|
|
||||||
|
|
||||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
@ -53,10 +57,12 @@ if (empty($page) || $page == - 1) {
|
|||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
if ($sortorder == "")
|
if ($sortorder == "") {
|
||||||
$sortorder = "ASC";
|
$sortorder = "ASC";
|
||||||
if ($sortfield == "")
|
}
|
||||||
|
if ($sortfield == "") {
|
||||||
$sortfield = "bk.doc_date";
|
$sortfield = "bk.doc_date";
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int'));
|
$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int'));
|
||||||
@ -80,17 +86,11 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
// Security check
|
|
||||||
$socid = GETPOST("socid", 'int');
|
|
||||||
// if ($user->socid) $socid=$user->socid;
|
|
||||||
|
|
||||||
$lettering = new Lettering($db);
|
$lettering = new Lettering($db);
|
||||||
$object = new Societe($db);
|
$object = new Societe($db);
|
||||||
$object->id = $socid;
|
$object->id = $socid;
|
||||||
$result = $object->fetch($socid);
|
$result = $object->fetch($socid);
|
||||||
if ($result < 0)
|
if ($result < 0) {
|
||||||
{
|
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -159,8 +159,7 @@ $solde = 0;
|
|||||||
// Count total nb of records and calc total sum
|
// Count total nb of records and calc total sum
|
||||||
$nbtotalofrecords = '';
|
$nbtotalofrecords = '';
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if (!$resql)
|
if (!$resql) {
|
||||||
{
|
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -248,7 +247,9 @@ if ($resql) {
|
|||||||
$solde = 0;
|
$solde = 0;
|
||||||
$tmp = '';
|
$tmp = '';
|
||||||
while ($obj = $db->fetch_object($resql)) {
|
while ($obj = $db->fetch_object($resql)) {
|
||||||
if ($tmp != $obj->lettering_code || empty($tmp)) $tmp = $obj->lettering_code;
|
if ($tmp != $obj->lettering_code || empty($tmp)) {
|
||||||
|
$tmp = $obj->lettering_code;
|
||||||
|
}
|
||||||
/*if ($tmp != $obj->lettering_code || empty($obj->lettering_code))*/ $solde += ($obj->credit - $obj->debit);
|
/*if ($tmp != $obj->lettering_code || empty($obj->lettering_code))*/ $solde += ($obj->credit - $obj->debit);
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|||||||
@ -114,57 +114,57 @@ print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans(
|
|||||||
|
|
||||||
// Name
|
// Name
|
||||||
print '<tr class="oddeven"><td><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
|
||||||
print '<input name="nom" id="name" class="minwidth200" value="'.($conf->global->MAIN_INFO_ACCOUNTANT_NAME ? $conf->global->MAIN_INFO_ACCOUNTANT_NAME : GETPOST("nom", 'nohtml')).'"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'></td></tr>'."\n";
|
print '<input name="nom" id="name" class="minwidth200" value="'.(GETPOSTISSET('nom') ? GETPOST('nom', 'nohtml') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_NAME) ? $conf->global->MAIN_INFO_ACCOUNTANT_NAME : '')).'"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'></td></tr>'."\n";
|
||||||
|
|
||||||
// Address
|
// Address
|
||||||
print '<tr class="oddeven"><td><label for="address">'.$langs->trans("CompanyAddress").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="address">'.$langs->trans("CompanyAddress").'</label></td><td>';
|
||||||
print '<textarea name="address" id="address" class="quatrevingtpercent" rows="'.ROWS_3.'">'.($conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS ? $conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS : GETPOST("address", 'nohtml')).'</textarea></td></tr>'."\n";
|
print '<textarea name="address" id="address" class="quatrevingtpercent" rows="'.ROWS_3.'">'.(GETPOSTISSET('address') ? GETPOST('address', 'nohtml') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS) ? $conf->global->MAIN_INFO_ACCOUNTANT_ADDRESS : '')).'</textarea></td></tr>'."\n";
|
||||||
|
|
||||||
print '<tr class="oddeven"><td><label for="zipcode">'.$langs->trans("CompanyZip").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="zipcode">'.$langs->trans("CompanyZip").'</label></td><td>';
|
||||||
print '<input class="minwidth100" name="zipcode" id="zipcode" value="'.($conf->global->MAIN_INFO_ACCOUNTANT_ZIP ? $conf->global->MAIN_INFO_ACCOUNTANT_ZIP : GETPOST("zipcode", 'alpha')).'"></td></tr>'."\n";
|
print '<input class="minwidth100" name="zipcode" id="zipcode" value="'.(GETPOSTISSET('zipcode') ? GETPOST('zipcode', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_ZIP) ? $conf->global->MAIN_INFO_ACCOUNTANT_ZIP : '')).'"></td></tr>'."\n";
|
||||||
|
|
||||||
print '<tr class="oddeven"><td><label for="town">'.$langs->trans("CompanyTown").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="town">'.$langs->trans("CompanyTown").'</label></td><td>';
|
||||||
print '<input name="town" class="minwidth100" id="town" value="'.($conf->global->MAIN_INFO_ACCOUNTANT_TOWN ? $conf->global->MAIN_INFO_ACCOUNTANT_TOWN : GETPOST("town", 'nohtml')).'"></td></tr>'."\n";
|
print '<input name="town" class="minwidth100" id="town" value="'.(GETPOSTISSET('town') ? GETPOST('town', 'nohtml') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_TOWN) ? $conf->global->MAIN_INFO_ACCOUNTANT_TOWN : '')).'"></td></tr>'."\n";
|
||||||
|
|
||||||
// Country
|
// Country
|
||||||
print '<tr class="oddeven"><td><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
|
print '<tr class="oddeven"><td><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
|
||||||
print img_picto('', 'globe-americas', 'class="paddingrightonly"');
|
print img_picto('', 'globe-americas', 'class="paddingrightonly"');
|
||||||
print $form->select_country($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'country_id');
|
print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY) ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'country_id');
|
||||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
print '<tr class="oddeven"><td><label for="state_id">'.$langs->trans("State").'</label></td><td class="maxwidthonsmartphone">';
|
print '<tr class="oddeven"><td><label for="state_id">'.$langs->trans("State").'</label></td><td class="maxwidthonsmartphone">';
|
||||||
$formcompany->select_departement($conf->global->MAIN_INFO_ACCOUNTANT_STATE, $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'state_id');
|
$formcompany->select_departement((GETPOSTISSET('state_id') ? GETPOST('state_id', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_STATE) ? $conf->global->MAIN_INFO_ACCOUNTANT_STATE : '')), (GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY) ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'state_id');
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
|
||||||
print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright');
|
print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright');
|
||||||
print '<input name="tel" id="phone" value="'.$conf->global->MAIN_INFO_ACCOUNTANT_PHONE.'"></td></tr>';
|
print '<input name="tel" id="phone" value="'.(GETPOSTISSET('tel') ? GETPOST('tel', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_PHONE) ? $conf->global->MAIN_INFO_ACCOUNTANT_PHONE : '')).'"></td></tr>';
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
|
||||||
print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright');
|
print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright');
|
||||||
print '<input name="fax" id="fax" value="'.$conf->global->MAIN_INFO_ACCOUNTANT_FAX.'"></td></tr>';
|
print '<input name="fax" id="fax" value="'.(GETPOSTISSET('fax') ? GETPOST('fax', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_FAX) ? $conf->global->MAIN_INFO_ACCOUNTANT_FAX : '')).'"></td></tr>';
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
|
||||||
print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright');
|
print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright');
|
||||||
print '<input name="mail" id="email" class="minwidth200" value="'.$conf->global->MAIN_INFO_ACCOUNTANT_MAIL.'"></td></tr>';
|
print '<input name="mail" id="email" class="minwidth200" value="'.(GETPOSTISSET('mail') ? GETPOST('mail', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_MAIL) ? $conf->global->MAIN_INFO_ACCOUNTANT_MAIL : '')).'"></td></tr>';
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
// Web
|
// Web
|
||||||
print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
|
||||||
print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright');
|
print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright');
|
||||||
print '<input name="web" id="web" class="minwidth300" value="'.$conf->global->MAIN_INFO_ACCOUNTANT_WEB.'"></td></tr>';
|
print '<input name="web" id="web" class="minwidth300" value="'.(GETPOSTISSET('web') ? GETPOST('web', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_WEB) ? $conf->global->MAIN_INFO_ACCOUNTANT_WEB : '')).'"></td></tr>';
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
// Code
|
// Code
|
||||||
print '<tr class="oddeven"><td><label for="code">'.$langs->trans("AccountantFileNumber").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="code">'.$langs->trans("AccountantFileNumber").'</label></td><td>';
|
||||||
print '<input name="code" id="code" class="minwidth100" value="'.($conf->global->MAIN_INFO_ACCOUNTANT_CODE ? $conf->global->MAIN_INFO_ACCOUNTANT_CODE : GETPOST("code", 'nohtml')).'"></td></tr>'."\n";
|
print '<input name="code" id="code" class="minwidth100" value="'.(GETPOSTISSET('code') ? GETPOST('code', 'nohtml') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_CODE) ? $conf->global->MAIN_INFO_ACCOUNTANT_CODE : '')).'"></td></tr>'."\n";
|
||||||
|
|
||||||
// Note
|
// Note
|
||||||
print '<tr class="oddeven"><td class="tdtop"><label for="note">'.$langs->trans("Note").'</label></td><td>';
|
print '<tr class="oddeven"><td class="tdtop"><label for="note">'.$langs->trans("Note").'</label></td><td>';
|
||||||
print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.'">'.(GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : $conf->global->MAIN_INFO_ACCOUNTANT_NOTE).'</textarea></td></tr>';
|
print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.'">'.(GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_NOTE) ? $conf->global->MAIN_INFO_ACCOUNTANT_NOTE : '')).'</textarea></td></tr>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
@ -446,14 +446,14 @@ print '<td>';
|
|||||||
print $langs->trans("MaxNbOfLinesForBoxes");
|
print $langs->trans("MaxNbOfLinesForBoxes");
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<input type="text" class="flat" size="6" name="MAIN_BOXES_MAXLINES" value="'.$conf->global->MAIN_BOXES_MAXLINES.'">';
|
print '<input type="text" class="flat" size="6" name="MAIN_BOXES_MAXLINES" value="'.(!empty($conf->global->MAIN_BOXES_MAXLINES) ? $conf->global->MAIN_BOXES_MAXLINES : '').'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Activate FileCache - Developement
|
// Activate FileCache - Developement
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL == 2 || !empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
|
if ($conf->global->MAIN_FEATURES_LEVEL == 2 || !empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
|
||||||
print '<tr class="oddeven"><td width="35%">'.$langs->trans("EnableFileCache").'</td><td>';
|
print '<tr class="oddeven"><td width="35%">'.$langs->trans("EnableFileCache").'</td><td>';
|
||||||
print $form->selectyesno('MAIN_ACTIVATE_FILECACHE', $conf->global->MAIN_ACTIVATE_FILECACHE, 1);
|
print $form->selectyesno('MAIN_ACTIVATE_FILECACHE', (!empty($conf->global->MAIN_ACTIVATE_FILECACHE) ? $conf->global->MAIN_ACTIVATE_FILECACHE : 0), 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -393,18 +393,18 @@ print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans(
|
|||||||
|
|
||||||
// Name
|
// Name
|
||||||
print '<tr class="oddeven"><td class="fieldrequired wordbreak"><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
|
print '<tr class="oddeven"><td class="fieldrequired wordbreak"><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
|
||||||
print '<input name="nom" id="name" class="minwidth200" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_NOM ? $conf->global->MAIN_INFO_SOCIETE_NOM : GETPOST("nom", 'nohtml')).'"'.(empty($conf->global->MAIN_INFO_SOCIETE_NOM) ? ' autofocus="autofocus"' : '').'></td></tr>'."\n";
|
print '<input name="nom" id="name" class="minwidth200" value="'.dol_escape_htmltag((GETPOSTISSET('nom') ? GETPOST('nom', 'nohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_NOM) ? $conf->global->MAIN_INFO_SOCIETE_NOM : '')).'"'.(empty($conf->global->MAIN_INFO_SOCIETE_NOM) ? ' autofocus="autofocus"' : '')).'></td></tr>'."\n";
|
||||||
|
|
||||||
// Address
|
// Address
|
||||||
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ADDRESS">'.$langs->trans("CompanyAddress").'</label></td><td>';
|
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";
|
print '<textarea name="MAIN_INFO_SOCIETE_ADDRESS" id="MAIN_INFO_SOCIETE_ADDRESS" class="quatrevingtpercent" rows="'.ROWS_3.'">'.(GETPOSTISSET('MAIN_INFO_SOCIETE_ADDRESS') ? GETPOST('MAIN_INFO_SOCIETE_ADDRESS', 'nohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_ADDRESS) ? $conf->global->MAIN_INFO_SOCIETE_ADDRESS : '')).'</textarea></td></tr>'."\n";
|
||||||
|
|
||||||
// Zip
|
// Zip
|
||||||
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ZIP">'.$langs->trans("CompanyZip").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ZIP">'.$langs->trans("CompanyZip").'</label></td><td>';
|
||||||
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 '<input class="width100" name="MAIN_INFO_SOCIETE_ZIP" id="MAIN_INFO_SOCIETE_ZIP" value="'.dol_escape_htmltag((GETPOSTISSET('MAIN_INFO_SOCIETE_ZIP') ? GETPOST('MAIN_INFO_SOCIETE_ZIP', 'alpha') : (!empty($conf->global->MAIN_INFO_SOCIETE_ZIP) ? $conf->global->MAIN_INFO_SOCIETE_ZIP : ''))).'"></td></tr>'."\n";
|
||||||
|
|
||||||
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_TOWN">'.$langs->trans("CompanyTown").'</label></td><td>';
|
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="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";
|
print '<input name="MAIN_INFO_SOCIETE_TOWN" class="minwidth200" id="MAIN_INFO_SOCIETE_TOWN" value="'.dol_escape_htmltag((GETPOSTISSET('MAIN_INFO_SOCIETE_TOWN') ? GETPOST('MAIN_INFO_SOCIETE_TOWN', 'nohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_TOWN) ? $conf->global->MAIN_INFO_SOCIETE_TOWN : ''))).'"></td></tr>'."\n";
|
||||||
|
|
||||||
// Country
|
// Country
|
||||||
print '<tr class="oddeven"><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
|
print '<tr class="oddeven"><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
|
||||||
@ -431,25 +431,25 @@ print '</td></tr>'."\n";
|
|||||||
// Phone
|
// Phone
|
||||||
print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
|
||||||
print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright');
|
print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright');
|
||||||
print '<input name="tel" id="phone" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TEL).'"></td></tr>';
|
print '<input name="tel" id="phone" value="'.dol_escape_htmltag((GETPOSTISSET('tel') ? GETPOST('tel', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_TEL) ? $conf->global->MAIN_INFO_SOCIETE_TEL : ''))).'"></td></tr>';
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
// Fax
|
// Fax
|
||||||
print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
|
||||||
print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright');
|
print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright');
|
||||||
print '<input name="fax" id="fax" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_FAX).'"></td></tr>';
|
print '<input name="fax" id="fax" value="'.dol_escape_htmltag((GETPOSTISSET('fax') ? GETPOST('fax', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_FAX) ? $conf->global->MAIN_INFO_SOCIETE_FAX : ''))).'"></td></tr>';
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
// Email
|
// Email
|
||||||
print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
|
||||||
print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright');
|
print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright');
|
||||||
print '<input name="mail" id="email" class="minwidth200" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_MAIL).'"></td></tr>';
|
print '<input name="mail" id="email" class="minwidth200" value="'.dol_escape_htmltag((GETPOSTISSET('mail') ? GETPOST('mail', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $conf->global->MAIN_INFO_SOCIETE_MAIL : ''))).'"></td></tr>';
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
// Web
|
// Web
|
||||||
print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
|
||||||
print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright');
|
print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright');
|
||||||
print '<input name="web" id="web" class="minwidth300" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_WEB).'"></td></tr>';
|
print '<input name="web" id="web" class="minwidth300" value="'.dol_escape_htmltag((GETPOSTISSET('web') ? GETPOST('web', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_WEB) ? $conf->global->MAIN_INFO_SOCIETE_WEB : ''))).'"></td></tr>';
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
// Barcode
|
// Barcode
|
||||||
@ -457,7 +457,7 @@ if (!empty($conf->barcode->enabled)) {
|
|||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print '<label for="barcode">'.$langs->trans("Gencod").'</label></td><td>';
|
print '<label for="barcode">'.$langs->trans("Gencod").'</label></td><td>';
|
||||||
print '<span class="fa paddingright fa-barcode"></span>';
|
print '<span class="fa paddingright fa-barcode"></span>';
|
||||||
print '<input name="barcode" id="barcode" class="minwidth150" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_GENCOD).'"></td></tr>';
|
print '<input name="barcode" id="barcode" class="minwidth150" value="'.dol_escape_htmltag((GETPOSTISSET('barcode') ? GETPOST('barcode', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_GENCODE) ? $conf->global->MAIN_INFO_SOCIETE_GENCODE : ''))).'"></td></tr>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -534,7 +534,7 @@ print '</td></tr>';
|
|||||||
|
|
||||||
// Note
|
// Note
|
||||||
print '<tr class="oddeven"><td class="tdtop"><label for="note">'.$langs->trans("Note").'</label></td><td>';
|
print '<tr class="oddeven"><td class="tdtop"><label for="note">'.$langs->trans("Note").'</label></td><td>';
|
||||||
print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.'">'.(GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : $conf->global->MAIN_INFO_SOCIETE_NOTE).'</textarea></td></tr>';
|
print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.'">'.(GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? $conf->global->MAIN_INFO_SOCIETE_NOTE : '')).'</textarea></td></tr>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -549,17 +549,17 @@ $langs->load("companies");
|
|||||||
|
|
||||||
// Managing Director(s)
|
// Managing Director(s)
|
||||||
print '<tr class="oddeven"><td><label for="director">'.$langs->trans("ManagingDirectors").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="director">'.$langs->trans("ManagingDirectors").'</label></td><td>';
|
||||||
print '<input name="MAIN_INFO_SOCIETE_MANAGERS" id="directors" class="minwidth200" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_MANAGERS).'"></td></tr>';
|
print '<input name="MAIN_INFO_SOCIETE_MANAGERS" id="directors" class="minwidth200" value="'.dol_escape_htmltag((GETPOSTISSET('MAIN_INFO_SOCIETE_MANAGERS') ? GETPOST('MAIN_INFO_SOCIETE_MANAGERS', 'nohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_MANAGERS) ? $conf->global->MAIN_INFO_SOCIETE_MANAGERS : ''))).'"></td></tr>';
|
||||||
|
|
||||||
// GDPR contact
|
// GDPR contact
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $form->textwithpicto($langs->trans("GDPRContact"), $langs->trans("GDPRContactDesc"));
|
print $form->textwithpicto($langs->trans("GDPRContact"), $langs->trans("GDPRContactDesc"));
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print '<input name="MAIN_INFO_GDPR" id="infodirector" class="minwidth500" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_GDPR).'"></td></tr>';
|
print '<input name="MAIN_INFO_GDPR" id="infodirector" class="minwidth500" value="'.dol_escape_htmltag((GETPOSTISSET("MAIN_INFO_GDPR") ? GETPOST("MAIN_INFO_GDPR", 'nohtml') : (!empty($conf->global->MAIN_INFO_GDPR) ? $conf->global->MAIN_INFO_GDPR : ''))).'"></td></tr>';
|
||||||
|
|
||||||
// Capital
|
// Capital
|
||||||
print '<tr class="oddeven"><td><label for="capital">'.$langs->trans("Capital").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="capital">'.$langs->trans("Capital").'</label></td><td>';
|
||||||
print '<input name="capital" id="capital" class="maxwidth100" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_CAPITAL).'"></td></tr>';
|
print '<input name="capital" id="capital" class="maxwidth100" value="'.dol_escape_htmltag((GETPOSTISSET('capital') ? GETPOST('capital', 'nohtml') : (!empty($conf->global->MAIN_INFO_CAPITAL) ? $conf->global->MAIN_INFO_CAPITAL : ''))).'"></td></tr>';
|
||||||
|
|
||||||
// Juridical Status
|
// Juridical Status
|
||||||
print '<tr class="oddeven"><td><label for="forme_juridique_code">'.$langs->trans("JuridicalStatus").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="forme_juridique_code">'.$langs->trans("JuridicalStatus").'</label></td><td>';
|
||||||
|
|||||||
@ -117,11 +117,11 @@ foreach ($listofnetworks as $key => $value) {
|
|||||||
$networkconstname = 'MAIN_INFO_SOCIETE_'.strtoupper($key).'_URL';
|
$networkconstname = 'MAIN_INFO_SOCIETE_'.strtoupper($key).'_URL';
|
||||||
$networkconstid = 'MAIN_INFO_SOCIETE_'.strtoupper($key);
|
$networkconstid = 'MAIN_INFO_SOCIETE_'.strtoupper($key);
|
||||||
print '<td><span class="fa paddingright '.($value['icon'] ? $value['icon'] : 'fa-link').'"></span>';
|
print '<td><span class="fa paddingright '.($value['icon'] ? $value['icon'] : 'fa-link').'"></span>';
|
||||||
print '<input name="'.$key.'url" id="'.$key.'url" class="minwidth300" value="'.dol_escape_htmltag($conf->global->$networkconstname).'">';
|
print '<input name="'.$key.'url" id="'.$key.'url" class="minwidth300" value="'.(!empty($conf->global->$networkconstname) ? dol_escape_htmltag($conf->global->$networkconstname) : '').'">';
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print '<input name="'.$key.'" id="'.$key.'" class="minwidth300" value="'.dol_escape_htmltag($conf->global->$networkconstid).'">';
|
print '<input name="'.$key.'" id="'.$key.'" class="minwidth300" value="'.(!empty($conf->global->$networkconstid) ? dol_escape_htmltag($conf->global->$networkconstid) : '').'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>'.dol_print_socialnetworks($conf->global->$networkconstid, 0, 0, $key, $listofnetworks).'</td>';
|
print '<td>'.dol_print_socialnetworks((!empty($conf->global->$networkconstid) ? dol_escape_htmltag($conf->global->$networkconstid) : ''), 0, 0, $key, $listofnetworks).'</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,9 +72,9 @@ $hookmanager->initHooks(array('admindefaultvalues', 'globaladmin'));
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; }
|
if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; }
|
||||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; }
|
if (!GETPOST('confirmmassaction', 'alpha') && !empty($massaction) && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; }
|
||||||
|
|
||||||
$parameters = array('socid'=>$socid);
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ llxHeader('', $langs->trans("Setup"), $wikihelp);
|
|||||||
|
|
||||||
$param = '&mode='.$mode;
|
$param = '&mode='.$mode;
|
||||||
|
|
||||||
$enabledisablehtml .= $langs->trans("EnableDefaultValues").' ';
|
$enabledisablehtml = $langs->trans("EnableDefaultValues").' ';
|
||||||
if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES))
|
if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES))
|
||||||
{
|
{
|
||||||
// Button off, click to enable
|
// Button off, click to enable
|
||||||
@ -213,7 +213,7 @@ if ($defaultkey) $param .= '&defaultkey='.urlencode($defaultkey);
|
|||||||
if ($defaultvalue) $param .= '&defaultvalue='.urlencode($defaultvalue);
|
if ($defaultvalue) $param .= '&defaultvalue='.urlencode($defaultvalue);
|
||||||
|
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && $debug) ? '?debug=1' : '').'" method="POST">';
|
print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && !empty($debug)) ? '?debug=1' : '').'" method="POST">';
|
||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
|
|||||||
@ -621,6 +621,7 @@ if ($id == 11)
|
|||||||
// 'contract' => $langs->trans('Contract'),
|
// 'contract' => $langs->trans('Contract'),
|
||||||
'project' => $langs->trans('Project'),
|
'project' => $langs->trans('Project'),
|
||||||
'project_task' => $langs->trans('Task'),
|
'project_task' => $langs->trans('Task'),
|
||||||
|
'ticket' => $langs->trans('Ticket'),
|
||||||
'agenda' => $langs->trans('Agenda'),
|
'agenda' => $langs->trans('Agenda'),
|
||||||
'dolresource' => $langs->trans('Resource'),
|
'dolresource' => $langs->trans('Resource'),
|
||||||
// old deprecated
|
// old deprecated
|
||||||
@ -1492,11 +1493,9 @@ if ($id)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($value == 'element')
|
if ($value == 'element') {
|
||||||
{
|
|
||||||
$valuetoshow = isset($elementList[$valuetoshow]) ? $elementList[$valuetoshow] : $valuetoshow;
|
$valuetoshow = isset($elementList[$valuetoshow]) ? $elementList[$valuetoshow] : $valuetoshow;
|
||||||
} elseif ($value == 'source')
|
} elseif ($value == 'source') {
|
||||||
{
|
|
||||||
$valuetoshow = isset($sourceList[$valuetoshow]) ? $sourceList[$valuetoshow] : $valuetoshow;
|
$valuetoshow = isset($sourceList[$valuetoshow]) ? $sourceList[$valuetoshow] : $valuetoshow;
|
||||||
} elseif ($valuetoshow == 'all') {
|
} elseif ($valuetoshow == 'all') {
|
||||||
$valuetoshow = $langs->trans('All');
|
$valuetoshow = $langs->trans('All');
|
||||||
|
|||||||
@ -163,7 +163,7 @@ if ($action == 'edit')
|
|||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"), $langs->trans("ParameterActiveForNextInputOnly"));
|
print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"), $langs->trans("ParameterActiveForNextInputOnly"));
|
||||||
print '</td><td><input class="flat" name="'.$mainroundingruletot.'" size="3" value="'.(isset($conf->global->$mainroundingruletot) ? $conf->global->$mainroundingruletot : $conf->global->MAIN_ROUNDING_RULE_TOT).'"></td></tr>';
|
print '</td><td><input class="flat" name="'.$mainroundingruletot.'" size="3" value="'.(isset($conf->global->$mainroundingruletot) ? $conf->global->$mainroundingruletot : (!empty($conf->global->MAIN_ROUNDING_RULE_TOT) ? $conf->global->MAIN_ROUNDING_RULE_TOT : '')).'"></td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
@ -193,7 +193,7 @@ if ($action == 'edit')
|
|||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"), $langs->trans("ParameterActiveForNextInputOnly"));
|
print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"), $langs->trans("ParameterActiveForNextInputOnly"));
|
||||||
print '</td><td align="right">'.(isset($conf->global->$mainroundingruletot) ? $conf->global->$mainroundingruletot : $conf->global->MAIN_ROUNDING_RULE_TOT).'</td></tr>';
|
print '</td><td align="right">'.(isset($conf->global->$mainroundingruletot) ? $conf->global->$mainroundingruletot : (!empty($conf->global->MAIN_ROUNDING_RULE_TOT) ? $conf->global->MAIN_ROUNDING_RULE_TOT : '')).'</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -290,6 +290,11 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
// Id
|
// Id
|
||||||
$parent_rowid = GETPOST('menuId', 'int');
|
$parent_rowid = GETPOST('menuId', 'int');
|
||||||
|
$parent_mainmenu = '';
|
||||||
|
$parent_leftmenu = '';
|
||||||
|
$parent_langs = '';
|
||||||
|
$parent_level = '';
|
||||||
|
|
||||||
if (GETPOST('menuId', 'int')) {
|
if (GETPOST('menuId', 'int')) {
|
||||||
$sql = "SELECT m.rowid, m.mainmenu, m.leftmenu, m.level, m.langs FROM ".MAIN_DB_PREFIX."menu as m WHERE m.rowid = ".GETPOST('menuId', 'int');
|
$sql = "SELECT m.rowid, m.mainmenu, m.leftmenu, m.level, m.langs FROM ".MAIN_DB_PREFIX."menu as m WHERE m.rowid = ".GETPOST('menuId', 'int');
|
||||||
$res = $db->query($sql);
|
$res = $db->query($sql);
|
||||||
@ -328,8 +333,8 @@ if ($action == 'create') {
|
|||||||
} else {
|
} else {
|
||||||
print '<select name="type" class="flat" id="topleft">';
|
print '<select name="type" class="flat" id="topleft">';
|
||||||
print '<option value=""> </option>';
|
print '<option value=""> </option>';
|
||||||
print '<option value="top"'.($_POST["type"] && $_POST["type"] == 'top' ? ' selected' : '').'>'.$langs->trans('Top').'</option>';
|
print '<option value="top"'.(!empty($_POST["type"]) && $_POST["type"] == 'top' ? ' selected' : '').'>'.$langs->trans('Top').'</option>';
|
||||||
print '<option value="left"'.($_POST["type"] && $_POST["type"] == 'left' ? ' selected' : '').'>'.$langs->trans('Left').'</option>';
|
print '<option value="left"'.(!empty($_POST["type"]) && $_POST["type"] == 'left' ? ' selected' : '').'>'.$langs->trans('Left').'</option>';
|
||||||
print '</select>';
|
print '</select>';
|
||||||
}
|
}
|
||||||
print '</td><td>'.$langs->trans('DetailType').'</td></tr>';
|
print '</td><td>'.$langs->trans('DetailType').'</td></tr>';
|
||||||
@ -370,8 +375,8 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
// Target
|
// Target
|
||||||
print '<tr><td>'.$langs->trans('Target').'</td><td><select class="flat" name="target">';
|
print '<tr><td>'.$langs->trans('Target').'</td><td><select class="flat" name="target">';
|
||||||
print '<option value=""'.($menu->target == "" ? ' selected' : '').'> </option>';
|
print '<option value=""'.(isset($menu->target) && $menu->target == "" ? ' selected' : '').'> </option>';
|
||||||
print '<option value="_blank"'.($menu->target == "_blank" ? ' selected' : '').'>'.$langs->trans('_blank').'</option>';
|
print '<option value="_blank"'.(isset($menu->target) && $menu->target == "_blank" ? ' selected' : '').'>'.$langs->trans('_blank').'</option>';
|
||||||
print '</select></td></td><td>'.$langs->trans('DetailTarget').'</td></tr>';
|
print '</select></td></td><td>'.$langs->trans('DetailTarget').'</td></tr>';
|
||||||
|
|
||||||
// Enabled
|
// Enabled
|
||||||
|
|||||||
@ -367,7 +367,7 @@ if ($conf->use_javascript_ajax)
|
|||||||
$remainingdata = array();
|
$remainingdata = array();
|
||||||
foreach ($data as $datar)
|
foreach ($data as $datar)
|
||||||
{
|
{
|
||||||
if (empty($datar['rowid']) || $tree_recur_alreadyadded[$datar['rowid']]) continue;
|
if (empty($datar['rowid']) || !empty($tree_recur_alreadyadded[$datar['rowid']])) continue;
|
||||||
$remainingdata[] = $datar;
|
$remainingdata[] = $datar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -495,13 +495,19 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
|||||||
dol_set_focus('#search_keyword');
|
dol_set_focus('#search_keyword');
|
||||||
|
|
||||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
if ($optioncss != '') {
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
if (isset($optioncss) && $optioncss != '') {
|
||||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
}
|
}
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
if (isset($sortfield) && $sortfield != '') {
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
|
}
|
||||||
|
if (isset($sortorder) && $sortorder != '') {
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
}
|
||||||
|
if (isset($page) && $page != '') {
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
|
}
|
||||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||||
|
|
||||||
print dol_get_fiche_head($head, 'modules', '', -1);
|
print dol_get_fiche_head($head, 'modules', '', -1);
|
||||||
@ -999,7 +1005,7 @@ if ($mode == 'marketplace') {
|
|||||||
<div id="listing-content">
|
<div id="listing-content">
|
||||||
<table summary="list_of_modules" id="list_of_modules" class="productlist centpercent">
|
<table summary="list_of_modules" id="list_of_modules" class="productlist centpercent">
|
||||||
<tbody id="listOfModules">
|
<tbody id="listOfModules">
|
||||||
<?php echo $dolistore->get_products($categorie); ?>
|
<?php echo $dolistore->get_products(!empty($categorie) ? $categorie: ''); ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@ -1080,28 +1086,36 @@ if ($mode == 'deploy') {
|
|||||||
$max = $conf->global->MAIN_UPLOAD_DOC; // In Kb
|
$max = $conf->global->MAIN_UPLOAD_DOC; // In Kb
|
||||||
$maxphp = @ini_get('upload_max_filesize'); // In unknown
|
$maxphp = @ini_get('upload_max_filesize'); // In unknown
|
||||||
if (preg_match('/k$/i', $maxphp)) {
|
if (preg_match('/k$/i', $maxphp)) {
|
||||||
|
$maxphp = preg_replace('/k$/i', '', $maxphp);
|
||||||
$maxphp = $maxphp * 1;
|
$maxphp = $maxphp * 1;
|
||||||
}
|
}
|
||||||
if (preg_match('/m$/i', $maxphp)) {
|
if (preg_match('/m$/i', $maxphp)) {
|
||||||
|
$maxphp = preg_replace('/m$/i', '', $maxphp);
|
||||||
$maxphp = $maxphp * 1024;
|
$maxphp = $maxphp * 1024;
|
||||||
}
|
}
|
||||||
if (preg_match('/g$/i', $maxphp)) {
|
if (preg_match('/g$/i', $maxphp)) {
|
||||||
|
$maxphp = preg_replace('/g$/i', '', $maxphp);
|
||||||
$maxphp = $maxphp * 1024 * 1024;
|
$maxphp = $maxphp * 1024 * 1024;
|
||||||
}
|
}
|
||||||
if (preg_match('/t$/i', $maxphp)) {
|
if (preg_match('/t$/i', $maxphp)) {
|
||||||
|
$maxphp = preg_replace('/t$/i', '', $maxphp);
|
||||||
$maxphp = $maxphp * 1024 * 1024 * 1024;
|
$maxphp = $maxphp * 1024 * 1024 * 1024;
|
||||||
}
|
}
|
||||||
$maxphp2 = @ini_get('post_max_size'); // In unknown
|
$maxphp2 = @ini_get('post_max_size'); // In unknown
|
||||||
if (preg_match('/k$/i', $maxphp2)) {
|
if (preg_match('/k$/i', $maxphp2)) {
|
||||||
|
$maxphp2 = preg_replace('/k$/i', '', $maxphp2);
|
||||||
$maxphp2 = $maxphp2 * 1;
|
$maxphp2 = $maxphp2 * 1;
|
||||||
}
|
}
|
||||||
if (preg_match('/m$/i', $maxphp2)) {
|
if (preg_match('/m$/i', $maxphp2)) {
|
||||||
|
$maxphp2 = preg_replace('/m$/i', '', $maxphp2);
|
||||||
$maxphp2 = $maxphp2 * 1024;
|
$maxphp2 = $maxphp2 * 1024;
|
||||||
}
|
}
|
||||||
if (preg_match('/g$/i', $maxphp2)) {
|
if (preg_match('/g$/i', $maxphp2)) {
|
||||||
|
$maxphp2 = preg_replace('/g$/i', '', $maxphp2);
|
||||||
$maxphp2 = $maxphp2 * 1024 * 1024;
|
$maxphp2 = $maxphp2 * 1024 * 1024;
|
||||||
}
|
}
|
||||||
if (preg_match('/t$/i', $maxphp2)) {
|
if (preg_match('/t$/i', $maxphp2)) {
|
||||||
|
$maxphp2 = preg_replace('/t$/i', '', $maxphp2);
|
||||||
$maxphp2 = $maxphp2 * 1024 * 1024 * 1024;
|
$maxphp2 = $maxphp2 * 1024 * 1024 * 1024;
|
||||||
}
|
}
|
||||||
// Now $max and $maxphp and $maxphp2 are in Kb
|
// Now $max and $maxphp and $maxphp2 are in Kb
|
||||||
|
|||||||
@ -95,37 +95,37 @@ if (empty($action) || $action == 'edit' || $action == 'updateedit')
|
|||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $form->textwithpicto($langs->trans("Monday"), $langs->trans("OpeningHoursFormatDesc"));
|
print $form->textwithpicto($langs->trans("Monday"), $langs->trans("OpeningHoursFormatDesc"));
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print '<input name="monday" id="monday" class="minwidth100" value="'.($conf->global->MAIN_INFO_OPENINGHOURS_MONDAY ? $conf->global->MAIN_INFO_OPENINGHOURS_MONDAY : GETPOST("monday", 'alpha')).'"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'></td></tr>'."\n";
|
print '<input name="monday" id="monday" class="minwidth100" value="'.(!empty($conf->global->MAIN_INFO_OPENINGHOURS_MONDAY) ? $conf->global->MAIN_INFO_OPENINGHOURS_MONDAY : GETPOST("monday", 'alpha')).'"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'></td></tr>'."\n";
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $form->textwithpicto($langs->trans("Tuesday"), $langs->trans("OpeningHoursFormatDesc"));
|
print $form->textwithpicto($langs->trans("Tuesday"), $langs->trans("OpeningHoursFormatDesc"));
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print '<input name="tuesday" id="tuesday" class="minwidth100" value="'.($conf->global->MAIN_INFO_OPENINGHOURS_TUESDAY ? $conf->global->MAIN_INFO_OPENINGHOURS_TUESDAY : GETPOST("tuesday", 'alpha')).'"></td></tr>'."\n";
|
print '<input name="tuesday" id="tuesday" class="minwidth100" value="'.(!empty($conf->global->MAIN_INFO_OPENINGHOURS_TUESDAY) ? $conf->global->MAIN_INFO_OPENINGHOURS_TUESDAY : GETPOST("tuesday", 'alpha')).'"></td></tr>'."\n";
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $form->textwithpicto($langs->trans("Wednesday"), $langs->trans("OpeningHoursFormatDesc"));
|
print $form->textwithpicto($langs->trans("Wednesday"), $langs->trans("OpeningHoursFormatDesc"));
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print '<input name="wednesday" id="wednesday" class="minwidth100" value="'.($conf->global->MAIN_INFO_OPENINGHOURS_WEDNESDAY ? $conf->global->MAIN_INFO_OPENINGHOURS_WEDNESDAY : GETPOST("wednesday", 'alpha')).'"></td></tr>'."\n";
|
print '<input name="wednesday" id="wednesday" class="minwidth100" value="'.(!empty($conf->global->MAIN_INFO_OPENINGHOURS_WEDNESDAY) ? $conf->global->MAIN_INFO_OPENINGHOURS_WEDNESDAY : GETPOST("wednesday", 'alpha')).'"></td></tr>'."\n";
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $form->textwithpicto($langs->trans("Thursday"), $langs->trans("OpeningHoursFormatDesc"));
|
print $form->textwithpicto($langs->trans("Thursday"), $langs->trans("OpeningHoursFormatDesc"));
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print '<input name="thursday" id="thursday" class="minwidth100" value="'.($conf->global->MAIN_INFO_OPENINGHOURS_THURSDAY ? $conf->global->MAIN_INFO_OPENINGHOURS_THURSDAY : GETPOST("thursday", 'alpha')).'"></td></tr>'."\n";
|
print '<input name="thursday" id="thursday" class="minwidth100" value="'.(!empty($conf->global->MAIN_INFO_OPENINGHOURS_THURSDAY) ? $conf->global->MAIN_INFO_OPENINGHOURS_THURSDAY : GETPOST("thursday", 'alpha')).'"></td></tr>'."\n";
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $form->textwithpicto($langs->trans("Friday"), $langs->trans("OpeningHoursFormatDesc"));
|
print $form->textwithpicto($langs->trans("Friday"), $langs->trans("OpeningHoursFormatDesc"));
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print '<input name="friday" id="friday" class="minwidth100" value="'.($conf->global->MAIN_INFO_OPENINGHOURS_FRIDAY ? $conf->global->MAIN_INFO_OPENINGHOURS_FRIDAY : GETPOST("friday", 'alpha')).'"></td></tr>'."\n";
|
print '<input name="friday" id="friday" class="minwidth100" value="'.(!empty($conf->global->MAIN_INFO_OPENINGHOURS_FRIDAY) ? $conf->global->MAIN_INFO_OPENINGHOURS_FRIDAY : GETPOST("friday", 'alpha')).'"></td></tr>'."\n";
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $form->textwithpicto($langs->trans("Saturday"), $langs->trans("OpeningHoursFormatDesc"));
|
print $form->textwithpicto($langs->trans("Saturday"), $langs->trans("OpeningHoursFormatDesc"));
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print '<input name="saturday" id="saturday" class="minwidth100" value="'.($conf->global->MAIN_INFO_OPENINGHOURS_SATURDAY ? $conf->global->MAIN_INFO_OPENINGHOURS_SATURDAY : GETPOST("saturday", 'alpha')).'"></td></tr>'."\n";
|
print '<input name="saturday" id="saturday" class="minwidth100" value="'.(!empty($conf->global->MAIN_INFO_OPENINGHOURS_SATURDAY) ? $conf->global->MAIN_INFO_OPENINGHOURS_SATURDAY : GETPOST("saturday", 'alpha')).'"></td></tr>'."\n";
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $form->textwithpicto($langs->trans("Sunday"), $langs->trans("OpeningHoursFormatDesc"));
|
print $form->textwithpicto($langs->trans("Sunday"), $langs->trans("OpeningHoursFormatDesc"));
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print '<input name="sunday" id="sunday" class="minwidth100" value="'.($conf->global->MAIN_INFO_OPENINGHOURS_SUNDAY ? $conf->global->MAIN_INFO_OPENINGHOURS_SUNDAY : GETPOST("sunday", 'alpha')).'"></td></tr>'."\n";
|
print '<input name="sunday" id="sunday" class="minwidth100" value="'.(!empty($conf->global->MAIN_INFO_OPENINGHOURS_SUNDAY) ? $conf->global->MAIN_INFO_OPENINGHOURS_SUNDAY : GETPOST("sunday", 'alpha')).'"></td></tr>'."\n";
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
|||||||
@ -161,7 +161,7 @@ print '<div class="div-table-responsive-no-min">';
|
|||||||
print '<table summary="more" class="noborder centpercent">';
|
print '<table summary="more" class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
||||||
|
|
||||||
$selected = $conf->global->MAIN_PDF_FORMAT;
|
$selected = (isset($conf->global->MAIN_PDF_FORMAT) ? $conf->global->MAIN_PDF_FORMAT : '');
|
||||||
if (empty($selected)) $selected = dol_getDefaultFormat();
|
if (empty($selected)) $selected = dol_getDefaultFormat();
|
||||||
|
|
||||||
// Show pdf format
|
// Show pdf format
|
||||||
@ -320,13 +320,13 @@ print '</td></tr>';
|
|||||||
|
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("ShowDetailsInPDFPageFoot").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("ShowDetailsInPDFPageFoot").'</td><td>';
|
||||||
print $form->selectarray('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', $arraydetailsforpdffoot, $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS);
|
print $form->selectarray('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', $arraydetailsforpdffoot, (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS : 0));
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("PDF_USE_ALSO_LANGUAGE_CODE").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("PDF_USE_ALSO_LANGUAGE_CODE").'</td><td>';
|
||||||
//if (! empty($conf->global->MAIN_MULTILANGS))
|
//if (! empty($conf->global->MAIN_MULTILANGS))
|
||||||
//{
|
//{
|
||||||
print $formadmin->select_language(GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE') ? GETPOST('PDF_USE_ALSO_LANGUAGE_CODE') : $conf->global->PDF_USE_ALSO_LANGUAGE_CODE, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, null, 1);
|
print $formadmin->select_language(GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE') ? GETPOST('PDF_USE_ALSO_LANGUAGE_CODE') : (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) ? $conf->global->PDF_USE_ALSO_LANGUAGE_CODE : 0), 'PDF_USE_ALSO_LANGUAGE_CODE', 0, null, 1);
|
||||||
//} else {
|
//} else {
|
||||||
// print '<span class="opacitymedium">'.$langs->trans("MultiLangNotEnabled").'</span>';
|
// print '<span class="opacitymedium">'.$langs->trans("MultiLangNotEnabled").'</span>';
|
||||||
//}
|
//}
|
||||||
|
|||||||
@ -166,7 +166,7 @@ if ($result)
|
|||||||
if (is_object($modules[$obj->module]) && ($modules[$obj->module]->module_position > 0))
|
if (is_object($modules[$obj->module]) && ($modules[$obj->module]->module_position > 0))
|
||||||
{
|
{
|
||||||
// TODO Define familyposition
|
// TODO Define familyposition
|
||||||
$family = $modules[$obj->module]->family_position;
|
$family = (!empty($modules[$obj->module]->family_position) ? $modules[$obj->module]->family_position : '');
|
||||||
$familyposition = 0;
|
$familyposition = 0;
|
||||||
$sqlupdate = 'UPDATE '.MAIN_DB_PREFIX."rights_def SET module_position = ".$modules[$obj->module]->module_position.",";
|
$sqlupdate = 'UPDATE '.MAIN_DB_PREFIX."rights_def SET module_position = ".$modules[$obj->module]->module_position.",";
|
||||||
$sqlupdate .= " family_position = ".$familyposition;
|
$sqlupdate .= " family_position = ".$familyposition;
|
||||||
@ -214,7 +214,7 @@ if ($result)
|
|||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$perm_libelle = ($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $obj->label));
|
$perm_libelle = (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $obj->label));
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
|
|||||||
@ -155,7 +155,7 @@ print '<tr class="oddeven">';
|
|||||||
print '<td>'.$langs->trans("MAIN_PROXY_USE").'</td><td class="right">';
|
print '<td>'.$langs->trans("MAIN_PROXY_USE").'</td><td class="right">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
print $form->selectyesno('MAIN_PROXY_USE', $conf->global->MAIN_PROXY_USE, 1);
|
print $form->selectyesno('MAIN_PROXY_USE', (!empty($conf->global->MAIN_PROXY_USE) ? $conf->global->MAIN_PROXY_USE : 0), 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@ -164,7 +164,7 @@ print '<tr class="oddeven">';
|
|||||||
print '<td>'.$langs->trans("MAIN_PROXY_HOST").'</td><td class="right">';
|
print '<td>'.$langs->trans("MAIN_PROXY_HOST").'</td><td class="right">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
print '<input class="flat" name="MAIN_PROXY_HOST" type="text" size="16" value="'.$conf->global->MAIN_PROXY_HOST.'">';
|
print '<input class="flat" name="MAIN_PROXY_HOST" type="text" size="16" value="'.(!empty($conf->global->MAIN_PROXY_HOST) ? $conf->global->MAIN_PROXY_HOST : '').'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@ -173,7 +173,7 @@ print '<tr class="oddeven">';
|
|||||||
print '<td>'.$langs->trans("MAIN_PROXY_PORT").'</td><td class="right">';
|
print '<td>'.$langs->trans("MAIN_PROXY_PORT").'</td><td class="right">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
print '<input class="flat" name="MAIN_PROXY_PORT" type="text" size="4" value="'.$conf->global->MAIN_PROXY_PORT.'">';
|
print '<input class="flat" name="MAIN_PROXY_PORT" type="text" size="4" value="'.(!empty($conf->global->MAIN_PROXY_PORT) ? $conf->global->MAIN_PROXY_PORT : '').'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@ -182,7 +182,7 @@ print '<tr class="oddeven">';
|
|||||||
print '<td>'.$langs->trans("MAIN_PROXY_USER").'</td><td class="right">';
|
print '<td>'.$langs->trans("MAIN_PROXY_USER").'</td><td class="right">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
print '<input class="flat" name="MAIN_PROXY_USER" type="text" size="16" value="'.$conf->global->MAIN_PROXY_USER.'">';
|
print '<input class="flat" name="MAIN_PROXY_USER" type="text" size="16" value="'.(!empty($conf->global->MAIN_PROXY_USER) ? $conf->global->MAIN_PROXY_USER : '').'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@ -191,7 +191,7 @@ print '<tr class="oddeven">';
|
|||||||
print '<td>'.$langs->trans("MAIN_PROXY_PASS").'</td><td class="right">';
|
print '<td>'.$langs->trans("MAIN_PROXY_PASS").'</td><td class="right">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
print '<input class="flat" name="MAIN_PROXY_PASS" type="text" size="16" value="'.$conf->global->MAIN_PROXY_PASS.'">';
|
print '<input class="flat" name="MAIN_PROXY_PASS" type="text" size="16" value="'.(!empty($conf->global->MAIN_PROXY_PASS) ? $conf->global->MAIN_PROXY_PASS : '').'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|||||||
@ -241,8 +241,8 @@ print '</tr>';
|
|||||||
foreach ($arrayhandler as $key => $module)
|
foreach ($arrayhandler as $key => $module)
|
||||||
{
|
{
|
||||||
// Show modules according to features level
|
// Show modules according to features level
|
||||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
|
if (!empty($module->version) && $module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
|
||||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
|
if (!empty($module->version) && $module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
|
||||||
|
|
||||||
if ($module->isEnabled())
|
if ($module->isEnabled())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -116,7 +116,7 @@ print '</tr>';
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td colspan="2">'.$langs->trans("MaxSizeForUploadedFiles").'.';
|
print '<td colspan="2">'.$langs->trans("MaxSizeForUploadedFiles").'.';
|
||||||
$max = @ini_get('upload_max_filesize');
|
$max = @ini_get('upload_max_filesize');
|
||||||
if ($max) print ' '.$langs->trans("MustBeLowerThanPHPLimit", $max * 1024, $langs->trans("Kb")).'.';
|
if (isset($max)) print ' '.$langs->trans("MustBeLowerThanPHPLimit", ((int) $max) * 1024, $langs->trans("Kb")).'.';
|
||||||
else print ' '.$langs->trans("NoMaxSizeByPHPLimit").'.';
|
else print ' '.$langs->trans("NoMaxSizeByPHPLimit").'.';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
|
|||||||
@ -51,15 +51,39 @@ if (isset($title))
|
|||||||
|
|
||||||
// Check PHP setup is OK
|
// Check PHP setup is OK
|
||||||
$maxphp = @ini_get('upload_max_filesize'); // In unknown
|
$maxphp = @ini_get('upload_max_filesize'); // In unknown
|
||||||
if (preg_match('/k$/i', $maxphp)) $maxphp = $maxphp * 1;
|
if (preg_match('/k$/i', $maxphp)) {
|
||||||
if (preg_match('/m$/i', $maxphp)) $maxphp = $maxphp * 1024;
|
$maxphp = preg_replace('/k$/i', '', $maxphp);
|
||||||
if (preg_match('/g$/i', $maxphp)) $maxphp = $maxphp * 1024 * 1024;
|
$maxphp = $maxphp * 1;
|
||||||
if (preg_match('/t$/i', $maxphp)) $maxphp = $maxphp * 1024 * 1024 * 1024;
|
}
|
||||||
|
if (preg_match('/m$/i', $maxphp)) {
|
||||||
|
$maxphp = preg_replace('/m$/i', '', $maxphp);
|
||||||
|
$maxphp = $maxphp * 1024;
|
||||||
|
}
|
||||||
|
if (preg_match('/g$/i', $maxphp)) {
|
||||||
|
$maxphp = preg_replace('/g$/i', '', $maxphp);
|
||||||
|
$maxphp = $maxphp * 1024 * 1024;
|
||||||
|
}
|
||||||
|
if (preg_match('/t$/i', $maxphp)) {
|
||||||
|
$maxphp = preg_replace('/t$/i', '', $maxphp);
|
||||||
|
$maxphp = $maxphp * 1024 * 1024 * 1024;
|
||||||
|
}
|
||||||
$maxphp2 = @ini_get('post_max_size'); // In unknown
|
$maxphp2 = @ini_get('post_max_size'); // In unknown
|
||||||
if (preg_match('/k$/i', $maxphp2)) $maxphp2 = $maxphp2 * 1;
|
if (preg_match('/k$/i', $maxphp2)) {
|
||||||
if (preg_match('/m$/i', $maxphp2)) $maxphp2 = $maxphp2 * 1024;
|
$maxphp2 = preg_replace('/k$/i', '', $maxphp2);
|
||||||
if (preg_match('/g$/i', $maxphp2)) $maxphp2 = $maxphp2 * 1024 * 1024;
|
$maxphp2 = $maxphp2 * 1;
|
||||||
if (preg_match('/t$/i', $maxphp2)) $maxphp2 = $maxphp2 * 1024 * 1024 * 1024;
|
}
|
||||||
|
if (preg_match('/m$/i', $maxphp2)) {
|
||||||
|
$maxphp2 = preg_replace('/m$/i', '', $maxphp2);
|
||||||
|
$maxphp2 = $maxphp2 * 1024;
|
||||||
|
}
|
||||||
|
if (preg_match('/g$/i', $maxphp2)) {
|
||||||
|
$maxphp2 = preg_replace('/g$/i', '', $maxphp2);
|
||||||
|
$maxphp2 = $maxphp2 * 1024 * 1024;
|
||||||
|
}
|
||||||
|
if (preg_match('/t$/i', $maxphp2)) {
|
||||||
|
$maxphp2 = preg_replace('/t$/i', '', $maxphp2);
|
||||||
|
$maxphp2 = $maxphp2 * 1024 * 1024 * 1024;
|
||||||
|
}
|
||||||
if ($maxphp > 0 && $maxphp2 > 0 && $maxphp > $maxphp2)
|
if ($maxphp > 0 && $maxphp2 > 0 && $maxphp > $maxphp2)
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
|
|||||||
@ -40,9 +40,9 @@ $transkey = GETPOST('transkey', 'alphanohtml');
|
|||||||
$transvalue = GETPOST('transvalue', 'restricthtml');
|
$transvalue = GETPOST('transvalue', 'restricthtml');
|
||||||
|
|
||||||
|
|
||||||
$mode = GETPOST('mode', 'aZ09') ?GETPOST('mode', 'aZ09') : 'searchkey';
|
$mode = GETPOST('mode', 'aZ09') ? GETPOST('mode', 'aZ09') : 'searchkey';
|
||||||
|
|
||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
@ -62,9 +62,9 @@ $hookmanager->initHooks(array('admintranslation', 'globaladmin'));
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; }
|
if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; }
|
||||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; }
|
if (!GETPOST('confirmmassaction', 'alpha') && !empty($massaction) && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; }
|
||||||
|
|
||||||
$parameters = array('socid'=>$socid);
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
@ -217,14 +217,14 @@ print '<br>';
|
|||||||
|
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
||||||
if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
|
if (isset($optioncss) && $optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
|
||||||
if ($langcode) $param .= '&langcode='.urlencode($langcode);
|
if ($langcode) $param .= '&langcode='.urlencode($langcode);
|
||||||
if ($transkey) $param .= '&transkey='.urlencode($transkey);
|
if ($transkey) $param .= '&transkey='.urlencode($transkey);
|
||||||
if ($transvalue) $param .= '&transvalue='.urlencode($transvalue);
|
if ($transvalue) $param .= '&transvalue='.urlencode($transvalue);
|
||||||
|
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && $debug) ? '?debug=1' : '').'" method="POST">';
|
print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && !empty($debug)) ? '?debug=1' : '').'" method="POST">';
|
||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
if (isset($optioncss) && $optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
@ -472,7 +472,7 @@ if ($mode == 'searchkey')
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
// Action column
|
// Action column
|
||||||
print '<td class="nowrap right">';
|
print '<td class="nowrap right">';
|
||||||
$searchpicto = $form->showFilterAndCheckAddButtons($massactionbutton ? 1 : 0, 'checkforselect', 1);
|
$searchpicto = $form->showFilterAndCheckAddButtons(!empty($massactionbutton) ? 1 : 0, 'checkforselect', 1);
|
||||||
print $searchpicto;
|
print $searchpicto;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@ -182,6 +182,8 @@ if (empty($reshook))
|
|||||||
unset($_POST['disable_stock_change']);
|
unset($_POST['disable_stock_change']);
|
||||||
|
|
||||||
$object->fetchLines();
|
$object->fetchLines();
|
||||||
|
|
||||||
|
$object->calculateCosts();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -222,6 +224,8 @@ if (empty($reshook))
|
|||||||
unset($_POST['disable_stock_change']);
|
unset($_POST['disable_stock_change']);
|
||||||
|
|
||||||
$object->fetchLines();
|
$object->fetchLines();
|
||||||
|
|
||||||
|
$object->calculateCosts();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -113,7 +113,6 @@ if (!empty($conf->global->PRODUCT_USE_UNITS))
|
|||||||
{
|
{
|
||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
print '<td class="nobottom linecoluseunit left">';
|
print '<td class="nobottom linecoluseunit left">';
|
||||||
// print $form->selectUnits(empty($line->fk_unit) ? $conf->global->PRODUCT_USE_UNITS : $line->fk_unit, "units");
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -112,7 +112,6 @@ if (!empty($conf->global->PRODUCT_USE_UNITS))
|
|||||||
{
|
{
|
||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
print '<td class="nobottom linecoluseunit left">';
|
print '<td class="nobottom linecoluseunit left">';
|
||||||
// print $form->selectUnits($line->fk_unit, "units");
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -87,7 +87,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
$hookmanager->initHooks(array('thirdpartycomm', 'globalcard'));
|
$hookmanager->initHooks(array('thirdpartycomm', 'globalcard'));
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', 0);
|
$result = restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid', 0);
|
||||||
|
|
||||||
if ($object->id > 0) {
|
if ($object->id > 0) {
|
||||||
if (!($object->client > 0) || empty($user->rights->societe->lire)) {
|
if (!($object->client > 0) || empty($user->rights->societe->lire)) {
|
||||||
|
|||||||
@ -796,7 +796,7 @@ if (empty($reshook))
|
|||||||
} elseif ($action == 'addline' && $usercancreate) { // Add line
|
} elseif ($action == 'addline' && $usercancreate) { // Add line
|
||||||
// Set if we used free entry or predefined product
|
// Set if we used free entry or predefined product
|
||||||
$predef = '';
|
$predef = '';
|
||||||
$product_desc = (GETPOSTISSET('dp_desc') ?GETPOST('dp_desc', 'restricthtml') : '');
|
$product_desc = (GETPOSTISSET('dp_desc') ? GETPOST('dp_desc', 'restricthtml') : '');
|
||||||
$price_ht = price2num(GETPOST('price_ht'));
|
$price_ht = price2num(GETPOST('price_ht'));
|
||||||
$price_ht_devise = price2num(GETPOST('multicurrency_price_ht'));
|
$price_ht_devise = price2num(GETPOST('multicurrency_price_ht'));
|
||||||
$prod_entry_mode = GETPOST('prod_entry_mode');
|
$prod_entry_mode = GETPOST('prod_entry_mode');
|
||||||
@ -999,11 +999,16 @@ if (empty($reshook))
|
|||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
}
|
}
|
||||||
|
|
||||||
$desc = (!empty($prod->multilangs [$outputlangs->defaultlang] ["description"])) ? $prod->multilangs [$outputlangs->defaultlang] ["description"] : $prod->description;
|
$desc = (!empty($prod->multilangs[$outputlangs->defaultlang]["description"])) ? $prod->multilangs[$outputlangs->defaultlang]["description"] : $prod->description;
|
||||||
} else {
|
} else {
|
||||||
$desc = $prod->description;
|
$desc = $prod->description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//If text set in desc is the same as product description (as now it's preloaded) whe add it only one time
|
||||||
|
if ($product_desc==$desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) {
|
||||||
|
$product_desc='';
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc = $product_desc;
|
if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc = $product_desc;
|
||||||
else $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
|
else $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
|
||||||
|
|
||||||
|
|||||||
@ -47,6 +47,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
|||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('companies', 'propal', 'compta', 'bills', 'orders', 'products', 'deliveries', 'categories'));
|
$langs->loadLangs(array('companies', 'propal', 'compta', 'bills', 'orders', 'products', 'deliveries', 'categories'));
|
||||||
|
if (!empty($conf->expedition->enabled)) $langs->loadLangs(array('sendings'));
|
||||||
|
|
||||||
$socid = GETPOST('socid', 'int');
|
$socid = GETPOST('socid', 'int');
|
||||||
|
|
||||||
@ -89,6 +90,9 @@ $search_datedelivery_start = dol_mktime(0, 0, 0, GETPOST('search_datedelivery_st
|
|||||||
$search_datedelivery_end = dol_mktime(23, 59, 59, GETPOST('search_datedelivery_endmonth', 'int'), GETPOST('search_datedelivery_endday', 'int'), GETPOST('search_datedelivery_endyear', 'int'));
|
$search_datedelivery_end = dol_mktime(23, 59, 59, GETPOST('search_datedelivery_endmonth', 'int'), GETPOST('search_datedelivery_endday', 'int'), GETPOST('search_datedelivery_endyear', 'int'));
|
||||||
$search_availability = GETPOST('search_availability', 'int');
|
$search_availability = GETPOST('search_availability', 'int');
|
||||||
$search_categ_cus = GETPOST("search_categ_cus", 'int');
|
$search_categ_cus = GETPOST("search_categ_cus", 'int');
|
||||||
|
$search_fk_cond_reglement = GETPOST("search_fk_cond_reglement", 'int');
|
||||||
|
$search_fk_shipping_method = GETPOST("search_fk_shipping_method", 'int');
|
||||||
|
$search_fk_mode_reglement = GETPOST("search_fk_mode_reglement", 'int');
|
||||||
$search_btn = GETPOST('button_search', 'alpha');
|
$search_btn = GETPOST('button_search', 'alpha');
|
||||||
$search_remove_btn = GETPOST('button_removefilter', 'alpha');
|
$search_remove_btn = GETPOST('button_removefilter', 'alpha');
|
||||||
|
|
||||||
@ -166,6 +170,9 @@ $arrayfields = array(
|
|||||||
'p.fin_validite'=>array('label'=>"DateEnd", 'checked'=>1),
|
'p.fin_validite'=>array('label'=>"DateEnd", 'checked'=>1),
|
||||||
'p.date_livraison'=>array('label'=>"DeliveryDate", 'checked'=>0),
|
'p.date_livraison'=>array('label'=>"DeliveryDate", 'checked'=>0),
|
||||||
'ava.rowid'=>array('label'=>"AvailabilityPeriod", 'checked'=>0),
|
'ava.rowid'=>array('label'=>"AvailabilityPeriod", 'checked'=>0),
|
||||||
|
'p.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>0, 'enabled'=>!empty($conf->expedition->enabled)),
|
||||||
|
'p.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>0),
|
||||||
|
'p.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>0),
|
||||||
'p.total_ht'=>array('label'=>"AmountHT", 'checked'=>1),
|
'p.total_ht'=>array('label'=>"AmountHT", 'checked'=>1),
|
||||||
'p.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0),
|
'p.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0),
|
||||||
'p.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0),
|
'p.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0),
|
||||||
@ -187,6 +194,7 @@ $arrayfields = array(
|
|||||||
'p.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES))),
|
'p.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES))),
|
||||||
'p.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
'p.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Extra fields
|
// 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';
|
||||||
|
|
||||||
@ -243,6 +251,9 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
|||||||
$toselect = '';
|
$toselect = '';
|
||||||
$search_array_options = array();
|
$search_array_options = array();
|
||||||
$search_categ_cus = 0;
|
$search_categ_cus = 0;
|
||||||
|
$search_fk_cond_reglement = '';
|
||||||
|
$search_fk_shipping_method = '';
|
||||||
|
$search_fk_mode_reglement = '';
|
||||||
}
|
}
|
||||||
if ($object_statut != '') $search_status = $object_statut;
|
if ($object_statut != '') $search_status = $object_statut;
|
||||||
|
|
||||||
@ -286,6 +297,7 @@ $sql .= ' p.rowid, p.entity, p.note_private, p.total_ht, p.tva as total_vat, p.t
|
|||||||
$sql .= ' p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva as multicurrency_total_vat, p.multicurrency_total_ttc,';
|
$sql .= ' p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva as multicurrency_total_vat, p.multicurrency_total_ttc,';
|
||||||
$sql .= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date_cloture,';
|
$sql .= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date_cloture,';
|
||||||
$sql .= ' p.note_public, p.note_private,';
|
$sql .= ' p.note_public, p.note_private,';
|
||||||
|
$sql .= ' p.fk_cond_reglement,p.fk_mode_reglement,p.fk_shipping_method,';
|
||||||
$sql .= " pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,";
|
$sql .= " pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,";
|
||||||
$sql .= ' u.login';
|
$sql .= ' u.login';
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user";
|
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user";
|
||||||
@ -352,6 +364,10 @@ if ($sall) {
|
|||||||
if ($search_categ_cus > 0) $sql .= " AND cc.fk_categorie = ".$db->escape($search_categ_cus);
|
if ($search_categ_cus > 0) $sql .= " AND cc.fk_categorie = ".$db->escape($search_categ_cus);
|
||||||
if ($search_categ_cus == -2) $sql .= " AND cc.fk_categorie IS NULL";
|
if ($search_categ_cus == -2) $sql .= " AND cc.fk_categorie IS NULL";
|
||||||
|
|
||||||
|
if ($search_fk_cond_reglement > 0) $sql .= " AND p.fk_cond_reglement = ".$db->escape($search_fk_cond_reglement);
|
||||||
|
if ($search_fk_shipping_method > 0) $sql .= " AND p.fk_shipping_method = ".$db->escape($search_fk_shipping_method);
|
||||||
|
if ($search_fk_mode_reglement > 0) $sql .= " AND p.fk_mode_reglement = ".$db->escape($search_fk_mode_reglement);
|
||||||
|
|
||||||
if ($search_product_category > 0) $sql .= " AND cp.fk_categorie = ".$db->escape($search_product_category);
|
if ($search_product_category > 0) $sql .= " AND cp.fk_categorie = ".$db->escape($search_product_category);
|
||||||
if ($socid > 0) $sql .= ' AND s.rowid = '.$socid;
|
if ($socid > 0) $sql .= ' AND s.rowid = '.$socid;
|
||||||
if ($search_status != '' && $search_status != '-1')
|
if ($search_status != '' && $search_status != '-1')
|
||||||
@ -458,6 +474,9 @@ if ($resql)
|
|||||||
if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
|
if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
|
||||||
if ($search_categ_cus > 0) $param .= '&search_categ_cus='.urlencode($search_categ_cus);
|
if ($search_categ_cus > 0) $param .= '&search_categ_cus='.urlencode($search_categ_cus);
|
||||||
if ($search_product_category != '') $param .= '&search_product_category='.$search_product_category;
|
if ($search_product_category != '') $param .= '&search_product_category='.$search_product_category;
|
||||||
|
if ($search_fk_cond_reglement > 0) $param .= '&search_fk_cond_reglement='.$search_fk_cond_reglement;
|
||||||
|
if ($search_fk_shipping_method > 0) $param .= '&search_fk_shipping_method='.$search_fk_shipping_method;
|
||||||
|
if ($search_fk_mode_reglement > 0) $param .= '&search_fk_mode_reglement='.$search_fk_mode_reglement;
|
||||||
|
|
||||||
// Add $param from extra fields
|
// Add $param from extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||||
@ -670,6 +689,27 @@ if ($resql)
|
|||||||
print ajax_combobox('search_availability');
|
print ajax_combobox('search_availability');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
// Shipping Method
|
||||||
|
if (!empty($arrayfields['p.fk_shipping_method']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre">';
|
||||||
|
$form->selectShippingMethod($search_fk_shipping_method, 'search_fk_shipping_method', '', 1, '', 1);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
// Payment term
|
||||||
|
if (!empty($arrayfields['p.fk_cond_reglement']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre">';
|
||||||
|
$form->select_conditions_paiements($search_fk_cond_reglement, 'search_fk_cond_reglement', -1, 1, 1);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
// Payment mode
|
||||||
|
if (!empty($arrayfields['p.fk_mode_reglement']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre">';
|
||||||
|
$form->select_types_paiements($search_fk_mode_reglement, 'search_fk_mode_reglement', '', 0, 1, 1, 0, -1);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
if (!empty($arrayfields['p.total_ht']['checked']))
|
if (!empty($arrayfields['p.total_ht']['checked']))
|
||||||
{
|
{
|
||||||
// Amount
|
// Amount
|
||||||
@ -830,6 +870,9 @@ if ($resql)
|
|||||||
if (!empty($arrayfields['p.fin_validite']['checked'])) print_liste_field_titre($arrayfields['p.fin_validite']['label'], $_SERVER["PHP_SELF"], 'dfv', '', $param, 'align="center"', $sortfield, $sortorder);
|
if (!empty($arrayfields['p.fin_validite']['checked'])) print_liste_field_titre($arrayfields['p.fin_validite']['label'], $_SERVER["PHP_SELF"], 'dfv', '', $param, 'align="center"', $sortfield, $sortorder);
|
||||||
if (!empty($arrayfields['p.date_livraison']['checked'])) print_liste_field_titre($arrayfields['p.date_livraison']['label'], $_SERVER["PHP_SELF"], 'ddelivery', '', $param, 'align="center"', $sortfield, $sortorder);
|
if (!empty($arrayfields['p.date_livraison']['checked'])) print_liste_field_titre($arrayfields['p.date_livraison']['label'], $_SERVER["PHP_SELF"], 'ddelivery', '', $param, 'align="center"', $sortfield, $sortorder);
|
||||||
if (!empty($arrayfields['ava.rowid']['checked'])) print_liste_field_titre($arrayfields['ava.rowid']['label'], $_SERVER["PHP_SELF"], 'availability', '', $param, '', $sortfield, $sortorder);
|
if (!empty($arrayfields['ava.rowid']['checked'])) print_liste_field_titre($arrayfields['ava.rowid']['label'], $_SERVER["PHP_SELF"], 'availability', '', $param, '', $sortfield, $sortorder);
|
||||||
|
if (!empty($arrayfields['p.fk_shipping_method']['checked'])) print_liste_field_titre($arrayfields['p.fk_shipping_method']['label'], $_SERVER["PHP_SELF"], "p.fk_shipping_method", "", $param, '', $sortfield, $sortorder);
|
||||||
|
if (!empty($arrayfields['p.fk_cond_reglement']['checked'])) print_liste_field_titre($arrayfields['p.fk_cond_reglement']['label'], $_SERVER["PHP_SELF"], "p.fk_cond_reglement", "", $param, '', $sortfield, $sortorder);
|
||||||
|
if (!empty($arrayfields['p.fk_mode_reglement']['checked'])) print_liste_field_titre($arrayfields['p.fk_mode_reglement']['label'], $_SERVER["PHP_SELF"], "p.fk_mode_reglement", "", $param, '', $sortfield, $sortorder);
|
||||||
if (!empty($arrayfields['p.total_ht']['checked'])) print_liste_field_titre($arrayfields['p.total_ht']['label'], $_SERVER["PHP_SELF"], 'p.total_ht', '', $param, 'class="right"', $sortfield, $sortorder);
|
if (!empty($arrayfields['p.total_ht']['checked'])) print_liste_field_titre($arrayfields['p.total_ht']['label'], $_SERVER["PHP_SELF"], 'p.total_ht', '', $param, 'class="right"', $sortfield, $sortorder);
|
||||||
if (!empty($arrayfields['p.total_vat']['checked'])) print_liste_field_titre($arrayfields['p.total_vat']['label'], $_SERVER["PHP_SELF"], 'p.tva', '', $param, 'class="right"', $sortfield, $sortorder);
|
if (!empty($arrayfields['p.total_vat']['checked'])) print_liste_field_titre($arrayfields['p.total_vat']['label'], $_SERVER["PHP_SELF"], 'p.tva', '', $param, 'class="right"', $sortfield, $sortorder);
|
||||||
if (!empty($arrayfields['p.total_ttc']['checked'])) print_liste_field_titre($arrayfields['p.total_ttc']['label'], $_SERVER["PHP_SELF"], 'p.total', '', $param, 'class="right"', $sortfield, $sortorder);
|
if (!empty($arrayfields['p.total_ttc']['checked'])) print_liste_field_titre($arrayfields['p.total_ttc']['label'], $_SERVER["PHP_SELF"], 'p.total', '', $param, 'class="right"', $sortfield, $sortorder);
|
||||||
@ -1064,7 +1107,30 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
//Shipping Method
|
||||||
|
if (!empty($arrayfields['p.fk_shipping_method']['checked']))
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
|
$form->formSelectShippingMethod('', $obj->fk_shipping_method, 'none', 1);
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
// Payment terms
|
||||||
|
if (!empty($arrayfields['p.fk_cond_reglement']['checked']))
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
|
$form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none');
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
// Payment mode
|
||||||
|
if (!empty($arrayfields['p.fk_mode_reglement']['checked']))
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
|
$form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1);
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
// Amount HT
|
// Amount HT
|
||||||
if (!empty($arrayfields['p.total_ht']['checked']))
|
if (!empty($arrayfields['p.total_ht']['checked']))
|
||||||
{
|
{
|
||||||
@ -1105,7 +1171,6 @@ if ($resql)
|
|||||||
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'p.total_invoiced';
|
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'p.total_invoiced';
|
||||||
$totalarray['val']['p.total_invoiced'] += $totalInvoicedTTC;
|
$totalarray['val']['p.total_invoiced'] += $totalInvoicedTTC;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Currency
|
// Currency
|
||||||
if (!empty($arrayfields['p.multicurrency_code']['checked']))
|
if (!empty($arrayfields['p.multicurrency_code']['checked']))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -846,6 +846,11 @@ if (empty($reshook))
|
|||||||
$desc = $prod->description;
|
$desc = $prod->description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//If text set in desc is the same as product descpription (as now it's preloaded) whe add it only one time
|
||||||
|
if ($product_desc==$desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) {
|
||||||
|
$product_desc='';
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc = $product_desc;
|
if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc = $product_desc;
|
||||||
else $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
|
else $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
|
||||||
|
|
||||||
|
|||||||
@ -95,7 +95,9 @@ $search_remove_btn = GETPOST('button_removefilter', 'alpha');
|
|||||||
$search_project_ref = GETPOST('search_project_ref', 'alpha');
|
$search_project_ref = GETPOST('search_project_ref', 'alpha');
|
||||||
$search_project = GETPOST('search_project', 'alpha');
|
$search_project = GETPOST('search_project', 'alpha');
|
||||||
$search_shippable = GETPOST('search_shippable', 'aZ09');
|
$search_shippable = GETPOST('search_shippable', 'aZ09');
|
||||||
|
$search_fk_cond_reglement = GETPOST("search_fk_cond_reglement", 'int');
|
||||||
|
$search_fk_shipping_method = GETPOST("search_fk_shipping_method", 'int');
|
||||||
|
$search_fk_mode_reglement = GETPOST("search_fk_mode_reglement", 'int');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$id = (GETPOST('orderid') ?GETPOST('orderid', 'int') : GETPOST('id', 'int'));
|
$id = (GETPOST('orderid') ?GETPOST('orderid', 'int') : GETPOST('id', 'int'));
|
||||||
@ -154,6 +156,9 @@ $arrayfields = array(
|
|||||||
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>55),
|
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>55),
|
||||||
'c.date_commande'=>array('label'=>"OrderDateShort", 'checked'=>1, 'position'=>60),
|
'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.date_delivery'=>array('label'=>"DateDeliveryPlanned", 'checked'=>1, 'enabled'=>empty($conf->global->ORDER_DISABLE_DELIVERY_DATE), 'position'=>65),
|
||||||
|
'c.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>0, 'position'=>66 , 'enabled'=>!empty($conf->expedition->enabled)),
|
||||||
|
'c.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>0, 'position'=>67),
|
||||||
|
'c.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>0, 'position'=>68),
|
||||||
'c.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>75),
|
'c.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>75),
|
||||||
'c.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>80),
|
'c.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>80),
|
||||||
'c.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>85),
|
'c.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>85),
|
||||||
@ -235,6 +240,9 @@ if (empty($reshook))
|
|||||||
$search_categ_cus = 0;
|
$search_categ_cus = 0;
|
||||||
$search_datecloture_start = '';
|
$search_datecloture_start = '';
|
||||||
$search_datecloture_end = '';
|
$search_datecloture_end = '';
|
||||||
|
$search_fk_cond_reglement = '';
|
||||||
|
$search_fk_shipping_method = '';
|
||||||
|
$search_fk_mode_reglement = '';
|
||||||
}
|
}
|
||||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
|
||||||
|| GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha'))
|
|| GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha'))
|
||||||
@ -280,7 +288,8 @@ $sql .= ' c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multic
|
|||||||
$sql .= ' c.date_valid, c.date_commande, c.note_public, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as billed,';
|
$sql .= ' c.date_valid, c.date_commande, c.note_public, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as billed,';
|
||||||
$sql .= ' c.date_creation as date_creation, c.tms as date_update, c.date_cloture as date_cloture,';
|
$sql .= ' c.date_creation as date_creation, c.tms as date_update, c.date_cloture as date_cloture,';
|
||||||
$sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label,";
|
$sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label,";
|
||||||
$sql .= " u.login";
|
$sql .= " u.login,";
|
||||||
|
$sql .= ' c.fk_cond_reglement,c.fk_mode_reglement,c.fk_shipping_method';
|
||||||
if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
|
if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
if (!empty($extrafields->attributes[$object->table_element]['label']))
|
if (!empty($extrafields->attributes[$object->table_element]['label']))
|
||||||
@ -369,6 +378,9 @@ if ($search_project_ref != '') $sql .= natural_search("p.ref", $se
|
|||||||
if ($search_project != '') $sql .= natural_search("p.title", $search_project);
|
if ($search_project != '') $sql .= natural_search("p.title", $search_project);
|
||||||
if ($search_categ_cus > 0) $sql .= " AND cc.fk_categorie = ".$db->escape($search_categ_cus);
|
if ($search_categ_cus > 0) $sql .= " AND cc.fk_categorie = ".$db->escape($search_categ_cus);
|
||||||
if ($search_categ_cus == -2) $sql .= " AND cc.fk_categorie IS NULL";
|
if ($search_categ_cus == -2) $sql .= " AND cc.fk_categorie IS NULL";
|
||||||
|
if ($search_fk_cond_reglement > 0) $sql .= " AND c.fk_cond_reglement = ".$db->escape($search_fk_cond_reglement);
|
||||||
|
if ($search_fk_shipping_method > 0) $sql .= " AND c.fk_shipping_method = ".$db->escape($search_fk_shipping_method);
|
||||||
|
if ($search_fk_mode_reglement > 0) $sql .= " AND c.fk_mode_reglement = ".$db->escape($search_fk_mode_reglement);
|
||||||
|
|
||||||
// Add where from extra fields
|
// Add where from extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||||
@ -478,6 +490,9 @@ if ($resql)
|
|||||||
if ($show_files) $param .= '&show_files='.urlencode($show_files);
|
if ($show_files) $param .= '&show_files='.urlencode($show_files);
|
||||||
if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
|
if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
|
||||||
if ($search_billed != '') $param .= '&search_billed='.urlencode($search_billed);
|
if ($search_billed != '') $param .= '&search_billed='.urlencode($search_billed);
|
||||||
|
if ($search_fk_cond_reglement > 0) $param .= '&search_fk_cond_reglement='.$search_fk_cond_reglement;
|
||||||
|
if ($search_fk_shipping_method > 0) $param .= '&search_fk_shipping_method='.$search_fk_shipping_method;
|
||||||
|
if ($search_fk_mode_reglement > 0) $param .= '&search_fk_mode_reglement='.$search_fk_mode_reglement;
|
||||||
|
|
||||||
// Add $param from extra fields
|
// Add $param from extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||||
@ -726,6 +741,27 @@ if ($resql)
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
// Shipping Method
|
||||||
|
if (!empty($arrayfields['c.fk_shipping_method']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre">';
|
||||||
|
$form->selectShippingMethod($search_fk_shipping_method, 'search_fk_shipping_method', '', 1, '', 1);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
// Payment term
|
||||||
|
if (!empty($arrayfields['c.fk_cond_reglement']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre">';
|
||||||
|
$form->select_conditions_paiements($search_fk_cond_reglement, 'search_fk_cond_reglement', -1, 1, 1);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
// Payment mode
|
||||||
|
if (!empty($arrayfields['c.fk_mode_reglement']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre">';
|
||||||
|
$form->select_types_paiements($search_fk_mode_reglement, 'search_fk_mode_reglement', '', 0, 1, 1, 0, -1);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
if (!empty($arrayfields['c.total_ht']['checked']))
|
if (!empty($arrayfields['c.total_ht']['checked']))
|
||||||
{
|
{
|
||||||
// Amount
|
// Amount
|
||||||
@ -888,6 +924,9 @@ if ($resql)
|
|||||||
if (!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center ');
|
if (!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
if (!empty($arrayfields['c.date_commande']['checked'])) print_liste_field_titre($arrayfields['c.date_commande']['label'], $_SERVER["PHP_SELF"], 'c.date_commande', '', $param, '', $sortfield, $sortorder, 'center ');
|
if (!empty($arrayfields['c.date_commande']['checked'])) print_liste_field_titre($arrayfields['c.date_commande']['label'], $_SERVER["PHP_SELF"], 'c.date_commande', '', $param, '', $sortfield, $sortorder, 'center ');
|
||||||
if (!empty($arrayfields['c.date_delivery']['checked'])) print_liste_field_titre($arrayfields['c.date_delivery']['label'], $_SERVER["PHP_SELF"], 'c.date_livraison', '', $param, '', $sortfield, $sortorder, 'center ');
|
if (!empty($arrayfields['c.date_delivery']['checked'])) print_liste_field_titre($arrayfields['c.date_delivery']['label'], $_SERVER["PHP_SELF"], 'c.date_livraison', '', $param, '', $sortfield, $sortorder, 'center ');
|
||||||
|
if (!empty($arrayfields['c.fk_shipping_method']['checked'])) print_liste_field_titre($arrayfields['c.fk_shipping_method']['label'], $_SERVER["PHP_SELF"], "c.fk_shipping_method", "", $param, '', $sortfield, $sortorder);
|
||||||
|
if (!empty($arrayfields['c.fk_cond_reglement']['checked'])) print_liste_field_titre($arrayfields['c.fk_cond_reglement']['label'], $_SERVER["PHP_SELF"], "c.fk_cond_reglement", "", $param, '', $sortfield, $sortorder);
|
||||||
|
if (!empty($arrayfields['c.fk_mode_reglement']['checked'])) print_liste_field_titre($arrayfields['c.fk_mode_reglement']['label'], $_SERVER["PHP_SELF"], "c.fk_mode_reglement", "", $param, '', $sortfield, $sortorder);
|
||||||
if (!empty($arrayfields['c.total_ht']['checked'])) print_liste_field_titre($arrayfields['c.total_ht']['label'], $_SERVER["PHP_SELF"], 'c.total_ht', '', $param, '', $sortfield, $sortorder, 'right ');
|
if (!empty($arrayfields['c.total_ht']['checked'])) print_liste_field_titre($arrayfields['c.total_ht']['label'], $_SERVER["PHP_SELF"], 'c.total_ht', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||||
if (!empty($arrayfields['c.total_vat']['checked'])) print_liste_field_titre($arrayfields['c.total_vat']['label'], $_SERVER["PHP_SELF"], 'c.tva', '', $param, '', $sortfield, $sortorder, 'right ');
|
if (!empty($arrayfields['c.total_vat']['checked'])) print_liste_field_titre($arrayfields['c.total_vat']['label'], $_SERVER["PHP_SELF"], 'c.tva', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||||
if (!empty($arrayfields['c.total_ttc']['checked'])) print_liste_field_titre($arrayfields['c.total_ttc']['label'], $_SERVER["PHP_SELF"], 'c.total_ttc', '', $param, '', $sortfield, $sortorder, 'right ');
|
if (!empty($arrayfields['c.total_ttc']['checked'])) print_liste_field_titre($arrayfields['c.total_ttc']['label'], $_SERVER["PHP_SELF"], 'c.total_ttc', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||||
@ -1094,6 +1133,30 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
//Shipping Method
|
||||||
|
if (!empty($arrayfields['c.fk_shipping_method']['checked']))
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
|
$form->formSelectShippingMethod('', $obj->fk_shipping_method, 'none', 1);
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
// Payment terms
|
||||||
|
if (!empty($arrayfields['c.fk_cond_reglement']['checked']))
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
|
$form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none');
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
// Payment mode
|
||||||
|
if (!empty($arrayfields['c.fk_mode_reglement']['checked']))
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
|
$form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1);
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
// Amount HT
|
// Amount HT
|
||||||
if (!empty($arrayfields['c.total_ht']['checked']))
|
if (!empty($arrayfields['c.total_ht']['checked']))
|
||||||
{
|
{
|
||||||
@ -1326,7 +1389,6 @@ if ($resql)
|
|||||||
print '<td class="center">'.yn($obj->billed).'</td>';
|
print '<td class="center">'.yn($obj->billed).'</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
if (!empty($arrayfields['c.fk_statut']['checked']))
|
if (!empty($arrayfields['c.fk_statut']['checked']))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -58,11 +58,15 @@ if ($user->socid) $socid = $user->socid;
|
|||||||
$result = restrictedArea($user, 'banque', $fieldvalue, 'bank_account', '', '', $fieldtype);
|
$result = restrictedArea($user, 'banque', $fieldvalue, 'bank_account', '', '', $fieldtype);
|
||||||
if (!$user->rights->banque->lire && !$user->rights->banque->consolidate) accessforbidden();
|
if (!$user->rights->banque->lire && !$user->rights->banque->consolidate) accessforbidden();
|
||||||
|
|
||||||
|
$hookmanager->initHooks(array('bankline'));
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
$parameters = array('socid' => $socid);
|
||||||
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
if ($cancel)
|
if ($cancel)
|
||||||
{
|
{
|
||||||
if ($backtopage)
|
if ($backtopage)
|
||||||
|
|||||||
@ -40,11 +40,14 @@ if (!$user->rights->banque->transfer)
|
|||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
|
$hookmanager->initHooks(array('banktransfer'));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
$parameters = array('socid' => $socid);
|
||||||
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
if ($action == 'add')
|
if ($action == 'add')
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
|
|||||||
@ -1894,7 +1894,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// Set if we used free entry or predefined product
|
// Set if we used free entry or predefined product
|
||||||
$predef = '';
|
$predef = '';
|
||||||
$product_desc = (GETPOST('dp_desc', 'none') ?GETPOST('dp_desc', 'restricthtml') : '');
|
$product_desc =(GETPOSTISSET('dp_desc') ? GETPOST('dp_desc', 'restricthtml') : '');
|
||||||
$price_ht = price2num(GETPOST('price_ht'));
|
$price_ht = price2num(GETPOST('price_ht'));
|
||||||
$price_ht_devise = price2num(GETPOST('multicurrency_price_ht'));
|
$price_ht_devise = price2num(GETPOST('multicurrency_price_ht'));
|
||||||
$prod_entry_mode = GETPOST('prod_entry_mode', 'alpha');
|
$prod_entry_mode = GETPOST('prod_entry_mode', 'alpha');
|
||||||
@ -2064,6 +2064,11 @@ if (empty($reshook))
|
|||||||
$desc = $prod->description;
|
$desc = $prod->description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//If text set in desc is the same as product descpription (as now it's preloaded) whe add it only one time
|
||||||
|
if ($product_desc==$desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) {
|
||||||
|
$product_desc='';
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc = $product_desc;
|
if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc = $product_desc;
|
||||||
else $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
|
else $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
|
||||||
|
|
||||||
|
|||||||
@ -1382,7 +1382,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
|||||||
if (!empty($object->socid)) {
|
if (!empty($object->socid)) {
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("ContactByDefaultFor").'</td>';
|
print '<tr><td class="titlefield">'.$langs->trans("ContactByDefaultFor").'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
print $formcompany->showRoles("roles", $object, 'view');
|
print $formcompany->showRoles("roles", $object, 'view', $object->roles);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -499,6 +499,12 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
$desc = $prod->description;
|
$desc = $prod->description;
|
||||||
|
|
||||||
|
//If text set in desc is the same as product descpription (as now it's preloaded) whe add it only one time
|
||||||
|
if ($product_desc==$desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) {
|
||||||
|
$product_desc='';
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc = $product_desc;
|
if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc = $product_desc;
|
||||||
else $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
|
else $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
|
||||||
|
|
||||||
|
|||||||
@ -91,7 +91,7 @@ class box_birthdays extends ModeleBoxes
|
|||||||
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
||||||
$sql .= " AND u.statut = 1";
|
$sql .= " AND u.statut = 1";
|
||||||
$sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0);
|
$sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0);
|
||||||
$sql .= " ORDER BY u.birth ASC";
|
$sql .= " ORDER BY DAY(u.birth) ASC";
|
||||||
$sql .= $this->db->plimit($max, 0);
|
$sql .= $this->db->plimit($max, 0);
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
|
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
|
||||||
|
|||||||
@ -91,7 +91,7 @@ class box_birthdays_members extends ModeleBoxes
|
|||||||
$sql .= " WHERE u.entity IN (".getEntity('adherent').")";
|
$sql .= " WHERE u.entity IN (".getEntity('adherent').")";
|
||||||
$sql .= " AND u.statut = 1";
|
$sql .= " AND u.statut = 1";
|
||||||
$sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0);
|
$sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0);
|
||||||
$sql .= " ORDER BY u.birth ASC";
|
$sql .= " ORDER BY DAY(u.birth) ASC";
|
||||||
$sql .= $this->db->plimit($max, 0);
|
$sql .= $this->db->plimit($max, 0);
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
|
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
|
||||||
|
|||||||
@ -83,7 +83,7 @@ class box_commandes extends ModeleBoxes
|
|||||||
$societestatic = new Societe($this->db);
|
$societestatic = new Societe($this->db);
|
||||||
$userstatic = new User($this->db);
|
$userstatic = new User($this->db);
|
||||||
|
|
||||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE ? "" : "Modified")."CustomerOrders", $max));
|
$this->info_box_head = array('text' => $langs->trans("BoxTitleLast".(!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) ? "" : "Modified")."CustomerOrders", $max));
|
||||||
|
|
||||||
if ($user->rights->commande->lire)
|
if ($user->rights->commande->lire)
|
||||||
{
|
{
|
||||||
@ -108,7 +108,7 @@ class box_commandes extends ModeleBoxes
|
|||||||
if (!empty($conf->global->ORDER_BOX_LAST_ORDERS_VALIDATED_ONLY)) $sql .= " AND c.fk_statut = 1";
|
if (!empty($conf->global->ORDER_BOX_LAST_ORDERS_VALIDATED_ONLY)) $sql .= " AND c.fk_statut = 1";
|
||||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||||
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
||||||
if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql .= " ORDER BY c.date_commande DESC, c.ref DESC ";
|
if (!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) $sql .= " ORDER BY c.date_commande DESC, c.ref DESC ";
|
||||||
else $sql .= " ORDER BY c.tms DESC, c.ref DESC ";
|
else $sql .= " ORDER BY c.tms DESC, c.ref DESC ";
|
||||||
$sql .= $this->db->plimit($max, 0);
|
$sql .= $this->db->plimit($max, 0);
|
||||||
|
|
||||||
|
|||||||
@ -92,7 +92,7 @@ class box_contracts extends ModeleBoxes
|
|||||||
$sql .= " AND c.entity = ".$conf->entity;
|
$sql .= " AND c.entity = ".$conf->entity;
|
||||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||||
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
||||||
if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql .= " ORDER BY c.date_contrat DESC, c.ref DESC ";
|
if (! empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) $sql .= " ORDER BY c.date_contrat DESC, c.ref DESC ";
|
||||||
else $sql .= " ORDER BY c.tms DESC, c.ref DESC ";
|
else $sql .= " ORDER BY c.tms DESC, c.ref DESC ";
|
||||||
$sql .= $this->db->plimit($max, 0);
|
$sql .= $this->db->plimit($max, 0);
|
||||||
|
|
||||||
|
|||||||
@ -81,7 +81,7 @@ class box_factures extends ModeleBoxes
|
|||||||
|
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
|
||||||
$text = $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE ? "" : "Modified")."CustomerBills", $max);
|
$text = $langs->trans("BoxTitleLast".(!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) ? "" : "Modified")."CustomerBills", $max);
|
||||||
$this->info_box_head = array(
|
$this->info_box_head = array(
|
||||||
'text' => $text,
|
'text' => $text,
|
||||||
'limit'=> dol_strlen($text)
|
'limit'=> dol_strlen($text)
|
||||||
@ -106,7 +106,7 @@ class box_factures extends ModeleBoxes
|
|||||||
$sql .= " AND f.entity IN (".getEntity('invoice').")";
|
$sql .= " AND f.entity IN (".getEntity('invoice').")";
|
||||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||||
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
||||||
if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql .= " ORDER BY f.datef DESC, f.ref DESC ";
|
if (!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) $sql .= " ORDER BY f.datef DESC, f.ref DESC ";
|
||||||
else $sql .= " ORDER BY f.tms DESC, f.ref DESC ";
|
else $sql .= " ORDER BY f.tms DESC, f.ref DESC ";
|
||||||
$sql .= $this->db->plimit($max, 0);
|
$sql .= $this->db->plimit($max, 0);
|
||||||
|
|
||||||
|
|||||||
@ -81,7 +81,7 @@ class box_factures_fourn extends ModeleBoxes
|
|||||||
$thirdpartystatic = new Fournisseur($this->db);
|
$thirdpartystatic = new Fournisseur($this->db);
|
||||||
|
|
||||||
$this->info_box_head = array(
|
$this->info_box_head = array(
|
||||||
'text' => $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE ? "" : "Modified")."SupplierBills", $max)
|
'text' => $langs->trans("BoxTitleLast".(!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) ? "" : "Modified")."SupplierBills", $max)
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($user->rights->fournisseur->facture->lire)
|
if ($user->rights->fournisseur->facture->lire)
|
||||||
@ -104,7 +104,7 @@ class box_factures_fourn extends ModeleBoxes
|
|||||||
$sql .= " AND f.entity = ".$conf->entity;
|
$sql .= " AND f.entity = ".$conf->entity;
|
||||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||||
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
||||||
if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql .= " ORDER BY f.datef DESC, f.ref DESC ";
|
if (!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) $sql .= " ORDER BY f.datef DESC, f.ref DESC ";
|
||||||
else $sql .= " ORDER BY f.tms DESC, f.ref DESC ";
|
else $sql .= " ORDER BY f.tms DESC, f.ref DESC ";
|
||||||
$sql .= $this->db->plimit($max, 0);
|
$sql .= $this->db->plimit($max, 0);
|
||||||
|
|
||||||
|
|||||||
@ -112,10 +112,10 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
|||||||
$shownb = GETPOST($param_shownb, 'alpha');
|
$shownb = GETPOST($param_shownb, 'alpha');
|
||||||
$showtot = GETPOST($param_showtot, 'alpha');
|
$showtot = GETPOST($param_showtot, 'alpha');
|
||||||
} else {
|
} else {
|
||||||
$tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true);
|
$tmparray = (!empty($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode]) ? json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true) : array());
|
||||||
$endyear = $tmparray['year'];
|
$endyear = (!empty($tmparray['year']) ? $tmparray['year'] : '');
|
||||||
$shownb = $tmparray['shownb'];
|
$shownb = (!empty($tmparray['shownb']) ? $tmparray['shownb'] : '');
|
||||||
$showtot = $tmparray['showtot'];
|
$showtot = (!empty($tmparray['showtot']) ? $tmparray['showtot'] : '');
|
||||||
}
|
}
|
||||||
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
|
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
|
||||||
$nowarray = dol_getdate(dol_now(), true);
|
$nowarray = dol_getdate(dol_now(), true);
|
||||||
|
|||||||
@ -109,13 +109,14 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
|||||||
$shownb = GETPOST($param_shownb, 'alpha');
|
$shownb = GETPOST($param_shownb, 'alpha');
|
||||||
$showtot = GETPOST($param_showtot, 'alpha');
|
$showtot = GETPOST($param_showtot, 'alpha');
|
||||||
} else {
|
} else {
|
||||||
$tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true);
|
$tmparray = (!empty($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode]) ? json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true) : array());
|
||||||
$endyear = $tmparray['year'];
|
$endyear = (!empty($tmparray['year']) ? $tmparray['year'] : '');
|
||||||
$shownb = $tmparray['shownb'];
|
$shownb = (!empty($tmparray['shownb']) ? $tmparray['shownb'] : '');
|
||||||
$showtot = $tmparray['showtot'];
|
$showtot = (!empty($tmparray['showtot']) ? $tmparray['showtot'] : '');
|
||||||
}
|
}
|
||||||
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
|
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
|
||||||
$nowarray = dol_getdate(dol_now(), true);
|
$nowarray = dol_getdate(dol_now(), true);
|
||||||
|
if (empty($year)) $year = $nowarray['year'];
|
||||||
if (empty($endyear)) $endyear = $nowarray['year'];
|
if (empty($endyear)) $endyear = $nowarray['year'];
|
||||||
$startyear = $endyear - 1;
|
$startyear = $endyear - 1;
|
||||||
$mode = 'supplier';
|
$mode = 'supplier';
|
||||||
|
|||||||
@ -112,10 +112,10 @@ class box_graph_orders_permonth extends ModeleBoxes
|
|||||||
$shownb = GETPOST($param_shownb, 'alpha');
|
$shownb = GETPOST($param_shownb, 'alpha');
|
||||||
$showtot = GETPOST($param_showtot, 'alpha');
|
$showtot = GETPOST($param_showtot, 'alpha');
|
||||||
} else {
|
} else {
|
||||||
$tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true);
|
$tmparray = (!empty($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode]) ? json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true) : array());
|
||||||
$endyear = $tmparray['year'];
|
$endyear = (!empty($tmparray['year']) ? $tmparray['year'] : '');
|
||||||
$shownb = $tmparray['shownb'];
|
$shownb = (!empty($tmparray['shownb']) ? $tmparray['shownb'] : '');
|
||||||
$showtot = $tmparray['showtot'];
|
$showtot = (!empty($tmparray['showtot']) ? $tmparray['showtot'] : '');
|
||||||
}
|
}
|
||||||
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
|
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
|
||||||
$nowarray = dol_getdate(dol_now(), true);
|
$nowarray = dol_getdate(dol_now(), true);
|
||||||
|
|||||||
@ -111,10 +111,10 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
|||||||
$shownb = GETPOST($param_shownb, 'alpha');
|
$shownb = GETPOST($param_shownb, 'alpha');
|
||||||
$showtot = GETPOST($param_showtot, 'alpha');
|
$showtot = GETPOST($param_showtot, 'alpha');
|
||||||
} else {
|
} else {
|
||||||
$tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true);
|
$tmparray = (!empty($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode]) ? json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true) : array());
|
||||||
$endyear = $tmparray['year'];
|
$endyear = (!empty($tmparray['year']) ? $tmparray['year'] : '');
|
||||||
$shownb = $tmparray['shownb'];
|
$shownb = (!empty($tmparray['shownb']) ? $tmparray['shownb'] : '');
|
||||||
$showtot = $tmparray['showtot'];
|
$showtot = (!empty($tmparray['showtot']) ? $tmparray['showtot'] : '');
|
||||||
}
|
}
|
||||||
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
|
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
|
||||||
$nowarray = dol_getdate(dol_now(), true);
|
$nowarray = dol_getdate(dol_now(), true);
|
||||||
|
|||||||
@ -95,11 +95,11 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||||||
$showpropalnb = GETPOST($param_showpropalnb, 'alpha');
|
$showpropalnb = GETPOST($param_showpropalnb, 'alpha');
|
||||||
$showordernb = GETPOST($param_showordernb, 'alpha');
|
$showordernb = GETPOST($param_showordernb, 'alpha');
|
||||||
} else {
|
} else {
|
||||||
$tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true);
|
$tmparray = (!empty($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode]) ? json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true) : array());
|
||||||
$year = $tmparray['year'];
|
$year = (!empty($tmparray['year']) ? $tmparray['year'] : '');
|
||||||
$showinvoicenb = $tmparray['showinvoicenb'];
|
$showinvoicenb = (!empty($tmparray['showinvoicenb']) ? $tmparray['showinvoicenb'] : '');
|
||||||
$showpropalnb = $tmparray['showpropalnb'];
|
$showpropalnb = (!empty($tmparray['showpropalnb']) ? $tmparray['showpropalnb'] : '');
|
||||||
$showordernb = $tmparray['showordernb'];
|
$showordernb = (!empty($tmparray['showordernb']) ? $tmparray['showordernb'] : '');
|
||||||
}
|
}
|
||||||
if (empty($showinvoicenb) && empty($showpropalnb) && empty($showordernb)) { $showpropalnb = 1; $showinvoicenb = 1; $showordernb = 1; }
|
if (empty($showinvoicenb) && empty($showpropalnb) && empty($showordernb)) { $showpropalnb = 1; $showinvoicenb = 1; $showordernb = 1; }
|
||||||
if (empty($conf->facture->enabled) || empty($user->rights->facture->lire)) $showinvoicenb = 0;
|
if (empty($conf->facture->enabled) || empty($user->rights->facture->lire)) $showinvoicenb = 0;
|
||||||
|
|||||||
@ -112,10 +112,10 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||||||
$shownb = GETPOST($param_shownb, 'alpha');
|
$shownb = GETPOST($param_shownb, 'alpha');
|
||||||
$showtot = GETPOST($param_showtot, 'alpha');
|
$showtot = GETPOST($param_showtot, 'alpha');
|
||||||
} else {
|
} else {
|
||||||
$tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true);
|
$tmparray = (!empty($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode]) ? json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true) : array());
|
||||||
$endyear = $tmparray['year'];
|
$endyear = (!empty($tmparray['year']) ? $tmparray['year'] : '');
|
||||||
$shownb = $tmparray['shownb'];
|
$shownb = (!empty($tmparray['shownb']) ? $tmparray['shownb'] : '');
|
||||||
$showtot = $tmparray['showtot'];
|
$showtot = (!empty($tmparray['showtot']) ? $tmparray['showtot'] : '');
|
||||||
}
|
}
|
||||||
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
|
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
|
||||||
$nowarray = dol_getdate(dol_now(), true);
|
$nowarray = dol_getdate(dol_now(), true);
|
||||||
@ -176,8 +176,10 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||||||
//$datatype2 = array('lines','bars');
|
//$datatype2 = array('lines','bars');
|
||||||
|
|
||||||
$filenamenb = $dir."/".$prefix."propalsamountinyear-".$endyear.".png";
|
$filenamenb = $dir."/".$prefix."propalsamountinyear-".$endyear.".png";
|
||||||
|
if (!empty($mode)) {
|
||||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=propalsamountinyear-'.$endyear.'.png';
|
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=propalsamountinyear-'.$endyear.'.png';
|
||||||
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstatssupplier&file=propalsamountinyear-'.$endyear.'.png';
|
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstatssupplier&file=propalsamountinyear-'.$endyear.'.png';
|
||||||
|
}
|
||||||
|
|
||||||
$px2 = new DolGraph();
|
$px2 = new DolGraph();
|
||||||
$mesg = $px2->isGraphKo();
|
$mesg = $px2->isGraphKo();
|
||||||
|
|||||||
@ -64,7 +64,7 @@ class box_produits_alerte_stock extends ModeleBoxes
|
|||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
|
||||||
$listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
|
$listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
|
||||||
$tmpentry = array('enabled'=>((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && !empty($conf->stock->enabled)), 'perms'=>($user->rights->stock->lire), 'module'=>'product|service|stock');
|
$tmpentry = array('enabled'=>((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && !empty($conf->stock->enabled)), 'perms'=>!empty($user->rights->stock->lire), 'module'=>'product|service|stock');
|
||||||
$showmode = isVisibleToUserType(($user->socid > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal);
|
$showmode = isVisibleToUserType(($user->socid > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal);
|
||||||
$this->hidden = ($showmode != 1);
|
$this->hidden = ($showmode != 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -81,7 +81,7 @@ class box_propales extends ModeleBoxes
|
|||||||
$propalstatic = new Propal($this->db);
|
$propalstatic = new Propal($this->db);
|
||||||
$societestatic = new Societe($this->db);
|
$societestatic = new Societe($this->db);
|
||||||
|
|
||||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE ? "" : "Modified")."Propals", $max));
|
$this->info_box_head = array('text' => $langs->trans("BoxTitleLast".(!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) ? "" : "Modified")."Propals", $max));
|
||||||
|
|
||||||
if ($user->rights->propale->lire)
|
if ($user->rights->propale->lire)
|
||||||
{
|
{
|
||||||
@ -96,7 +96,7 @@ class box_propales extends ModeleBoxes
|
|||||||
$sql .= " AND p.entity IN (".getEntity('propal').")";
|
$sql .= " AND p.entity IN (".getEntity('propal').")";
|
||||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||||
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
||||||
if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql .= " ORDER BY p.datep DESC, p.ref DESC ";
|
if (!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) $sql .= " ORDER BY p.datep DESC, p.ref DESC ";
|
||||||
else $sql .= " ORDER BY p.tms DESC, p.ref DESC ";
|
else $sql .= " ORDER BY p.tms DESC, p.ref DESC ";
|
||||||
$sql .= $this->db->plimit($max, 0);
|
$sql .= $this->db->plimit($max, 0);
|
||||||
|
|
||||||
|
|||||||
@ -105,6 +105,7 @@ class box_shipments extends ModeleBoxes
|
|||||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON e.fk_soc = sc.fk_soc";
|
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON e.fk_soc = sc.fk_soc";
|
||||||
$sql .= " WHERE e.entity IN (".getEntity('expedition').")";
|
$sql .= " WHERE e.entity IN (".getEntity('expedition').")";
|
||||||
if (!empty($conf->global->ORDER_BOX_LAST_SHIPMENTS_VALIDATED_ONLY)) $sql .= " AND e.fk_statut = 1";
|
if (!empty($conf->global->ORDER_BOX_LAST_SHIPMENTS_VALIDATED_ONLY)) $sql .= " AND e.fk_statut = 1";
|
||||||
|
if ($user->socid > 0) $sql.= " AND s.rowid = ".$user->socid;
|
||||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND sc.fk_user = ".$user->id;
|
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND sc.fk_user = ".$user->id;
|
||||||
else $sql .= " ORDER BY e.date_delivery, e.ref DESC ";
|
else $sql .= " ORDER BY e.date_delivery, e.ref DESC ";
|
||||||
$sql .= $this->db->plimit($max, 0);
|
$sql .= $this->db->plimit($max, 0);
|
||||||
|
|||||||
@ -79,7 +79,7 @@ class box_supplier_orders extends ModeleBoxes
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||||
$thirdpartystatic = new Fournisseur($this->db);
|
$thirdpartystatic = new Fournisseur($this->db);
|
||||||
|
|
||||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLatest".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE ? "" : "Modified")."SupplierOrders", $max));
|
$this->info_box_head = array('text' => $langs->trans("BoxTitleLatest".(!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) ? "" : "Modified")."SupplierOrders", $max));
|
||||||
|
|
||||||
if ($user->rights->fournisseur->commande->lire)
|
if ($user->rights->fournisseur->commande->lire)
|
||||||
{
|
{
|
||||||
@ -98,7 +98,7 @@ class box_supplier_orders extends ModeleBoxes
|
|||||||
$sql .= " AND c.entity IN (".getEntity('supplier_order').")";
|
$sql .= " AND c.entity IN (".getEntity('supplier_order').")";
|
||||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||||
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
||||||
if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql .= " ORDER BY c.date_commande DESC, c.ref DESC ";
|
if (!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) $sql .= " ORDER BY c.date_commande DESC, c.ref DESC ";
|
||||||
else $sql .= " ORDER BY c.tms DESC, c.ref DESC ";
|
else $sql .= " ORDER BY c.tms DESC, c.ref DESC ";
|
||||||
$sql .= $this->db->plimit($max, 0);
|
$sql .= $this->db->plimit($max, 0);
|
||||||
|
|
||||||
|
|||||||
@ -99,7 +99,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes
|
|||||||
$sql .= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_ORDERSENT.", ".CommandeFournisseur::STATUS_RECEIVED_PARTIALLY.")";
|
$sql .= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_ORDERSENT.", ".CommandeFournisseur::STATUS_RECEIVED_PARTIALLY.")";
|
||||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||||
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
||||||
if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql .= " ORDER BY c.date_commande DESC, c.ref DESC";
|
if (!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) $sql .= " ORDER BY c.date_commande DESC, c.ref DESC";
|
||||||
else $sql .= " ORDER BY c.date_livraison ASC, c.fk_statut ASC";
|
else $sql .= " ORDER BY c.date_livraison ASC, c.fk_statut ASC";
|
||||||
$sql .= $this->db->plimit($max, 0);
|
$sql .= $this->db->plimit($max, 0);
|
||||||
|
|
||||||
|
|||||||
@ -601,7 +601,7 @@ abstract class CommonObject
|
|||||||
if (empty($lastname)) $lastname = (isset($this->lastname) ? $this->lastname : (isset($this->name) ? $this->name : (isset($this->nom) ? $this->nom : (isset($this->societe) ? $this->societe : (isset($this->company) ? $this->company : '')))));
|
if (empty($lastname)) $lastname = (isset($this->lastname) ? $this->lastname : (isset($this->name) ? $this->name : (isset($this->nom) ? $this->nom : (isset($this->societe) ? $this->societe : (isset($this->company) ? $this->company : '')))));
|
||||||
|
|
||||||
$ret = '';
|
$ret = '';
|
||||||
if ($option && $this->civility_code)
|
if (!empty($option) && !empty($this->civility_code))
|
||||||
{
|
{
|
||||||
if ($langs->transnoentitiesnoconv("Civility".$this->civility_code) != "Civility".$this->civility_code) $ret .= $langs->transnoentitiesnoconv("Civility".$this->civility_code).' ';
|
if ($langs->transnoentitiesnoconv("Civility".$this->civility_code) != "Civility".$this->civility_code) $ret .= $langs->transnoentitiesnoconv("Civility".$this->civility_code).' ';
|
||||||
else $ret .= $this->civility_code.' ';
|
else $ret .= $this->civility_code.' ';
|
||||||
@ -720,7 +720,7 @@ abstract class CommonObject
|
|||||||
$out = '';
|
$out = '';
|
||||||
|
|
||||||
$outdone = 0;
|
$outdone = 0;
|
||||||
$coords = $this->getFullAddress(1, ', ', $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT);
|
$coords = $this->getFullAddress(1, ', ', (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) ? $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT : 0));
|
||||||
if ($coords)
|
if ($coords)
|
||||||
{
|
{
|
||||||
if (!empty($conf->use_javascript_ajax))
|
if (!empty($conf->use_javascript_ajax))
|
||||||
@ -1407,7 +1407,7 @@ abstract class CommonObject
|
|||||||
} elseif (strpos($obj->element, 'supplier') !== false && $obj->element != 'supplier_proposal') {
|
} elseif (strpos($obj->element, 'supplier') !== false && $obj->element != 'supplier_proposal') {
|
||||||
$modulename = 'fournisseur';
|
$modulename = 'fournisseur';
|
||||||
}
|
}
|
||||||
if ($conf->{$modulename}->enabled) {
|
if (!empty($conf->{$modulename}->enabled)) {
|
||||||
$libelle_element = $langs->trans('ContactDefault_'.$obj->element);
|
$libelle_element = $langs->trans('ContactDefault_'.$obj->element);
|
||||||
$transkey = "TypeContact_".$obj->element."_".$source."_".$obj->code;
|
$transkey = "TypeContact_".$obj->element."_".$source."_".$obj->code;
|
||||||
$libelle_type = ($langs->trans($transkey) != $transkey ? $langs->trans($transkey) : $obj->libelle);
|
$libelle_type = ($langs->trans($transkey) != $transkey ? $langs->trans($transkey) : $obj->libelle);
|
||||||
@ -3257,14 +3257,18 @@ abstract class CommonObject
|
|||||||
*
|
*
|
||||||
* @param string $origin Linked element type
|
* @param string $origin Linked element type
|
||||||
* @param int $origin_id Linked element id
|
* @param int $origin_id Linked element id
|
||||||
|
* @param User $f_user User that create
|
||||||
|
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||||
* @return int <=0 if KO, >0 if OK
|
* @return int <=0 if KO, >0 if OK
|
||||||
* @see fetchObjectLinked(), updateObjectLinked(), deleteObjectLinked()
|
* @see fetchObjectLinked(), updateObjectLinked(), deleteObjectLinked()
|
||||||
*/
|
*/
|
||||||
public function add_object_linked($origin = null, $origin_id = null)
|
public function add_object_linked($origin = null, $origin_id = null, $f_user = null, $notrigger = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
|
global $user;
|
||||||
$origin = (!empty($origin) ? $origin : $this->origin);
|
$origin = (!empty($origin) ? $origin : $this->origin);
|
||||||
$origin_id = (!empty($origin_id) ? $origin_id : $this->origin_id);
|
$origin_id = (!empty($origin_id) ? $origin_id : $this->origin_id);
|
||||||
|
$f_user = isset($f_user) ? $f_user : $user;
|
||||||
|
|
||||||
// Special case
|
// Special case
|
||||||
if ($origin == 'order') $origin = 'commande';
|
if ($origin == 'order') $origin = 'commande';
|
||||||
@ -3272,26 +3276,41 @@ abstract class CommonObject
|
|||||||
if ($origin == 'invoice_template') $origin = 'facturerec';
|
if ($origin == 'invoice_template') $origin = 'facturerec';
|
||||||
if ($origin == 'supplierorder') $origin = 'order_supplier';
|
if ($origin == 'supplierorder') $origin = 'order_supplier';
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element (";
|
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "element_element (";
|
||||||
$sql .= "fk_source";
|
$sql .= "fk_source";
|
||||||
$sql .= ", sourcetype";
|
$sql .= ", sourcetype";
|
||||||
$sql .= ", fk_target";
|
$sql .= ", fk_target";
|
||||||
$sql .= ", targettype";
|
$sql .= ", targettype";
|
||||||
$sql .= ") VALUES (";
|
$sql .= ") VALUES (";
|
||||||
$sql .= $origin_id;
|
$sql .= $origin_id;
|
||||||
$sql .= ", '".$this->db->escape($origin)."'";
|
$sql .= ", '" . $this->db->escape($origin) . "'";
|
||||||
$sql .= ", ".$this->id;
|
$sql .= ", " . $this->id;
|
||||||
$sql .= ", '".$this->db->escape($this->element)."'";
|
$sql .= ", '" . $this->db->escape($this->element) . "'";
|
||||||
$sql .= ")";
|
$sql .= ")";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::add_object_linked", LOG_DEBUG);
|
dol_syslog(get_class($this) . "::add_object_linked", LOG_DEBUG);
|
||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql)) {
|
||||||
{
|
if (!$notrigger) {
|
||||||
|
// Call trigger
|
||||||
|
$this->context['link_origin'] = $origin;
|
||||||
|
$this->context['link_origin_id'] = $origin_id;
|
||||||
|
$result = $this->call_trigger('OBJECT_LINK_INSERT', $f_user);
|
||||||
|
if ($result < 0) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
// End call triggers
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$this->error = $this->db->lasterror();
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$error) {
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
$this->error = $this->db->lasterror();
|
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -3502,38 +3521,61 @@ abstract class CommonObject
|
|||||||
* @param string $sourcetype Object source type
|
* @param string $sourcetype Object source type
|
||||||
* @param int $targetid Object target id
|
* @param int $targetid Object target id
|
||||||
* @param string $targettype Object target type
|
* @param string $targettype Object target type
|
||||||
|
* @param User $f_user User that create
|
||||||
|
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
* @see add_object_linked(), fetObjectLinked(), deleteObjectLinked()
|
* @see add_object_linked(), fetObjectLinked(), deleteObjectLinked()
|
||||||
*/
|
*/
|
||||||
public function updateObjectLinked($sourceid = null, $sourcetype = '', $targetid = null, $targettype = '')
|
public function updateObjectLinked($sourceid = null, $sourcetype = '', $targetid = null, $targettype = '', $f_user = null, $notrigger = 0)
|
||||||
{
|
{
|
||||||
|
global $user;
|
||||||
$updatesource = false;
|
$updatesource = false;
|
||||||
$updatetarget = false;
|
$updatetarget = false;
|
||||||
|
$f_user = isset($f_user) ? $f_user : $user;
|
||||||
|
|
||||||
if (!empty($sourceid) && !empty($sourcetype) && empty($targetid) && empty($targettype)) $updatesource = true;
|
if (!empty($sourceid) && !empty($sourcetype) && empty($targetid) && empty($targettype)) $updatesource = true;
|
||||||
elseif (empty($sourceid) && empty($sourcetype) && !empty($targetid) && !empty($targettype)) $updatetarget = true;
|
elseif (empty($sourceid) && empty($sourcetype) && !empty($targetid) && !empty($targettype)) $updatetarget = true;
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."element_element SET ";
|
$this->db->begin();
|
||||||
if ($updatesource)
|
$error = 0;
|
||||||
{
|
|
||||||
$sql .= "fk_source = ".$sourceid;
|
$sql = "UPDATE " . MAIN_DB_PREFIX . "element_element SET ";
|
||||||
$sql .= ", sourcetype = '".$this->db->escape($sourcetype)."'";
|
if ($updatesource) {
|
||||||
$sql .= " WHERE fk_target = ".$this->id;
|
$sql .= "fk_source = " . $sourceid;
|
||||||
$sql .= " AND targettype = '".$this->db->escape($this->element)."'";
|
$sql .= ", sourcetype = '" . $this->db->escape($sourcetype) . "'";
|
||||||
} elseif ($updatetarget)
|
$sql .= " WHERE fk_target = " . $this->id;
|
||||||
{
|
$sql .= " AND targettype = '" . $this->db->escape($this->element) . "'";
|
||||||
$sql .= "fk_target = ".$targetid;
|
} elseif ($updatetarget) {
|
||||||
$sql .= ", targettype = '".$this->db->escape($targettype)."'";
|
$sql .= "fk_target = " . $targetid;
|
||||||
$sql .= " WHERE fk_source = ".$this->id;
|
$sql .= ", targettype = '" . $this->db->escape($targettype) . "'";
|
||||||
$sql .= " AND sourcetype = '".$this->db->escape($this->element)."'";
|
$sql .= " WHERE fk_source = " . $this->id;
|
||||||
|
$sql .= " AND sourcetype = '" . $this->db->escape($this->element) . "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::updateObjectLinked", LOG_DEBUG);
|
dol_syslog(get_class($this) . "::updateObjectLinked", LOG_DEBUG);
|
||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql)) {
|
||||||
{
|
if (!$notrigger) {
|
||||||
return 1;
|
// Call trigger
|
||||||
|
$this->context['link_source_id'] = $sourceid;
|
||||||
|
$this->context['link_source_type'] = $sourcetype;
|
||||||
|
$this->context['link_target_id'] = $targetid;
|
||||||
|
$this->context['link_target_type'] = $targettype;
|
||||||
|
$result = $this->call_trigger('OBJECT_LINK_UPDATE', $f_user);
|
||||||
|
if ($result < 0) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
// End call triggers
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->error = $this->db->lasterror();
|
$this->error = $this->db->lasterror();
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$error) {
|
||||||
|
$this->db->commit();
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3546,13 +3588,17 @@ abstract class CommonObject
|
|||||||
* @param int $targetid Object target id
|
* @param int $targetid Object target id
|
||||||
* @param string $targettype Object target type
|
* @param string $targettype Object target type
|
||||||
* @param int $rowid Row id of line to delete. If defined, other parameters are not used.
|
* @param int $rowid Row id of line to delete. If defined, other parameters are not used.
|
||||||
|
* @param User $f_user User that create
|
||||||
|
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
* @see add_object_linked(), updateObjectLinked(), fetchObjectLinked()
|
* @see add_object_linked(), updateObjectLinked(), fetchObjectLinked()
|
||||||
*/
|
*/
|
||||||
public function deleteObjectLinked($sourceid = null, $sourcetype = '', $targetid = null, $targettype = '', $rowid = '')
|
public function deleteObjectLinked($sourceid = null, $sourcetype = '', $targetid = null, $targettype = '', $rowid = '', $f_user = null, $notrigger = 0)
|
||||||
{
|
{
|
||||||
|
global $user;
|
||||||
$deletesource = false;
|
$deletesource = false;
|
||||||
$deletetarget = false;
|
$deletetarget = false;
|
||||||
|
$f_user = isset($f_user) ? $f_user : $user;
|
||||||
|
|
||||||
if (!empty($sourceid) && !empty($sourcetype) && empty($targetid) && empty($targettype)) $deletesource = true;
|
if (!empty($sourceid) && !empty($sourcetype) && empty($targetid) && empty($targettype)) $deletesource = true;
|
||||||
elseif (empty($sourceid) && empty($sourcetype) && !empty($targetid) && !empty($targettype)) $deletetarget = true;
|
elseif (empty($sourceid) && empty($sourcetype) && !empty($targetid) && !empty($targettype)) $deletetarget = true;
|
||||||
@ -3561,36 +3607,56 @@ abstract class CommonObject
|
|||||||
$sourcetype = (!empty($sourcetype) ? $sourcetype : $this->element);
|
$sourcetype = (!empty($sourcetype) ? $sourcetype : $this->element);
|
||||||
$targetid = (!empty($targetid) ? $targetid : $this->id);
|
$targetid = (!empty($targetid) ? $targetid : $this->id);
|
||||||
$targettype = (!empty($targettype) ? $targettype : $this->element);
|
$targettype = (!empty($targettype) ? $targettype : $this->element);
|
||||||
|
$this->db->begin();
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."element_element";
|
if (!$notrigger) {
|
||||||
|
// Call trigger
|
||||||
|
$this->context['link_id'] = $rowid;
|
||||||
|
$this->context['link_source_id'] = $sourceid;
|
||||||
|
$this->context['link_source_type'] = $sourcetype;
|
||||||
|
$this->context['link_target_id'] = $targetid;
|
||||||
|
$this->context['link_target_type'] = $targettype;
|
||||||
|
$result = $this->call_trigger('OBJECT_LINK_DELETE', $f_user);
|
||||||
|
if ($result < 0) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
// End call triggers
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$error) {
|
||||||
|
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "element_element";
|
||||||
$sql .= " WHERE";
|
$sql .= " WHERE";
|
||||||
if ($rowid > 0)
|
if ($rowid > 0) {
|
||||||
{
|
$sql .= " rowid = " . $rowid;
|
||||||
$sql .= " rowid = ".$rowid;
|
|
||||||
} else {
|
} else {
|
||||||
if ($deletesource)
|
if ($deletesource) {
|
||||||
{
|
$sql .= " fk_source = " . $sourceid . " AND sourcetype = '" . $this->db->escape($sourcetype) . "'";
|
||||||
$sql .= " fk_source = ".$sourceid." AND sourcetype = '".$this->db->escape($sourcetype)."'";
|
$sql .= " AND fk_target = " . $this->id . " AND targettype = '" . $this->db->escape($this->element) . "'";
|
||||||
$sql .= " AND fk_target = ".$this->id." AND targettype = '".$this->db->escape($this->element)."'";
|
} elseif ($deletetarget) {
|
||||||
} elseif ($deletetarget)
|
$sql .= " fk_target = " . $targetid . " AND targettype = '" . $this->db->escape($targettype) . "'";
|
||||||
{
|
$sql .= " AND fk_source = " . $this->id . " AND sourcetype = '" . $this->db->escape($this->element) . "'";
|
||||||
$sql .= " fk_target = ".$targetid." AND targettype = '".$this->db->escape($targettype)."'";
|
|
||||||
$sql .= " AND fk_source = ".$this->id." AND sourcetype = '".$this->db->escape($this->element)."'";
|
|
||||||
} else {
|
} else {
|
||||||
$sql .= " (fk_source = ".$this->id." AND sourcetype = '".$this->db->escape($this->element)."')";
|
$sql .= " (fk_source = " . $this->id . " AND sourcetype = '" . $this->db->escape($this->element) . "')";
|
||||||
$sql .= " OR";
|
$sql .= " OR";
|
||||||
$sql .= " (fk_target = ".$this->id." AND targettype = '".$this->db->escape($this->element)."')";
|
$sql .= " (fk_target = " . $this->id . " AND targettype = '" . $this->db->escape($this->element) . "')";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::deleteObjectLinked", LOG_DEBUG);
|
dol_syslog(get_class($this) . "::deleteObjectLinked", LOG_DEBUG);
|
||||||
if ($this->db->query($sql))
|
if (!$this->db->query($sql)) {
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
} else {
|
|
||||||
$this->error = $this->db->lasterror();
|
$this->error = $this->db->lasterror();
|
||||||
$this->errors[] = $this->error;
|
$this->errors[] = $this->error;
|
||||||
return -1;
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$error) {
|
||||||
|
$this->db->commit();
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
$this->db->rollback();
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6846,7 +6912,7 @@ abstract class CommonObject
|
|||||||
$value = $getposttemp;
|
$value = $getposttemp;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$value = $this->array_options["options_".$key]; // No GET, no POST, no default value, so we take value of object.
|
$value = (!empty($this->array_options["options_".$key]) ? $this->array_options["options_".$key] : ''); // No GET, no POST, no default value, so we take value of object.
|
||||||
}
|
}
|
||||||
//var_dump($keyprefix.' - '.$key.' - '.$keysuffix.' - '.$keyprefix.'options_'.$key.$keysuffix.' - '.$this->array_options["options_".$key.$keysuffix].' - '.$getposttemp.' - '.$value);
|
//var_dump($keyprefix.' - '.$key.' - '.$keysuffix.' - '.$keyprefix.'options_'.$key.$keysuffix.' - '.$this->array_options["options_".$key.$keysuffix].' - '.$getposttemp.' - '.$value);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -697,6 +697,12 @@ class Conf
|
|||||||
|
|
||||||
if (!empty($this->global->MAIN_TZUSERINPUTKEY)) $this->tzuserinputkey = $this->global->MAIN_TZUSERINPUTKEY; // 'tzserver' or 'tzuserrel'
|
if (!empty($this->global->MAIN_TZUSERINPUTKEY)) $this->tzuserinputkey = $this->global->MAIN_TZUSERINPUTKEY; // 'tzserver' or 'tzuserrel'
|
||||||
|
|
||||||
|
if (!empty($this->global->PRODUIT_AUTOFILL_DESC)) {
|
||||||
|
$this->global->MAIN_NO_CONCAT_DESCRIPTION = 1;
|
||||||
|
} else {
|
||||||
|
unset($this->global->MAIN_NO_CONCAT_DESCRIPTION);
|
||||||
|
}
|
||||||
|
|
||||||
// For backward compatibility
|
// For backward compatibility
|
||||||
if (isset($this->product)) $this->produit = $this->product;
|
if (isset($this->product)) $this->produit = $this->product;
|
||||||
if (isset($this->facture)) $this->invoice = $this->facture;
|
if (isset($this->facture)) $this->invoice = $this->facture;
|
||||||
|
|||||||
@ -964,7 +964,7 @@ class DolGraph
|
|||||||
$array_of_ykeys = array_keys($valarray);
|
$array_of_ykeys = array_keys($valarray);
|
||||||
$alabelexists = 1;
|
$alabelexists = 1;
|
||||||
$tmpykey = explode('_', ($array_of_ykeys[$i + ($alabelexists ? 1 : 0)]), 3);
|
$tmpykey = explode('_', ($array_of_ykeys[$i + ($alabelexists ? 1 : 0)]), 3);
|
||||||
if (!empty($tmpykey[2]) || $tmpykey[2] == '0') { // This is a 'Group by' array
|
if (isset($tmpykey[2]) && (!empty($tmpykey[2]) || $tmpykey[2] == '0')) { // This is a 'Group by' array
|
||||||
$tmpvalue = (array_key_exists('y_' . $tmpykey[1] . '_' . $tmpykey[2], $valarray) ? $valarray['y_' . $tmpykey[1] . '_' . $tmpykey[2]] : $valarray[$i + 1]);
|
$tmpvalue = (array_key_exists('y_' . $tmpykey[1] . '_' . $tmpykey[2], $valarray) ? $valarray['y_' . $tmpykey[1] . '_' . $tmpykey[2]] : $valarray[$i + 1]);
|
||||||
$values[$x] = (is_numeric($tmpvalue) ? $tmpvalue : null);
|
$values[$x] = (is_numeric($tmpvalue) ? $tmpvalue : null);
|
||||||
$arrayofgroupslegend[$i] = array(
|
$arrayofgroupslegend[$i] = array(
|
||||||
@ -1203,7 +1203,7 @@ class DolGraph
|
|||||||
$foundnegativecolor = 0;
|
$foundnegativecolor = 0;
|
||||||
$usecolorvariantforgroupby = 0;
|
$usecolorvariantforgroupby = 0;
|
||||||
// We used a 'group by' and we have too many colors so we generated color variants per
|
// We used a 'group by' and we have too many colors so we generated color variants per
|
||||||
if (is_array($arrayofgroupslegend[$i]) && count($arrayofgroupslegend[$i]) > 0) { // If we used a group by.
|
if (!empty($arrayofgroupslegend) && is_array($arrayofgroupslegend[$i]) && count($arrayofgroupslegend[$i]) > 0) { // If we used a group by.
|
||||||
$nbofcolorneeds = count($arrayofgroupslegend);
|
$nbofcolorneeds = count($arrayofgroupslegend);
|
||||||
$nbofcolorsavailable = count($theme_datacolor);
|
$nbofcolorsavailable = count($theme_datacolor);
|
||||||
if ($nbofcolorneeds > $nbofcolorsavailable) {
|
if ($nbofcolorneeds > $nbofcolorsavailable) {
|
||||||
@ -1278,7 +1278,7 @@ class DolGraph
|
|||||||
$this->stringtoshow .= '{';
|
$this->stringtoshow .= '{';
|
||||||
$this->stringtoshow .= 'dolibarrinfo: \'y_' . $i . '\', ';
|
$this->stringtoshow .= 'dolibarrinfo: \'y_' . $i . '\', ';
|
||||||
$this->stringtoshow .= 'label: \'' . dol_escape_js(dol_string_nohtmltag($textoflegend)) . '\', ';
|
$this->stringtoshow .= 'label: \'' . dol_escape_js(dol_string_nohtmltag($textoflegend)) . '\', ';
|
||||||
$this->stringtoshow .= 'pointStyle: \'' . ($this->type[$i] == 'linesnopoint' ? 'line' : 'circle') . '\', ';
|
$this->stringtoshow .= 'pointStyle: \'' . ((!empty($this->type[$i]) && $this->type[$i] == 'linesnopoint') ? 'line' : 'circle') . '\', ';
|
||||||
$this->stringtoshow .= 'fill: ' . ($type == 'bar' ? 'true' : 'false') . ', ';
|
$this->stringtoshow .= 'fill: ' . ($type == 'bar' ? 'true' : 'false') . ', ';
|
||||||
if ($isfunnel) {
|
if ($isfunnel) {
|
||||||
$this->stringtoshow .= 'borderWidth: \'2\', ';
|
$this->stringtoshow .= 'borderWidth: \'2\', ';
|
||||||
@ -1287,7 +1287,7 @@ class DolGraph
|
|||||||
}
|
}
|
||||||
$this->stringtoshow .= 'borderColor: \'' . $bordercolor . '\', ';
|
$this->stringtoshow .= 'borderColor: \'' . $bordercolor . '\', ';
|
||||||
$this->stringtoshow .= 'backgroundColor: \'' . $color . '\', ';
|
$this->stringtoshow .= 'backgroundColor: \'' . $color . '\', ';
|
||||||
if ($arrayofgroupslegend[$i]) $this->stringtoshow .= 'stack: \'' . $arrayofgroupslegend[$i]['stacknum'] . '\', ';
|
if (!empty($arrayofgroupslegend) && !empty($arrayofgroupslegend[$i])) $this->stringtoshow .= 'stack: \'' . $arrayofgroupslegend[$i]['stacknum'] . '\', ';
|
||||||
$this->stringtoshow .='data: [';
|
$this->stringtoshow .='data: [';
|
||||||
if ($isfunnel) {
|
if ($isfunnel) {
|
||||||
$this->stringtoshow .= '['.-$serie[$i].','.$serie[$i].']';
|
$this->stringtoshow .= '['.-$serie[$i].','.$serie[$i].']';
|
||||||
|
|||||||
@ -1097,7 +1097,12 @@ class ExtraFields
|
|||||||
foreach ($param['options'] as $key => $val)
|
foreach ($param['options'] as $key => $val)
|
||||||
{
|
{
|
||||||
if ((string) $key == '') continue;
|
if ((string) $key == '') continue;
|
||||||
list($val, $parent) = explode('|', $val);
|
$valarray = explode('|', $val);
|
||||||
|
$val = $valarray[0];
|
||||||
|
$parent = '';
|
||||||
|
if (!empty($valarray[1])) {
|
||||||
|
$parent = $valarray[1];
|
||||||
|
}
|
||||||
$out .= '<option value="'.$key.'"';
|
$out .= '<option value="'.$key.'"';
|
||||||
$out .= (((string) $value == (string) $key) ? ' selected' : '');
|
$out .= (((string) $value == (string) $key) ? ' selected' : '');
|
||||||
$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
|
$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
|
||||||
@ -2063,7 +2068,7 @@ class ExtraFields
|
|||||||
{
|
{
|
||||||
global $_POST;
|
global $_POST;
|
||||||
|
|
||||||
if (is_string($extrafieldsobjectkey) && is_array($this->attributes[$extrafieldsobjectkey]['label']))
|
if (is_string($extrafieldsobjectkey) && !empty($this->attributes[$extrafieldsobjectkey]['label']) && is_array($this->attributes[$extrafieldsobjectkey]['label']))
|
||||||
{
|
{
|
||||||
$extralabels = $this->attributes[$extrafieldsobjectkey]['label'];
|
$extralabels = $this->attributes[$extrafieldsobjectkey]['label'];
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -2182,7 +2182,9 @@ class Form
|
|||||||
if (!empty($conf->global->MAIN_MULTILANGS))
|
if (!empty($conf->global->MAIN_MULTILANGS))
|
||||||
{
|
{
|
||||||
$sql .= ", pl.label as label_translated";
|
$sql .= ", pl.label as label_translated";
|
||||||
|
$sql .= ", pl.description as description_translated";
|
||||||
$selectFields .= ", label_translated";
|
$selectFields .= ", label_translated";
|
||||||
|
$selectFields .= ", description_translated";
|
||||||
}
|
}
|
||||||
// Price by quantity
|
// Price by quantity
|
||||||
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))
|
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))
|
||||||
@ -2222,7 +2224,18 @@ class Form
|
|||||||
// Multilang : we add translation
|
// Multilang : we add translation
|
||||||
if (!empty($conf->global->MAIN_MULTILANGS))
|
if (!empty($conf->global->MAIN_MULTILANGS))
|
||||||
{
|
{
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid AND pl.lang='".$this->db->escape($langs->getDefaultLang())."'";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid ";
|
||||||
|
if (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE) && !empty($socid)) {
|
||||||
|
$soc = new Societe($db);
|
||||||
|
$result = $soc->fetch($socid);
|
||||||
|
if ($result > 0 && !empty($soc->default_lang)) {
|
||||||
|
$sql .= " AND pl.lang='" . $this->db->escape($soc->default_lang) . "'";
|
||||||
|
} else {
|
||||||
|
$sql .= " AND pl.lang='".$this->db->escape($langs->getDefaultLang())."'";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$sql .= " AND pl.lang='".$this->db->escape($langs->getDefaultLang())."'";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) {
|
if (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) {
|
||||||
@ -2435,7 +2448,9 @@ class Form
|
|||||||
$outval = '';
|
$outval = '';
|
||||||
$outref = '';
|
$outref = '';
|
||||||
$outlabel = '';
|
$outlabel = '';
|
||||||
|
$outlabel_translated = '';
|
||||||
$outdesc = '';
|
$outdesc = '';
|
||||||
|
$outdesc_translated = '';
|
||||||
$outbarcode = '';
|
$outbarcode = '';
|
||||||
$outorigin = '';
|
$outorigin = '';
|
||||||
$outtype = '';
|
$outtype = '';
|
||||||
@ -2456,6 +2471,11 @@ class Form
|
|||||||
$outref = $objp->ref;
|
$outref = $objp->ref;
|
||||||
$outlabel = $objp->label;
|
$outlabel = $objp->label;
|
||||||
$outdesc = $objp->description;
|
$outdesc = $objp->description;
|
||||||
|
if (!empty($conf->global->MAIN_MULTILANGS))
|
||||||
|
{
|
||||||
|
$outlabel_translated = $objp->label_translated;
|
||||||
|
$outdesc_translated = $objp->description_translated;
|
||||||
|
}
|
||||||
$outbarcode = $objp->barcode;
|
$outbarcode = $objp->barcode;
|
||||||
$outorigin = $objp->fk_country;
|
$outorigin = $objp->fk_country;
|
||||||
$outpbq = empty($objp->price_by_qty_rowid) ? '' : $objp->price_by_qty_rowid;
|
$outpbq = empty($objp->price_by_qty_rowid) ? '' : $objp->price_by_qty_rowid;
|
||||||
@ -2517,6 +2537,10 @@ class Form
|
|||||||
elseif ($objp->stock <= 0) $opt .= ' class="product_line_stock_too_low"';
|
elseif ($objp->stock <= 0) $opt .= ' class="product_line_stock_too_low"';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
|
||||||
|
$opt .= ' data-labeltrans="'.$outlabel_translated.'"';
|
||||||
|
$opt .= ' data-desctrans="'.dol_escape_htmltag($outdesc_translated).'"';
|
||||||
|
}
|
||||||
$opt .= '>';
|
$opt .= '>';
|
||||||
$opt .= $objp->ref;
|
$opt .= $objp->ref;
|
||||||
if ($outbarcode) $opt .= ' ('.$outbarcode.')';
|
if ($outbarcode) $opt .= ' ('.$outbarcode.')';
|
||||||
@ -2687,7 +2711,24 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
$opt .= "</option>\n";
|
$opt .= "</option>\n";
|
||||||
$optJson = array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'label2'=>$outlabel, 'desc'=>$outdesc, 'type'=>$outtype, 'price_ht'=>price2num($outprice_ht), 'price_ttc'=>price2num($outprice_ttc), 'pricebasetype'=>$outpricebasetype, 'tva_tx'=>$outtva_tx, 'qty'=>$outqty, 'discount'=>$outdiscount, 'duration_value'=>$outdurationvalue, 'duration_unit'=>$outdurationunit, 'pbq'=>$outpbq);
|
$optJson = array(
|
||||||
|
'key'=>$outkey,
|
||||||
|
'value'=>$outref,
|
||||||
|
'label'=>$outval,
|
||||||
|
'label2'=>$outlabel,
|
||||||
|
'desc'=>$outdesc,
|
||||||
|
'type'=>$outtype,
|
||||||
|
'price_ht'=>price2num($outprice_ht),
|
||||||
|
'price_ttc'=>price2num($outprice_ttc),
|
||||||
|
'pricebasetype'=>$outpricebasetype,
|
||||||
|
'tva_tx'=>$outtva_tx, 'qty'=>$outqty,
|
||||||
|
'discount'=>$outdiscount,
|
||||||
|
'duration_value'=>$outdurationvalue,
|
||||||
|
'duration_unit'=>$outdurationunit,
|
||||||
|
'pbq'=>$outpbq,
|
||||||
|
'labeltrans'=>$outlabel_translated,
|
||||||
|
'desctrans'=>$outdesc_translated
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
@ -2770,6 +2811,12 @@ class Form
|
|||||||
$sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.remise_percent, pfp.remise, pfp.unitprice,";
|
$sql .= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.remise_percent, pfp.remise, pfp.unitprice,";
|
||||||
$sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, pfp.fk_soc, s.nom as name,";
|
$sql .= " pfp.fk_supplier_price_expression, pfp.fk_product, pfp.tva_tx, pfp.fk_soc, s.nom as name,";
|
||||||
$sql .= " pfp.supplier_reputation";
|
$sql .= " pfp.supplier_reputation";
|
||||||
|
// if we use supplier description of the products
|
||||||
|
if (!empty($conf->global->PRODUIT_FOURN_TEXTS)) {
|
||||||
|
$sql .= " ,pfp.desc_fourn as description";
|
||||||
|
} else {
|
||||||
|
$sql .= " ,p.description";
|
||||||
|
}
|
||||||
// Units
|
// Units
|
||||||
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
|
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
|
||||||
$sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units";
|
$sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units";
|
||||||
@ -2799,7 +2846,11 @@ class Form
|
|||||||
foreach ($scrit as $crit)
|
foreach ($scrit as $crit)
|
||||||
{
|
{
|
||||||
if ($i > 0) $sql .= " AND ";
|
if ($i > 0) $sql .= " AND ";
|
||||||
$sql .= "(pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%' OR p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%')";
|
$sql .= "(pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%' OR p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'";
|
||||||
|
if (!empty($conf->global->PRODUIT_FOURN_TEXTS)) {
|
||||||
|
$sql .= " OR pfp.desc_fourn LIKE '".$this->db->escape($prefix.$crit)."%'";
|
||||||
|
}
|
||||||
|
$sql .= ")";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
if (count($scrit) > 1) $sql .= ")";
|
if (count($scrit) > 1) $sql .= ")";
|
||||||
@ -3028,8 +3079,9 @@ class Form
|
|||||||
if (empty($objp->idprodfournprice) && empty($alsoproductwithnosupplierprice)) $opt .= ' disabled';
|
if (empty($objp->idprodfournprice) && empty($alsoproductwithnosupplierprice)) $opt .= ' disabled';
|
||||||
if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0)
|
if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0)
|
||||||
{
|
{
|
||||||
$opt .= ' pbq="'.$objp->idprodfournprice.'" data-pbq="'.$objp->idprodfournprice.'" data-pbqqty="'.$objp->quantity.'" data-pbqup="'.$objp->unitprice.'" data-pbqpercent="'.$objp->remise_percent.'"';
|
$opt .= ' data-qty="'.$objp->quantity.'" data-up="'.$objp->unitprice.'" data-discount="'.$outdiscount.'"';
|
||||||
}
|
}
|
||||||
|
$opt .= ' data-description="'.dol_escape_htmltag($objp->description).'"';
|
||||||
$opt .= ' data-html="'.dol_escape_htmltag($optlabel).'"';
|
$opt .= ' data-html="'.dol_escape_htmltag($optlabel).'"';
|
||||||
$opt .= '>';
|
$opt .= '>';
|
||||||
|
|
||||||
@ -3043,7 +3095,20 @@ class Form
|
|||||||
// "key" value of json key array is used by jQuery automatically as selected value
|
// "key" value of json key array is used by jQuery automatically as selected value
|
||||||
// "label" value of json key array is used by jQuery automatically as text for combo box
|
// "label" value of json key array is used by jQuery automatically as text for combo box
|
||||||
$out .= $opt;
|
$out .= $opt;
|
||||||
array_push($outarray, array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'qty'=>$outqty, 'up'=>$objp->unitprice, 'discount'=>$outdiscount, 'type'=>$outtype, 'duration_value'=>$outdurationvalue, 'duration_unit'=>$outdurationunit, 'disabled'=>(empty($objp->idprodfournprice) ?true:false)));
|
array_push($outarray,
|
||||||
|
array('key'=>$outkey,
|
||||||
|
'value'=>$outref,
|
||||||
|
'label'=>$outval,
|
||||||
|
'qty'=>$outqty,
|
||||||
|
'up'=>$objp->unitprice,
|
||||||
|
'discount'=>$outdiscount,
|
||||||
|
'type'=>$outtype,
|
||||||
|
'duration_value'=>$outdurationvalue,
|
||||||
|
'duration_unit'=>$outdurationunit,
|
||||||
|
'disabled'=>(empty($objp->idprodfournprice) ?true:false),
|
||||||
|
'description'=>$objp->description
|
||||||
|
)
|
||||||
|
);
|
||||||
// Exemple of var_dump $outarray
|
// Exemple of var_dump $outarray
|
||||||
// array(1) {[0]=>array(6) {[key"]=>string(1) "2" ["value"]=>string(3) "ppp"
|
// array(1) {[0]=>array(6) {[key"]=>string(1) "2" ["value"]=>string(3) "ppp"
|
||||||
// ["label"]=>string(76) "ppp (<strong>f</strong>ff2) - ppp - 20,00 Euros/1unité (20,00 Euros/unité)"
|
// ["label"]=>string(76) "ppp (<strong>f</strong>ff2) - ppp - 20,00 Euros/1unité (20,00 Euros/unité)"
|
||||||
@ -3749,9 +3814,10 @@ class Form
|
|||||||
* @param string $filtre To filter list
|
* @param string $filtre To filter list
|
||||||
* @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries.
|
* @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries.
|
||||||
* @param string $moreattrib To add more attribute on select
|
* @param string $moreattrib To add more attribute on select
|
||||||
|
* @param int $noinfoadmin 0=Add admin info, 1=Disable admin info
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function selectShippingMethod($selected = '', $htmlname = 'shipping_method_id', $filtre = '', $useempty = 0, $moreattrib = '')
|
public function selectShippingMethod($selected = '', $htmlname = 'shipping_method_id', $filtre = '', $useempty = 0, $moreattrib = '', $noinfoadmin = 0)
|
||||||
{
|
{
|
||||||
global $langs, $conf, $user;
|
global $langs, $conf, $user;
|
||||||
|
|
||||||
@ -3786,7 +3852,7 @@ class Form
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print "</select>";
|
print "</select>";
|
||||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
if ($user->admin && empty($noinfoadmin)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||||
|
|
||||||
print ajax_combobox('select'.$htmlname);
|
print ajax_combobox('select'.$htmlname);
|
||||||
} else {
|
} else {
|
||||||
@ -3890,9 +3956,10 @@ class Form
|
|||||||
* @param string $selected Preselected Unit ID
|
* @param string $selected Preselected Unit ID
|
||||||
* @param string $htmlname Select name
|
* @param string $htmlname Select name
|
||||||
* @param int $showempty Add a nempty line
|
* @param int $showempty Add a nempty line
|
||||||
|
* @param string $unit_type Restrict to one given unit type
|
||||||
* @return string HTML select
|
* @return string HTML select
|
||||||
*/
|
*/
|
||||||
public function selectUnits($selected = '', $htmlname = 'units', $showempty = 0)
|
public function selectUnits($selected = '', $htmlname = 'units', $showempty = 0, $unit_type = '')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
@ -3902,6 +3969,9 @@ class Form
|
|||||||
|
|
||||||
$sql = 'SELECT rowid, label, code from '.MAIN_DB_PREFIX.'c_units';
|
$sql = 'SELECT rowid, label, code from '.MAIN_DB_PREFIX.'c_units';
|
||||||
$sql .= ' WHERE active > 0';
|
$sql .= ' WHERE active > 0';
|
||||||
|
if (!empty($unit_type)) {
|
||||||
|
$sql .= " AND unit_type = '".$this->db->escape($unit_type)."'";
|
||||||
|
}
|
||||||
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql && $this->db->num_rows($resql) > 0)
|
if ($resql && $this->db->num_rows($resql) > 0)
|
||||||
|
|||||||
@ -202,7 +202,8 @@ class FormActions
|
|||||||
$newcardbutton = '';
|
$newcardbutton = '';
|
||||||
if (!empty($conf->agenda->enabled) && !empty($user->rights->agenda->myactions->create))
|
if (!empty($conf->agenda->enabled) && !empty($user->rights->agenda->myactions->create))
|
||||||
{
|
{
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog')).'&origin='.urlencode($typeelement).'&originid='.$object->id.($object->socid > 0 ? '&socid='.$object->socid : ($socid > 0 ? '&socid='.$socid : '')).($projectid > 0 ? '&projectid='.$projectid : '').'&backtopage='.urlencode($urlbacktopage));
|
$url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog')).'&origin='.urlencode($typeelement).'&originid='.$object->id.((!empty($object->socid) && $object->socid > 0) ? '&socid='.$object->socid : ((!empty($socid) && $socid > 0) ? '&socid='.$socid : '')).($projectid > 0 ? '&projectid='.$projectid : '').'&backtopage='.urlencode($urlbacktopage);
|
||||||
|
$newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', $url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -244,7 +245,7 @@ class FormActions
|
|||||||
print '<td class="nowraponall tdoverflowmax125">';
|
print '<td class="nowraponall tdoverflowmax125">';
|
||||||
if (!empty($actioncomm->userownerid))
|
if (!empty($actioncomm->userownerid))
|
||||||
{
|
{
|
||||||
if (is_object($cacheusers[$actioncomm->userownerid]))
|
if (isset($cacheusers[$actioncomm->userownerid]) && is_object($cacheusers[$actioncomm->userownerid]))
|
||||||
{
|
{
|
||||||
$tmpuser = $cacheusers[$actioncomm->userownerid];
|
$tmpuser = $cacheusers[$actioncomm->userownerid];
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -135,15 +135,39 @@ class FormFile
|
|||||||
|
|
||||||
$max = $conf->global->MAIN_UPLOAD_DOC; // In Kb
|
$max = $conf->global->MAIN_UPLOAD_DOC; // In Kb
|
||||||
$maxphp = @ini_get('upload_max_filesize'); // In unknown
|
$maxphp = @ini_get('upload_max_filesize'); // In unknown
|
||||||
if (preg_match('/k$/i', $maxphp)) $maxphp = $maxphp * 1;
|
if (preg_match('/k$/i', $maxphp)) {
|
||||||
if (preg_match('/m$/i', $maxphp)) $maxphp = $maxphp * 1024;
|
$maxphp = preg_replace('/k$/i', '', $maxphp);
|
||||||
if (preg_match('/g$/i', $maxphp)) $maxphp = $maxphp * 1024 * 1024;
|
$maxphp = $maxphp * 1;
|
||||||
if (preg_match('/t$/i', $maxphp)) $maxphp = $maxphp * 1024 * 1024 * 1024;
|
}
|
||||||
|
if (preg_match('/m$/i', $maxphp)) {
|
||||||
|
$maxphp = preg_replace('/m$/i', '', $maxphp);
|
||||||
|
$maxphp = $maxphp * 1024;
|
||||||
|
}
|
||||||
|
if (preg_match('/g$/i', $maxphp)) {
|
||||||
|
$maxphp = preg_replace('/g$/i', '', $maxphp);
|
||||||
|
$maxphp = $maxphp * 1024 * 1024;
|
||||||
|
}
|
||||||
|
if (preg_match('/t$/i', $maxphp)) {
|
||||||
|
$maxphp = preg_replace('/t$/i', '', $maxphp);
|
||||||
|
$maxphp = $maxphp * 1024 * 1024 * 1024;
|
||||||
|
}
|
||||||
$maxphp2 = @ini_get('post_max_size'); // In unknown
|
$maxphp2 = @ini_get('post_max_size'); // In unknown
|
||||||
if (preg_match('/k$/i', $maxphp2)) $maxphp2 = $maxphp2 * 1;
|
if (preg_match('/k$/i', $maxphp2)) {
|
||||||
if (preg_match('/m$/i', $maxphp2)) $maxphp2 = $maxphp2 * 1024;
|
$maxphp2 = preg_replace('/k$/i', '', $maxphp2);
|
||||||
if (preg_match('/g$/i', $maxphp2)) $maxphp2 = $maxphp2 * 1024 * 1024;
|
$maxphp2 = $maxphp2 * 1;
|
||||||
if (preg_match('/t$/i', $maxphp2)) $maxphp2 = $maxphp2 * 1024 * 1024 * 1024;
|
}
|
||||||
|
if (preg_match('/m$/i', $maxphp2)) {
|
||||||
|
$maxphp2 = preg_replace('/m$/i', '', $maxphp2);
|
||||||
|
$maxphp2 = $maxphp2 * 1024;
|
||||||
|
}
|
||||||
|
if (preg_match('/g$/i', $maxphp2)) {
|
||||||
|
$maxphp2 = preg_replace('/g$/i', '', $maxphp2);
|
||||||
|
$maxphp2 = $maxphp2 * 1024 * 1024;
|
||||||
|
}
|
||||||
|
if (preg_match('/t$/i', $maxphp2)) {
|
||||||
|
$maxphp2 = preg_replace('/t$/i', '', $maxphp2);
|
||||||
|
$maxphp2 = $maxphp2 * 1024 * 1024 * 1024;
|
||||||
|
}
|
||||||
// Now $max and $maxphp and $maxphp2 are in Kb
|
// Now $max and $maxphp and $maxphp2 are in Kb
|
||||||
$maxmin = $max;
|
$maxmin = $max;
|
||||||
$maxphptoshow = $maxphptoshowparam = '';
|
$maxphptoshow = $maxphptoshowparam = '';
|
||||||
@ -1049,8 +1073,8 @@ class FormFile
|
|||||||
if (empty($relativepath))
|
if (empty($relativepath))
|
||||||
{
|
{
|
||||||
$relativepath = (!empty($object->ref) ?dol_sanitizeFileName($object->ref) : '').'/';
|
$relativepath = (!empty($object->ref) ?dol_sanitizeFileName($object->ref) : '').'/';
|
||||||
if ($object->element == 'invoice_supplier') $relativepath = get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').$relativepath; // TODO Call using a defined value for $relativepath
|
if (!empty($object->element) && $object->element == 'invoice_supplier') $relativepath = get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').$relativepath; // TODO Call using a defined value for $relativepath
|
||||||
if ($object->element == 'project_task') $relativepath = 'Call_not_supported_._Call_function_using_a_defined_relative_path_.';
|
if (!empty($object->element) && $object->element == 'project_task') $relativepath = 'Call_not_supported_._Call_function_using_a_defined_relative_path_.';
|
||||||
}
|
}
|
||||||
// For backward compatiblity, we detect file stored into an old path
|
// For backward compatiblity, we detect file stored into an old path
|
||||||
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO) && $filearray[0]['level1name'] == 'photos')
|
if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO) && $filearray[0]['level1name'] == 'photos')
|
||||||
|
|||||||
@ -106,7 +106,8 @@ class InfoBox
|
|||||||
if (is_object($user)) $sql .= " AND b.fk_user IN (0,".$user->id.")";
|
if (is_object($user)) $sql .= " AND b.fk_user IN (0,".$user->id.")";
|
||||||
else $sql .= " AND b.fk_user = 0";
|
else $sql .= " AND b.fk_user = 0";
|
||||||
$sql .= " ORDER BY b.box_order";
|
$sql .= " ORDER BY b.box_order";
|
||||||
} else // available
|
}
|
||||||
|
else // available
|
||||||
{
|
{
|
||||||
$sql = "SELECT d.rowid as box_id, d.file, d.note, d.tms";
|
$sql = "SELECT d.rowid as box_id, d.file, d.note, d.tms";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."boxes_def as d";
|
$sql .= " FROM ".MAIN_DB_PREFIX."boxes_def as d";
|
||||||
@ -150,7 +151,7 @@ class InfoBox
|
|||||||
// box properties
|
// box properties
|
||||||
$box->rowid = (empty($obj->rowid) ? '' : $obj->rowid);
|
$box->rowid = (empty($obj->rowid) ? '' : $obj->rowid);
|
||||||
$box->id = (empty($obj->box_id) ? '' : $obj->box_id);
|
$box->id = (empty($obj->box_id) ? '' : $obj->box_id);
|
||||||
$box->position = ($obj->position == '' ? '' : $obj->position); // '0' must stay '0'
|
$box->position = ((isset($obj->position) && $obj->position == '') ? '' : (isset($obj->position) ? $obj->position : '')); // '0' must stay '0'
|
||||||
$box->box_order = (empty($obj->box_order) ? '' : $obj->box_order);
|
$box->box_order = (empty($obj->box_order) ? '' : $obj->box_order);
|
||||||
$box->fk_user = (empty($obj->fk_user) ? 0 : $obj->fk_user);
|
$box->fk_user = (empty($obj->fk_user) ? 0 : $obj->fk_user);
|
||||||
$box->sourcefile = $relsourcefile;
|
$box->sourcefile = $relsourcefile;
|
||||||
|
|||||||
@ -81,7 +81,8 @@ class Notify
|
|||||||
'EXPENSE_REPORT_VALIDATE',
|
'EXPENSE_REPORT_VALIDATE',
|
||||||
'EXPENSE_REPORT_APPROVE',
|
'EXPENSE_REPORT_APPROVE',
|
||||||
'HOLIDAY_VALIDATE',
|
'HOLIDAY_VALIDATE',
|
||||||
'HOLIDAY_APPROVE'
|
'HOLIDAY_APPROVE',
|
||||||
|
'ACTION_CREATE'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -535,6 +536,12 @@ class Notify
|
|||||||
$dir_output = $conf->holiday->dir_output;
|
$dir_output = $conf->holiday->dir_output;
|
||||||
$object_type = 'holiday';
|
$object_type = 'holiday';
|
||||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextHolidayApproved", $link);
|
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextHolidayApproved", $link);
|
||||||
|
break;
|
||||||
|
case 'ACTION_CREATE':
|
||||||
|
$link = '<a href="'.$urlwithroot.'/comm/action/card.php?id='.$object->id.'">'.$newref.'</a>';
|
||||||
|
$dir_output = $conf->agenda->dir_output;
|
||||||
|
$object_type = 'action';
|
||||||
|
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextActionAdded", $link);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$ref = dol_sanitizeFileName($newref);
|
$ref = dol_sanitizeFileName($newref);
|
||||||
@ -749,6 +756,12 @@ class Notify
|
|||||||
$object_type = 'holiday';
|
$object_type = 'holiday';
|
||||||
$mesg = $langs->transnoentitiesnoconv("EMailTextHolidayApproved", $link);
|
$mesg = $langs->transnoentitiesnoconv("EMailTextHolidayApproved", $link);
|
||||||
break;
|
break;
|
||||||
|
case 'ACTION_CREATE':
|
||||||
|
$link = '<a href="'.$urlwithroot.'/comm/action/card.php?id='.$object->id.'">'.$newref.'</a>';
|
||||||
|
$dir_output = $conf->agenda->dir_output;
|
||||||
|
$object_type = 'action';
|
||||||
|
$mesg = $langs->transnoentitiesnoconv("EMailTextActionAdded", $link);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
$ref = dol_sanitizeFileName($newref);
|
$ref = dol_sanitizeFileName($newref);
|
||||||
$pdf_path = $dir_output."/".$ref."/".$ref.".pdf";
|
$pdf_path = $dir_output."/".$ref."/".$ref.".pdf";
|
||||||
|
|||||||
@ -731,7 +731,7 @@ class Translate
|
|||||||
*/
|
*/
|
||||||
public function transcountry($str, $countrycode)
|
public function transcountry($str, $countrycode)
|
||||||
{
|
{
|
||||||
if ($this->tab_translate["$str$countrycode"]) return $this->trans("$str$countrycode");
|
if (!empty($this->tab_translate["$str$countrycode"])) return $this->trans("$str$countrycode");
|
||||||
else return $this->trans($str);
|
else return $this->trans($str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -135,7 +135,11 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
|
|||||||
}
|
}
|
||||||
return { label: label, value: item.value, id: item.key, disabled: item.disabled,
|
return { label: label, value: item.value, id: item.key, disabled: item.disabled,
|
||||||
update: update, textarea: textarea,
|
update: update, textarea: textarea,
|
||||||
pbq: item.pbq, type: item.type, qty: item.qty, discount: item.discount, pricebasetype: item.pricebasetype, price_ht: item.price_ht, price_ttc: item.price_ttc }
|
pbq: item.pbq,
|
||||||
|
type: item.type, qty: item.qty, discount: item.discount,
|
||||||
|
pricebasetype: item.pricebasetype, price_ht: item.price_ht,
|
||||||
|
price_ttc: item.price_ttc,
|
||||||
|
up: item.up, description : item.description}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
else console.error("Error: Ajax url '.$url.($urloption ? '?'.$urloption : '').' has returned an empty page. Should be an empty json array.");
|
else console.error("Error: Ajax url '.$url.($urloption ? '?'.$urloption : '').' has returned an empty page. Should be an empty json array.");
|
||||||
@ -148,12 +152,32 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen
|
|||||||
console.log("Selected id = "+ui.item.id+" - If this value is null, it means you select a record with key that is null so selection is not effective");
|
console.log("Selected id = "+ui.item.id+" - If this value is null, it means you select a record with key that is null so selection is not effective");
|
||||||
|
|
||||||
//console.log(ui.item);
|
//console.log(ui.item);
|
||||||
$("#'.$htmlname.'").attr("data-pbq", ui.item.pbq);
|
//For supplier price
|
||||||
$("#'.$htmlname.'").attr("data-pbqup", ui.item.price_ht);
|
$("#'.$htmlname.'").attr("data-up", ui.item.up);
|
||||||
$("#'.$htmlname.'").attr("data-pbqbase", ui.item.pricebasetype);
|
$("#'.$htmlname.'").attr("data-discount", ui.item.discount);
|
||||||
$("#'.$htmlname.'").attr("data-pbqqty", ui.item.qty);
|
$("#'.$htmlname.'").attr("data-qty", ui.item.qty);
|
||||||
$("#'.$htmlname.'").attr("data-pbqpercent", ui.item.discount);
|
$("#'.$htmlname.'").attr("data-description", ui.item.description);
|
||||||
|
|
||||||
|
//For customer price
|
||||||
|
';
|
||||||
|
|
||||||
|
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) {
|
||||||
|
$script .= '
|
||||||
|
$("#' . $htmlname . '").attr("data-pbq", ui.item.pbq);
|
||||||
|
$("#' . $htmlname . '").attr("data-pbqup", ui.item.price_ht);
|
||||||
|
$("#' . $htmlname . '").attr("data-pbqbase", ui.item.pricebasetype);
|
||||||
|
$("#' . $htmlname . '").attr("data-pbqqty", ui.item.qty);
|
||||||
|
$("#' . $htmlname . '").attr("data-pbqpercent", ui.item.discount);
|
||||||
|
';
|
||||||
|
} else {
|
||||||
|
$script .= '
|
||||||
|
$("#' . $htmlname . '").attr("data-up", ui.item.price_ht);
|
||||||
|
$("#' . $htmlname . '").attr("data-base", ui.item.pricebasetype);
|
||||||
|
$("#' . $htmlname . '").attr("data-qty", ui.item.qty);
|
||||||
|
$("#' . $htmlname . '").attr("data-discount", ui.item.discount);
|
||||||
|
';
|
||||||
|
}
|
||||||
|
$script .= '
|
||||||
$("#'.$htmlname.'").val(ui.item.id).trigger("change"); // Select new value
|
$("#'.$htmlname.'").val(ui.item.id).trigger("change"); // Select new value
|
||||||
// Disable an element
|
// Disable an element
|
||||||
if (options.option_disabled) {
|
if (options.option_disabled) {
|
||||||
|
|||||||
@ -302,7 +302,7 @@ function societe_prepare_head(Societe $object)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id;
|
||||||
$head[$h][1] .= $langs->trans("Events");
|
$head[$h][1] = $langs->trans("Events");
|
||||||
if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
|
if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
|
||||||
$head[$h][1] .= '/';
|
$head[$h][1] .= '/';
|
||||||
$head[$h][1] .= $langs->trans("Agenda");
|
$head[$h][1] .= $langs->trans("Agenda");
|
||||||
@ -862,7 +862,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
|
|||||||
|
|
||||||
// Definition of fields for list
|
// Definition of fields for list
|
||||||
$arrayfields = array(
|
$arrayfields = array(
|
||||||
't.rowid'=>array('label'=>"TechnicalID", 'checked'=>($conf->global->MAIN_SHOW_TECHNICAL_ID ? 1 : 0), 'enabled'=>($conf->global->MAIN_SHOW_TECHNICAL_ID ? 1 : 0), 'position'=>1),
|
't.rowid'=>array('label'=>"TechnicalID", 'checked'=>(!empty($conf->global->MAIN_SHOW_TECHNICAL_ID) ? 1 : 0), 'enabled'=>(!empty($conf->global->MAIN_SHOW_TECHNICAL_ID) ? 1 : 0), 'position'=>1),
|
||||||
't.name'=>array('label'=>"Name", 'checked'=>1, 'position'=>10),
|
't.name'=>array('label'=>"Name", 'checked'=>1, 'position'=>10),
|
||||||
't.poste'=>array('label'=>"PostOrFunction", 'checked'=>1, 'position'=>20),
|
't.poste'=>array('label'=>"PostOrFunction", 'checked'=>1, 'position'=>20),
|
||||||
't.address'=>array('label'=>(empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email") : $langs->trans("Address")), 'checked'=>1, 'position'=>30),
|
't.address'=>array('label'=>(empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email") : $langs->trans("Address")), 'checked'=>1, 'position'=>30),
|
||||||
@ -870,7 +870,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
|
|||||||
't.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>50, 'class'=>'center'),
|
't.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>50, 'class'=>'center'),
|
||||||
);
|
);
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attributes[$contactstatic->table_element]['label']) && count($extrafields->attributes[$contactstatic->table_element]['label'])) {
|
if (!empty($extrafields->attributes[$contactstatic->table_element]['label']) && is_array($extrafields->attributes[$contactstatic->table_element]['label']) && count($extrafields->attributes[$contactstatic->table_element]['label'])) {
|
||||||
foreach ($extrafields->attributes[$contactstatic->table_element]['label'] as $key => $val) {
|
foreach ($extrafields->attributes[$contactstatic->table_element]['label'] as $key => $val) {
|
||||||
if (!empty($extrafields->attributes[$contactstatic->table_element]['list'][$key])) {
|
if (!empty($extrafields->attributes[$contactstatic->table_element]['list'][$key])) {
|
||||||
$arrayfields["ef.".$key] = array(
|
$arrayfields["ef.".$key] = array(
|
||||||
@ -989,7 +989,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
|
|||||||
} elseif (in_array($key, array('role'))) {
|
} elseif (in_array($key, array('role'))) {
|
||||||
print $formcompany->showRoles("search_roles", $contactstatic, 'edit', $search_roles);
|
print $formcompany->showRoles("search_roles", $contactstatic, 'edit', $search_roles);
|
||||||
} else {
|
} else {
|
||||||
print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'">';
|
print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.(!empty($search[$key]) ? dol_escape_htmltag($search[$key]) : '').'">';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
@ -1204,14 +1204,17 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
|
|||||||
{
|
{
|
||||||
global $user, $conf;
|
global $user, $conf;
|
||||||
global $form;
|
global $form;
|
||||||
|
|
||||||
global $param, $massactionbutton;
|
global $param, $massactionbutton;
|
||||||
|
|
||||||
$start_year = GETPOST('dateevent_startyear');
|
$start_year = GETPOST('dateevent_startyear');
|
||||||
$start_month = GETPOST('dateevent_startmonth');
|
$start_month = GETPOST('dateevent_startmonth');
|
||||||
$start_day = GETPOST('dateevent_startday');
|
$start_day = GETPOST('dateevent_startday');
|
||||||
$end_year = GETPOST('dateevent_endyear');
|
$end_year = GETPOST('dateevent_endyear');
|
||||||
$end_month = GETPOST('dateevent_endmonth');
|
$end_month = GETPOST('dateevent_endmonth');
|
||||||
$end_day = GETPOST('dateevent_endday');
|
$end_day = GETPOST('dateevent_endday');
|
||||||
|
$tms_start = '';
|
||||||
|
$tms_end = '';
|
||||||
|
|
||||||
if (!empty($start_year) && !empty($start_month) && !empty($start_day)) {
|
if (!empty($start_year) && !empty($start_month) && !empty($start_day)) {
|
||||||
$search_start = $start_year.'-'.$start_month.'-'.$start_day;
|
$search_start = $start_year.'-'.$start_month.'-'.$start_day;
|
||||||
$tms_start = strtotime($search_start);
|
$tms_start = strtotime($search_start);
|
||||||
@ -1391,7 +1394,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
|
|||||||
//if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
|
//if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
|
||||||
//elseif ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
|
//elseif ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
|
||||||
$tododone = '';
|
$tododone = '';
|
||||||
if (($obj->percent >= 0 and $obj->percent < 100) || ($obj->percent == -1 && $obj->datep > $now)) $tododone = 'todo';
|
if (($obj->percent >= 0 and $obj->percent < 100) || ($obj->percent == -1 && (!empty($obj->datep) && $obj->datep > $now))) $tododone = 'todo';
|
||||||
|
|
||||||
$histo[$numaction] = array(
|
$histo[$numaction] = array(
|
||||||
'type'=>$obj->type,
|
'type'=>$obj->type,
|
||||||
|
|||||||
@ -680,7 +680,8 @@ function checkVal($out = '', $check = 'alphanohtml', $filter = null, $options =
|
|||||||
if (!is_array($out)) {
|
if (!is_array($out)) {
|
||||||
// '"' is dangerous because param in url can close the href= or src= and add javascript functions.
|
// '"' is dangerous because param in url can close the href= or src= and add javascript functions.
|
||||||
// '../' is dangerous because it allows dir transversals
|
// '../' is dangerous because it allows dir transversals
|
||||||
$out = str_replace(array('"', '"', '../'), '', trim($out));
|
$out = str_replace(array('"', '"'), "''", trim($out));
|
||||||
|
$out = str_replace(array('../'), '', $out);
|
||||||
// keep lines feed
|
// keep lines feed
|
||||||
$out = dol_string_nohtmltag($out, 0);
|
$out = dol_string_nohtmltag($out, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -163,7 +163,7 @@ function tree_recur($tab, $pere, $rang, $iddivjstree = 'iddivjstree', $donoreset
|
|||||||
|
|
||||||
print '<ul'.(empty($pere['rowid']) ? ' id="treeData"' : '').'>'; $ulprinted++;
|
print '<ul'.(empty($pere['rowid']) ? ' id="treeData"' : '').'>'; $ulprinted++;
|
||||||
}
|
}
|
||||||
print "\n".'<li '.($tab[$x]['statut'] ? ' class="liuseractive"' : 'class="liuserdisabled"').'>';
|
print "\n".'<li '.(!empty($tab[$x]['statut']) ? ' class="liuseractive"' : 'class="liuserdisabled"').'>';
|
||||||
if ($showfk)
|
if ($showfk)
|
||||||
{
|
{
|
||||||
print '<table class="nobordernopadding centpercent"><tr><td>';
|
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||||
@ -194,7 +194,7 @@ function tree_recur($tab, $pere, $rang, $iddivjstree = 'iddivjstree', $donoreset
|
|||||||
|
|
||||||
print '<ul'.(empty($pere['rowid']) ? ' id="treeData"' : '').'>'; $ulprinted++;
|
print '<ul'.(empty($pere['rowid']) ? ' id="treeData"' : '').'>'; $ulprinted++;
|
||||||
}
|
}
|
||||||
print "\n".'<li '.($tab[$x]['statut'] ? ' class="liuseractive"' : 'class="liuserdisabled"').'>';
|
print "\n".'<li '.(!empty($tab[$x]['statut']) ? ' class="liuseractive"' : 'class="liuserdisabled"').'>';
|
||||||
if ($showfk)
|
if ($showfk)
|
||||||
{
|
{
|
||||||
print '<table class="nobordernopadding centpercent"><tr><td>';
|
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||||
|
|||||||
@ -498,7 +498,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
|||||||
print '<td colspan="'.($colspan - 1).'">';
|
print '<td colspan="'.($colspan - 1).'">';
|
||||||
//var_dump($conf->global->THEME_ELDY_BACKBODY);
|
//var_dump($conf->global->THEME_ELDY_BACKBODY);
|
||||||
if ($edit) {
|
if ($edit) {
|
||||||
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKBODY, array()), ''), 'THEME_ELDY_BACKBODY', '', 1, '', '', 'colorbackbody').' ';
|
print $formother->selectColor(colorArrayToHex(colorStringToArray((!empty($conf->global->THEME_ELDY_BACKBODY) ? $conf->global->THEME_ELDY_BACKBODY : ''), array()), ''), 'THEME_ELDY_BACKBODY', '', 1, '', '', 'colorbackbody').' ';
|
||||||
} else {
|
} else {
|
||||||
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKBODY, array()), '');
|
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKBODY, array()), '');
|
||||||
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
||||||
@ -539,7 +539,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
|||||||
print '<td>'.$langs->trans("TopMenuBackgroundColor").'</td>';
|
print '<td>'.$langs->trans("TopMenuBackgroundColor").'</td>';
|
||||||
print '<td colspan="'.($colspan - 1).'">';
|
print '<td colspan="'.($colspan - 1).'">';
|
||||||
if ($edit) {
|
if ($edit) {
|
||||||
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1, array()), ''), 'THEME_ELDY_TOPMENU_BACK1', '', 1, '', '', 'colorbackhmenu1').' ';
|
print $formother->selectColor(colorArrayToHex(colorStringToArray((!empty($conf->global->THEME_ELDY_TOPMENU_BACK1) ? $conf->global->THEME_ELDY_TOPMENU_BACK1 : ''), array()), ''), 'THEME_ELDY_TOPMENU_BACK1', '', 1, '', '', 'colorbackhmenu1').' ';
|
||||||
} else {
|
} else {
|
||||||
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1, array()), '');
|
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1, array()), '');
|
||||||
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
||||||
@ -580,7 +580,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
|||||||
print '<td>'.$langs->trans("LeftMenuBackgroundColor").'</td>';
|
print '<td>'.$langs->trans("LeftMenuBackgroundColor").'</td>';
|
||||||
print '<td colspan="'.($colspan - 1).'">';
|
print '<td colspan="'.($colspan - 1).'">';
|
||||||
if ($edit) {
|
if ($edit) {
|
||||||
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_VERMENU_BACK1, array()), ''), 'THEME_ELDY_VERMENU_BACK1', '', 1, '', '', 'colorbackvmenu1').' ';
|
print $formother->selectColor(colorArrayToHex(colorStringToArray((!empty($conf->global->THEME_ELDY_VERMENU_BACK1) ? $conf->global->THEME_ELDY_VERMENU_BACK1 : ''), array()), ''), 'THEME_ELDY_VERMENU_BACK1', '', 1, '', '', 'colorbackvmenu1').' ';
|
||||||
} else {
|
} else {
|
||||||
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_VERMENU_BACK1, array()), '');
|
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_VERMENU_BACK1, array()), '');
|
||||||
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
||||||
@ -601,7 +601,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
|||||||
print '<td>'.$langs->trans("TextTitleColor").'</td>';
|
print '<td>'.$langs->trans("TextTitleColor").'</td>';
|
||||||
print '<td colspan="'.($colspan - 1).'">';
|
print '<td colspan="'.($colspan - 1).'">';
|
||||||
if ($edit) {
|
if ($edit) {
|
||||||
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTTITLENOTAB, array()), ''), 'THEME_ELDY_TEXTTITLENOTAB', '', 1, '', '', 'colortexttitlenotab').' ';
|
print $formother->selectColor(colorArrayToHex(colorStringToArray((!empty($conf->global->THEME_ELDY_TEXTTITLENOTAB) ? $conf->global->THEME_ELDY_TEXTTITLENOTAB : ''), array()), ''), 'THEME_ELDY_TEXTTITLENOTAB', '', 1, '', '', 'colortexttitlenotab').' ';
|
||||||
} else {
|
} else {
|
||||||
print $formother->showColor($conf->global->THEME_ELDY_TEXTTITLENOTAB, $langs->trans("Default"));
|
print $formother->showColor($conf->global->THEME_ELDY_TEXTTITLENOTAB, $langs->trans("Default"));
|
||||||
}
|
}
|
||||||
@ -621,7 +621,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
|||||||
print '<td>'.$langs->trans("BackgroundTableTitleColor").'</td>';
|
print '<td>'.$langs->trans("BackgroundTableTitleColor").'</td>';
|
||||||
print '<td colspan="'.($colspan - 1).'">';
|
print '<td colspan="'.($colspan - 1).'">';
|
||||||
if ($edit) {
|
if ($edit) {
|
||||||
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKTITLE1, array()), ''), 'THEME_ELDY_BACKTITLE1', '', 1, '', '', 'colorbacktitle1').' ';
|
print $formother->selectColor(colorArrayToHex(colorStringToArray((!empty($conf->global->THEME_ELDY_BACKTITLE1) ? $conf->global->THEME_ELDY_BACKTITLE1 : ''), array()), ''), 'THEME_ELDY_BACKTITLE1', '', 1, '', '', 'colorbacktitle1').' ';
|
||||||
} else {
|
} else {
|
||||||
print $formother->showColor($conf->global->THEME_ELDY_BACKTITLE1, $langs->trans("Default"));
|
print $formother->showColor($conf->global->THEME_ELDY_BACKTITLE1, $langs->trans("Default"));
|
||||||
}
|
}
|
||||||
@ -641,7 +641,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
|||||||
print '<td>'.$langs->trans("BackgroundTableTitleTextColor").'</td>';
|
print '<td>'.$langs->trans("BackgroundTableTitleTextColor").'</td>';
|
||||||
print '<td colspan="'.($colspan - 1).'">';
|
print '<td colspan="'.($colspan - 1).'">';
|
||||||
if ($edit) {
|
if ($edit) {
|
||||||
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTTITLE, array()), ''), 'THEME_ELDY_TEXTTITLE', '', 1, '', '', 'colortexttitle').' ';
|
print $formother->selectColor(colorArrayToHex(colorStringToArray((!empty($conf->global->THEME_ELDY_TEXTTITLE) ? $conf->global->THEME_ELDY_TEXTTITLE : ''), array()), ''), 'THEME_ELDY_TEXTTITLE', '', 1, '', '', 'colortexttitle').' ';
|
||||||
} else {
|
} else {
|
||||||
print $formother->showColor($conf->global->THEME_ELDY_TEXTTITLE, $langs->trans("Default"));
|
print $formother->showColor($conf->global->THEME_ELDY_TEXTTITLE, $langs->trans("Default"));
|
||||||
}
|
}
|
||||||
@ -661,7 +661,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
|||||||
print '<td>'.$langs->trans("BackgroundTableTitleTextlinkColor").'</td>';
|
print '<td>'.$langs->trans("BackgroundTableTitleTextlinkColor").'</td>';
|
||||||
print '<td colspan="'.($colspan - 1).'">';
|
print '<td colspan="'.($colspan - 1).'">';
|
||||||
if ($edit) {
|
if ($edit) {
|
||||||
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTTITLELINK, array()), ''), 'THEME_ELDY_TEXTTITLELINK', '', 1, '', '', 'colortexttitlelink').' ';
|
print $formother->selectColor(colorArrayToHex(colorStringToArray((!empty($conf->global->THEME_ELDY_TEXTTITLELINK) ? $conf->global->THEME_ELDY_TEXTTITLELINK : ''), array()), ''), 'THEME_ELDY_TEXTTITLELINK', '', 1, '', '', 'colortexttitlelink').' ';
|
||||||
} else {
|
} else {
|
||||||
print $formother->showColor($conf->global->THEME_ELDY_TEXTTITLELINK, $langs->trans("Default"));
|
print $formother->showColor($conf->global->THEME_ELDY_TEXTTITLELINK, $langs->trans("Default"));
|
||||||
}
|
}
|
||||||
@ -682,7 +682,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
|||||||
print '<td>'.$langs->trans("BackgroundTableLineOddColor").'</td>';
|
print '<td>'.$langs->trans("BackgroundTableLineOddColor").'</td>';
|
||||||
print '<td colspan="'.($colspan - 1).'">';
|
print '<td colspan="'.($colspan - 1).'">';
|
||||||
if ($edit) {
|
if ($edit) {
|
||||||
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEIMPAIR1, array()), ''), 'THEME_ELDY_LINEIMPAIR1', '', 1, '', '', 'colorbacklinepair2').' ';
|
print $formother->selectColor(colorArrayToHex(colorStringToArray((!empty($conf->global->THEME_ELDY_LINEIMPAIR1) ? $conf->global->THEME_ELDY_LINEIMPAIR1 : ''), array()), ''), 'THEME_ELDY_LINEIMPAIR1', '', 1, '', '', 'colorbacklinepair2').' ';
|
||||||
} else {
|
} else {
|
||||||
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEIMPAIR1, array()), '');
|
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEIMPAIR1, array()), '');
|
||||||
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
||||||
@ -703,7 +703,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
|||||||
print '<td>'.$langs->trans("BackgroundTableLineEvenColor").'</td>';
|
print '<td>'.$langs->trans("BackgroundTableLineEvenColor").'</td>';
|
||||||
print '<td colspan="'.($colspan - 1).'">';
|
print '<td colspan="'.($colspan - 1).'">';
|
||||||
if ($edit) {
|
if ($edit) {
|
||||||
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEPAIR1, array()), ''), 'THEME_ELDY_LINEPAIR1', '', 1, '', '', 'colorbacklineimpair2').' ';
|
print $formother->selectColor(colorArrayToHex(colorStringToArray((!empty($conf->global->THEME_ELDY_LINEPAIR1) ? $conf->global->THEME_ELDY_LINEPAIR1 : ''), array()), ''), 'THEME_ELDY_LINEPAIR1', '', 1, '', '', 'colorbacklineimpair2').' ';
|
||||||
} else {
|
} else {
|
||||||
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEPAIR1, array()), '');
|
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_LINEPAIR1, array()), '');
|
||||||
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
||||||
@ -744,7 +744,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
|||||||
print '<td>'.$langs->trans("LinkColor").'</td>';
|
print '<td>'.$langs->trans("LinkColor").'</td>';
|
||||||
print '<td colspan="'.($colspan - 1).'">';
|
print '<td colspan="'.($colspan - 1).'">';
|
||||||
if ($edit) {
|
if ($edit) {
|
||||||
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTLINK, array()), ''), 'THEME_ELDY_TEXTLINK', '', 1, '', '', 'colortextlink').' ';
|
print $formother->selectColor(colorArrayToHex(colorStringToArray((!empty($conf->global->THEME_ELDY_TEXTLINK) ? $conf->global->THEME_ELDY_TEXTLINK : ''), array()), ''), 'THEME_ELDY_TEXTLINK', '', 1, '', '', 'colortextlink').' ';
|
||||||
} else {
|
} else {
|
||||||
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTLINK, array()), '');
|
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTLINK, array()), '');
|
||||||
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
||||||
@ -781,12 +781,12 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
|||||||
//print '<input name="check_THEME_ELDY_USE_HOVER"'.($edit?'':' disabled').' type="checkbox" '.($hoverdisabled?"":" checked").'>';
|
//print '<input name="check_THEME_ELDY_USE_HOVER"'.($edit?'':' disabled').' type="checkbox" '.($hoverdisabled?"":" checked").'>';
|
||||||
//print ' ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
//print ' ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||||
if ($edit) {
|
if ($edit) {
|
||||||
if ($conf->global->THEME_ELDY_USE_HOVER == '1') $color = colorArrayToHex(colorStringToArray($colorbacklinepairhover));
|
if (!empty($conf->global->THEME_ELDY_USE_HOVER) && $conf->global->THEME_ELDY_USE_HOVER == '1') $color = colorArrayToHex(colorStringToArray($colorbacklinepairhover));
|
||||||
else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_HOVER, array()), '');
|
else $color = colorArrayToHex(colorStringToArray((!empty($conf->global->THEME_ELDY_USE_HOVER) ? $conf->global->THEME_ELDY_USE_HOVER : ''), array()), '');
|
||||||
print $formother->selectColor($color, 'THEME_ELDY_USE_HOVER', '', 1, '', '', 'colorbacklinepairhover').' ';
|
print $formother->selectColor($color, 'THEME_ELDY_USE_HOVER', '', 1, '', '', 'colorbacklinepairhover').' ';
|
||||||
} else {
|
} else {
|
||||||
if ($conf->global->THEME_ELDY_USE_HOVER == '1') $color = colorArrayToHex(colorStringToArray($colorbacklinepairhover));
|
if ($conf->global->THEME_ELDY_USE_HOVER == '1') $color = colorArrayToHex(colorStringToArray($colorbacklinepairhover));
|
||||||
else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_HOVER, array()), '');
|
else $color = colorArrayToHex(colorStringToArray((!empty($conf->global->THEME_ELDY_USE_HOVER) ? $conf->global->THEME_ELDY_USE_HOVER : ''), array()), '');
|
||||||
if ($color) {
|
if ($color) {
|
||||||
if ($color != colorArrayToHex(colorStringToArray($colorbacklinepairhover))) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
if ($color != colorArrayToHex(colorStringToArray($colorbacklinepairhover))) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
||||||
else print $langs->trans("Default");
|
else print $langs->trans("Default");
|
||||||
@ -818,12 +818,12 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
|||||||
//print '<input name="check_THEME_ELDY_USE_HOVER"'.($edit?'':' disabled').' type="checkbox" '.($hoverdisabled?"":" checked").'>';
|
//print '<input name="check_THEME_ELDY_USE_HOVER"'.($edit?'':' disabled').' type="checkbox" '.($hoverdisabled?"":" checked").'>';
|
||||||
//print ' ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
//print ' ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||||
if ($edit) {
|
if ($edit) {
|
||||||
if ($conf->global->THEME_ELDY_USE_CHECKED == '1') $color = 'e6edf0';
|
if (!empty($conf->global->THEME_ELDY_USE_CHECKED) && $conf->global->THEME_ELDY_USE_CHECKED == '1') $color = 'e6edf0';
|
||||||
else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_CHECKED, array()), '');
|
else $color = colorArrayToHex(colorStringToArray((!empty($conf->global->THEME_ELDY_USE_CHECKED) ? $conf->global->THEME_ELDY_USE_CHECKED : ''), array()), '');
|
||||||
print $formother->selectColor($color, 'THEME_ELDY_USE_CHECKED', '', 1, '', '', 'colorbacklinepairchecked').' ';
|
print $formother->selectColor($color, 'THEME_ELDY_USE_CHECKED', '', 1, '', '', 'colorbacklinepairchecked').' ';
|
||||||
} else {
|
} else {
|
||||||
if ($conf->global->THEME_ELDY_USE_CHECKED == '1') $color = 'e6edf0';
|
if ($conf->global->THEME_ELDY_USE_CHECKED == '1') $color = 'e6edf0';
|
||||||
else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_CHECKED, array()), '');
|
else $color = colorArrayToHex(colorStringToArray((!empty($conf->global->THEME_ELDY_USE_CHECKED) ? $conf->global->THEME_ELDY_USE_CHECKED : ''), array()), '');
|
||||||
if ($color) {
|
if ($color) {
|
||||||
if ($color != 'e6edf0') print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
if ($color != 'e6edf0') print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
||||||
else print $langs->trans("Default");
|
else print $langs->trans("Default");
|
||||||
|
|||||||
@ -206,9 +206,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
|||||||
$menu_arr[] = array(
|
$menu_arr[] = array(
|
||||||
'name' => 'Projet',
|
'name' => 'Projet',
|
||||||
'link' => '/projet/index.php?mainmenu=project&leftmenu=',
|
'link' => '/projet/index.php?mainmenu=project&leftmenu=',
|
||||||
'title' => (empty($conf->global->PROJECT_USE_OPPORTUNITIES) || $conf->global->PROJECT_USE_OPPORTUNITIES == 2)
|
'title' => (! empty($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2 ? "Leads" : "Projects"),
|
||||||
? (($conf->global->PROJECT_USE_OPPORTUNITIES == 2) ? "Leads" : "Projects")
|
|
||||||
: "Projects",
|
|
||||||
'level' => 0,
|
'level' => 0,
|
||||||
'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
|
'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
|
||||||
'target' => $atarget,
|
'target' => $atarget,
|
||||||
@ -743,11 +741,11 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
|||||||
$newmenu->add("/admin/pdf.php?mainmenu=home", $langs->trans("PDF"), 1);
|
$newmenu->add("/admin/pdf.php?mainmenu=home", $langs->trans("PDF"), 1);
|
||||||
|
|
||||||
$warnpicto = '';
|
$warnpicto = '';
|
||||||
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
|
if (!empty($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$warnpicto = img_warning($langs->trans("WarningPHPMailD"));
|
$warnpicto = img_warning($langs->trans("WarningPHPMailD"));
|
||||||
}
|
}
|
||||||
if (in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmail')) && empty($conf->global->MAIN_MAIL_SMTP_SERVER)) {
|
if (!empty($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmail')) && empty($conf->global->MAIN_MAIL_SMTP_SERVER)) {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$warnpicto = img_warning($langs->trans("ErrorSetupOfEmailsNotComplete"));
|
$warnpicto = img_warning($langs->trans("ErrorSetupOfEmailsNotComplete"));
|
||||||
}
|
}
|
||||||
@ -805,8 +803,8 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
|||||||
$newmenu->add("/categories/index.php?leftmenu=users&type=7", $langs->trans("UsersCategoriesShort"), 2, $user->rights->categorie->lire, '', $mainmenu, 'cat');
|
$newmenu->add("/categories/index.php?leftmenu=users&type=7", $langs->trans("UsersCategoriesShort"), 2, $user->rights->categorie->lire, '', $mainmenu, 'cat');
|
||||||
}
|
}
|
||||||
$newmenu->add("", $langs->trans("Groups"), 1, ($user->rights->user->user->lire || $user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE));
|
$newmenu->add("", $langs->trans("Groups"), 1, ($user->rights->user->user->lire || $user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE));
|
||||||
$newmenu->add("/user/group/card.php?leftmenu=users&action=create", $langs->trans("NewGroup"), 2, (($conf->global->MAIN_USE_ADVANCED_PERMS ? $user->rights->user->group_advance->write : $user->rights->user->user->creer) || $user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE));
|
$newmenu->add("/user/group/card.php?leftmenu=users&action=create", $langs->trans("NewGroup"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->rights->user->group_advance->write : $user->rights->user->user->creer) || $user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE));
|
||||||
$newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("ListOfGroups"), 2, (($conf->global->MAIN_USE_ADVANCED_PERMS ? $user->rights->user->group_advance->read : $user->rights->user->user->lire) || $user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE));
|
$newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("ListOfGroups"), 2, ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) ? $user->rights->user->group_advance->read : $user->rights->user->user->lire) || $user->admin) && !(!empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -622,6 +622,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
||||||
|
|
||||||
|
$content='';
|
||||||
$pathoffile = $this->getDescLongReadmeFound();
|
$pathoffile = $this->getDescLongReadmeFound();
|
||||||
|
|
||||||
if ($pathoffile) // Mostly for external modules
|
if ($pathoffile) // Mostly for external modules
|
||||||
|
|||||||
@ -365,14 +365,15 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
$tab_top_alt = $tab_top;
|
$tab_top_alt = $tab_top;
|
||||||
|
|
||||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||||
$pdf->writeHTMLCell(60, 4, $this->posxdesc - 1, $tab_top - 1, $outputlangs->transnoentities("TrackingNumber")." : ".$object->tracking_number, 0, 1, false, true, 'L');
|
|
||||||
|
|
||||||
$tab_top_alt = $pdf->GetY();
|
|
||||||
//$tab_top_alt += 1;
|
//$tab_top_alt += 1;
|
||||||
|
|
||||||
// Tracking number
|
// Tracking number
|
||||||
if (!empty($object->tracking_number))
|
if (!empty($object->tracking_number))
|
||||||
{
|
{
|
||||||
|
$pdf->writeHTMLCell(60, 4, $this->posxdesc - 1, $tab_top - 1, $outputlangs->transnoentities("TrackingNumber")." : ".$object->tracking_number, 0, 1, false, true, 'L');
|
||||||
|
$tab_top_alt = $pdf->GetY();
|
||||||
|
|
||||||
$object->getUrlTrackingStatus($object->tracking_number);
|
$object->getUrlTrackingStatus($object->tracking_number);
|
||||||
if (!empty($object->tracking_url))
|
if (!empty($object->tracking_url))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -254,7 +254,7 @@ class modStock extends DolibarrModules
|
|||||||
$this->export_sql_end[$r] .= ' AND e.entity IN ('.getEntity('stock').')';
|
$this->export_sql_end[$r] .= ' AND e.entity IN ('.getEntity('stock').')';
|
||||||
|
|
||||||
// Export stock including batch number
|
// Export stock including batch number
|
||||||
if ($conf->productbatch->enabled)
|
if (!empty($conf->productbatch->enabled))
|
||||||
{
|
{
|
||||||
$langs->load("productbatch");
|
$langs->load("productbatch");
|
||||||
|
|
||||||
@ -327,7 +327,7 @@ class modStock extends DolibarrModules
|
|||||||
'p.rowid'=>"product", 'p.ref'=>"product", 'p.fk_product_type'=>"product", 'p.label'=>"product", 'p.description'=>"product", 'p.note'=>"product",
|
'p.rowid'=>"product", 'p.ref'=>"product", 'p.fk_product_type'=>"product", 'p.label'=>"product", 'p.description'=>"product", 'p.note'=>"product",
|
||||||
'p.price'=>"product", 'p.tva_tx'=>'product', 'p.tosell'=>"product", 'p.tobuy'=>"product", 'p.duration'=>"product", 'p.datec'=>'product', 'p.tms'=>'product'
|
'p.price'=>"product", 'p.tva_tx'=>'product', 'p.tosell'=>"product", 'p.tobuy'=>"product", 'p.duration'=>"product", 'p.datec'=>'product', 'p.tms'=>'product'
|
||||||
); // We define here only fields that use another icon that the one defined into export_icon
|
); // We define here only fields that use another icon that the one defined into export_icon
|
||||||
if ($conf->productbatch->enabled)
|
if (!empty($conf->productbatch->enabled))
|
||||||
{
|
{
|
||||||
$this->export_fields_array[$r]['sm.batch'] = 'Batch';
|
$this->export_fields_array[$r]['sm.batch'] = 'Batch';
|
||||||
$this->export_TypeFields_array[$r]['sm.batch'] = 'Text';
|
$this->export_TypeFields_array[$r]['sm.batch'] = 'Text';
|
||||||
|
|||||||
@ -14,7 +14,7 @@ if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey =
|
|||||||
// Loop to show all columns of extrafields for the search title line
|
// Loop to show all columns of extrafields for the search title line
|
||||||
if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ...
|
if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ...
|
||||||
{
|
{
|
||||||
if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label']))
|
if (!empty($extrafields->attributes[$extrafieldsobjectkey]['label']) && is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label']))
|
||||||
{
|
{
|
||||||
if (empty($extrafieldsobjectprefix)) $extrafieldsobjectprefix = 'ef.';
|
if (empty($extrafieldsobjectprefix)) $extrafieldsobjectprefix = 'ef.';
|
||||||
if (empty($search_options_pattern)) $search_options_pattern = 'search_options_';
|
if (empty($search_options_pattern)) $search_options_pattern = 'search_options_';
|
||||||
|
|||||||
@ -13,7 +13,7 @@ if (!isset($disablesortlink)) $disablesortlink = 0;
|
|||||||
// Loop to show all columns of extrafields for the title line
|
// Loop to show all columns of extrafields for the title line
|
||||||
if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ...
|
if (!empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ...
|
||||||
{
|
{
|
||||||
if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label']))
|
if (!empty($extrafields->attributes[$extrafieldsobjectkey]['label']) && is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label']))
|
||||||
{
|
{
|
||||||
if (empty($extrafieldsobjectprefix)) $extrafieldsobjectprefix = 'ef.';
|
if (empty($extrafieldsobjectprefix)) $extrafieldsobjectprefix = 'ef.';
|
||||||
|
|
||||||
|
|||||||
@ -87,7 +87,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
|
|||||||
{
|
{
|
||||||
$value = (GETPOSTISSET("options_".$tmpkeyextra) ? GETPOST("options_".$tmpkeyextra) : $object->array_options["options_".$tmpkeyextra]);
|
$value = (GETPOSTISSET("options_".$tmpkeyextra) ? GETPOST("options_".$tmpkeyextra) : $object->array_options["options_".$tmpkeyextra]);
|
||||||
} else {
|
} else {
|
||||||
$value = $object->array_options["options_".$tmpkeyextra];
|
$value = (!empty($object->array_options["options_".$tmpkeyextra]) ? $object->array_options["options_".$tmpkeyextra] : '');
|
||||||
//var_dump($tmpkeyextra.' - '.$value);
|
//var_dump($tmpkeyextra.' - '.$value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
|
|||||||
|
|
||||||
$html_id = !empty($object->id) ? $object->element.'_extras_'.$tmpkeyextra.'_'.$object->id : '';
|
$html_id = !empty($object->id) ? $object->element.'_extras_'.$tmpkeyextra.'_'.$object->id : '';
|
||||||
|
|
||||||
print '<td id="'.$html_id.'" class="'.$object->element.'_extras_'.$tmpkeyextra.' wordbreak"'.($cols ? ' colspan="'.$cols.'"' : '').'>';
|
print '<td id="'.$html_id.'" class="'.$object->element.'_extras_'.$tmpkeyextra.' wordbreak"'.(!empty($cols) ? ' colspan="'.$cols.'"' : '').'>';
|
||||||
|
|
||||||
// Convert date into timestamp format
|
// Convert date into timestamp format
|
||||||
if (in_array($extrafields->attributes[$object->table_element]['type'][$tmpkeyextra], array('date', 'datetime')))
|
if (in_array($extrafields->attributes[$object->table_element]['type'][$tmpkeyextra], array('date', 'datetime')))
|
||||||
|
|||||||
@ -661,7 +661,6 @@ if (!empty($usemargins) && $user->rights->margins->creer)
|
|||||||
?>
|
?>
|
||||||
var pbq = parseInt($('option:selected', this).attr('data-pbq')); /* If product was selected with a HTML select */
|
var pbq = parseInt($('option:selected', this).attr('data-pbq')); /* If product was selected with a HTML select */
|
||||||
if (isNaN(pbq)) { pbq = jQuery('#idprod').attr('data-pbq'); } /* If product was selected with a HTML input with autocomplete */
|
if (isNaN(pbq)) { pbq = jQuery('#idprod').attr('data-pbq'); } /* If product was selected with a HTML input with autocomplete */
|
||||||
//console.log(pbq);
|
|
||||||
|
|
||||||
if ((jQuery('#idprod').val() > 0 || jQuery('#idprodfournprice').val()) && ! isNaN(pbq) && pbq > 0)
|
if ((jQuery('#idprod').val() > 0 || jQuery('#idprodfournprice').val()) && ! isNaN(pbq) && pbq > 0)
|
||||||
{
|
{
|
||||||
@ -677,6 +676,32 @@ if (!empty($usemargins) && $user->rights->margins->creer)
|
|||||||
function(data) {
|
function(data) {
|
||||||
console.log("Load unit price end, we got value "+data.price_ht);
|
console.log("Load unit price end, we got value "+data.price_ht);
|
||||||
jQuery("#price_ht").val(data.price_ht);
|
jQuery("#price_ht").val(data.price_ht);
|
||||||
|
<?php
|
||||||
|
if (!empty($conf->global->PRODUIT_AUTOFILL_DESC) && $conf->global->PRODUIT_AUTOFILL_DESC == 1) {
|
||||||
|
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { ?>
|
||||||
|
var proddesc = data.desc_trans;
|
||||||
|
<?php
|
||||||
|
} else { ?>
|
||||||
|
var proddesc = data.desc;
|
||||||
|
<?php
|
||||||
|
} ?>
|
||||||
|
console.log("Load desciption into text area : "+proddesc);
|
||||||
|
<?php
|
||||||
|
if (!empty($conf->global->FCKEDITOR_ENABLE_DETAILS)) { ?>
|
||||||
|
if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined")
|
||||||
|
{
|
||||||
|
var editor = CKEDITOR.instances['dp_desc'];
|
||||||
|
if (editor) {
|
||||||
|
editor.setData(proddesc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<?php
|
||||||
|
} else { ?>
|
||||||
|
jQuery('#dp_desc').text(proddesc);
|
||||||
|
<?php
|
||||||
|
} ?>
|
||||||
|
<?php
|
||||||
|
} ?>
|
||||||
},
|
},
|
||||||
'json'
|
'json'
|
||||||
);
|
);
|
||||||
@ -791,7 +816,10 @@ if (!empty($usemargins) && $user->rights->margins->creer)
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
/* To process customer price per quantity (CUSTOMER_PRICE_PER_QTY works only if combo product is not an ajax after x key pressed) */
|
<?php
|
||||||
|
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY))
|
||||||
|
{?>
|
||||||
|
/* To process customer price per quantity (PRODUIT_CUSTOMER_PRICES_BY_QTY works only if combo product is not an ajax after x key pressed) */
|
||||||
var pbq = parseInt($('option:selected', this).attr('data-pbq')); // When select is done from HTML select
|
var pbq = parseInt($('option:selected', this).attr('data-pbq')); // When select is done from HTML select
|
||||||
if (isNaN(pbq)) { pbq = jQuery('#idprod').attr('data-pbq'); } // When select is done from HTML input with autocomplete
|
if (isNaN(pbq)) { pbq = jQuery('#idprod').attr('data-pbq'); } // When select is done from HTML input with autocomplete
|
||||||
var pbqup = parseFloat($('option:selected', this).attr('data-pbqup'));
|
var pbqup = parseFloat($('option:selected', this).attr('data-pbqup'));
|
||||||
@ -803,7 +831,7 @@ if (!empty($usemargins) && $user->rights->margins->creer)
|
|||||||
var pbqpercent = parseFloat($('option:selected', this).attr('data-pbqpercent'));
|
var pbqpercent = parseFloat($('option:selected', this).attr('data-pbqpercent'));
|
||||||
if (isNaN(pbqpercent)) { pbqpercent = jQuery('#idprod').attr('data-pbqpercent'); }
|
if (isNaN(pbqpercent)) { pbqpercent = jQuery('#idprod').attr('data-pbqpercent'); }
|
||||||
|
|
||||||
if ((jQuery('#idprod').val() > 0 || jQuery('#idprodfournprice').val()) && ! isNaN(pbq) && pbq > 0)
|
if ((jQuery('#idprod').val() > 0) && ! isNaN(pbq) && pbq > 0)
|
||||||
{
|
{
|
||||||
var pbqupht = pbqup; /* TODO support of price per qty TTC not yet available */
|
var pbqupht = pbqup; /* TODO support of price per qty TTC not yet available */
|
||||||
|
|
||||||
@ -818,11 +846,75 @@ if (!empty($usemargins) && $user->rights->margins->creer)
|
|||||||
{
|
{
|
||||||
jQuery("#remise_percent").val(pbqpercent);
|
jQuery("#remise_percent").val(pbqpercent);
|
||||||
}
|
}
|
||||||
|
} else { jQuery("#pbq").val(''); }
|
||||||
|
<?php
|
||||||
}
|
}
|
||||||
else
|
?>
|
||||||
|
//Deal with supplier
|
||||||
|
if (jQuery('#idprodfournprice').val() >0)
|
||||||
{
|
{
|
||||||
jQuery("#pbq").val('');
|
var up = parseFloat($('option:selected', this).attr('data-up')); // When select is done from HTML select
|
||||||
|
if (isNaN(up)) { up = parseFloat(jQuery('#idprodfournprice').attr('data-up'));} // When select is done from HTML input with autocomplete
|
||||||
|
|
||||||
|
var qty = parseFloat($('option:selected', this).attr('data-qty'));
|
||||||
|
if (isNaN(qty)) { qty = parseFloat(jQuery('#idprodfournprice').attr('data-qty'));}
|
||||||
|
|
||||||
|
var discount = parseFloat($('option:selected', this).attr('data-discount'));
|
||||||
|
if (isNaN(discount)) { discount = parseFloat(jQuery('#idprodfournprice').attr('data-discount'));}
|
||||||
|
|
||||||
|
console.log("We find supplier price :"+up+" qty: "+qty+" discount: "+discount+" for product "+jQuery('#idprodfournprice').val());
|
||||||
|
|
||||||
|
jQuery("#price_ht").val(up);
|
||||||
|
if (jQuery("#qty").val() < qty)
|
||||||
|
{
|
||||||
|
jQuery("#qty").val(qty);
|
||||||
}
|
}
|
||||||
|
if (jQuery("#remise_percent").val() < discount)
|
||||||
|
{
|
||||||
|
jQuery("#remise_percent").val(discount);
|
||||||
|
}
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if (!empty($conf->global->PRODUIT_AUTOFILL_DESC) && $conf->global->PRODUIT_AUTOFILL_DESC == 1) {
|
||||||
|
?>
|
||||||
|
var description = $('option:selected', this).attr('data-description');
|
||||||
|
if (typeof description == 'undefined') { description = jQuery('#idprodfournprice').attr('data-description'); }
|
||||||
|
|
||||||
|
console.log("Load desciption into text area : "+description);
|
||||||
|
<?php
|
||||||
|
if (!empty($conf->global->FCKEDITOR_ENABLE_DETAILS)) { ?>
|
||||||
|
if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined")
|
||||||
|
{
|
||||||
|
var editor = CKEDITOR.instances['dp_desc'];
|
||||||
|
if (editor) {
|
||||||
|
editor.setData(description);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<?php
|
||||||
|
} else { ?>
|
||||||
|
jQuery('#dp_desc').text(description);
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}?>
|
||||||
|
} else if (jQuery('#idprodfournprice').length > 0) {
|
||||||
|
<?php
|
||||||
|
if (!empty($conf->global->PRODUIT_AUTOFILL_DESC) && $conf->global->PRODUIT_AUTOFILL_DESC == 1) {
|
||||||
|
if (!empty($conf->global->FCKEDITOR_ENABLE_DETAILS)) { ?>
|
||||||
|
if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined")
|
||||||
|
{
|
||||||
|
var editor = CKEDITOR.instances['dp_desc'];
|
||||||
|
if (editor) {
|
||||||
|
editor.setData('');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<?php
|
||||||
|
} else { ?>
|
||||||
|
jQuery('#dp_desc').text('');
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}?>
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* To set focus */
|
/* To set focus */
|
||||||
if (jQuery('#idprod').val() > 0 || jQuery('#idprodfournprice').val() > 0)
|
if (jQuery('#idprod').val() > 0 || jQuery('#idprodfournprice').val() > 0)
|
||||||
|
|||||||
@ -189,11 +189,21 @@ $coldisplay++;
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (!empty($conf->global->PRODUCT_USE_UNITS))
|
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
|
||||||
{
|
$unit_type = false;
|
||||||
|
// limit unit select to unit type
|
||||||
|
if (!empty($line->fk_unit) && empty($conf->global->MAIN_EDIT_LINE_ALLOW_ALL_UNIT_TYPE)) {
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php';
|
||||||
|
$cUnit = new CUnits($line->db);
|
||||||
|
if ($cUnit->fetch($line->fk_unit) > 0) {
|
||||||
|
if (!empty($cUnit->unit_type)) {
|
||||||
|
$unit_type = $cUnit->unit_type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$coldisplay++;
|
$coldisplay++;
|
||||||
print '<td class="left">';
|
print '<td class="left">';
|
||||||
print $form->selectUnits($line->fk_unit, "units");
|
print $form->selectUnits($line->fk_unit, "units", 0, $unit_type);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -119,8 +119,7 @@ if (($line->info_bits & 2) == 2) {
|
|||||||
} else {
|
} else {
|
||||||
$format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE ? 'dayhour' : 'day';
|
$format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE ? 'dayhour' : 'day';
|
||||||
|
|
||||||
if ($line->fk_product > 0)
|
if ($line->fk_product > 0) {
|
||||||
{
|
|
||||||
print $form->textwithtooltip($text, $description, 3, '', '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : ''));
|
print $form->textwithtooltip($text, $description, 3, '', '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : ''));
|
||||||
} else {
|
} else {
|
||||||
$type = (!empty($line->product_type) ? $line->product_type : $line->fk_product_type);
|
$type = (!empty($line->product_type) ? $line->product_type : $line->fk_product_type);
|
||||||
|
|||||||
@ -81,9 +81,9 @@ $(document).ready(function () {
|
|||||||
<!-- Title with version -->
|
<!-- Title with version -->
|
||||||
<div class="login_table_title center" title="<?php echo dol_escape_htmltag($title); ?>">
|
<div class="login_table_title center" title="<?php echo dol_escape_htmltag($title); ?>">
|
||||||
<?php
|
<?php
|
||||||
if ($disablenofollow) echo '<a class="login_table_title" href="https://www.dolibarr.org" target="_blank">';
|
if (!empty($disablenofollow)) echo '<a class="login_table_title" href="https://www.dolibarr.org" target="_blank">';
|
||||||
echo dol_escape_htmltag($title);
|
echo dol_escape_htmltag($title);
|
||||||
if ($disablenofollow) echo '</a>';
|
if (!empty($disablenofollow)) echo '</a>';
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ if ($disablenofollow) echo '</a>';
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if ($captcha) {
|
if (!empty($captcha)) {
|
||||||
// Add a variable param to force not using cache (jmobile)
|
// Add a variable param to force not using cache (jmobile)
|
||||||
$php_self = preg_replace('/[&\?]time=(\d+)/', '', $php_self); // Remove param time
|
$php_self = preg_replace('/[&\?]time=(\d+)/', '', $php_self); // Remove param time
|
||||||
if (preg_match('/\?/', $php_self)) $php_self .= '&time='.dol_print_date(dol_now(), 'dayhourlog');
|
if (preg_match('/\?/', $php_self)) $php_self .= '&time='.dol_print_date(dol_now(), 'dayhourlog');
|
||||||
@ -200,7 +200,7 @@ if (!empty($morelogincontent)) {
|
|||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<?php if ($message) { ?>
|
<?php if (!empty($message)) { ?>
|
||||||
<div class="center login_main_message">
|
<div class="center login_main_message">
|
||||||
<?php echo dol_htmloutput_mesg($message, '', '', 1); ?>
|
<?php echo dol_htmloutput_mesg($message, '', '', 1); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -46,7 +46,8 @@ class InterfaceNotification extends DolibarrTriggers
|
|||||||
'EXPENSE_REPORT_VALIDATE',
|
'EXPENSE_REPORT_VALIDATE',
|
||||||
'EXPENSE_REPORT_APPROVE',
|
'EXPENSE_REPORT_APPROVE',
|
||||||
'HOLIDAY_VALIDATE',
|
'HOLIDAY_VALIDATE',
|
||||||
'HOLIDAY_APPROVE'
|
'HOLIDAY_APPROVE',
|
||||||
|
'ACTION_CREATE'
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -198,11 +198,21 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
|||||||
|
|
||||||
if (empty($conf->global->TICKET_DISABLE_CUSTOMER_MAILS) && empty($object->context['disableticketemail']) && $object->notify_tiers_at_create) {
|
if (empty($conf->global->TICKET_DISABLE_CUSTOMER_MAILS) && empty($object->context['disableticketemail']) && $object->notify_tiers_at_create) {
|
||||||
$sendto = '';
|
$sendto = '';
|
||||||
if (empty($user->socid) && empty($user->email)) {
|
|
||||||
|
//if contact selected send to email's contact else send to email's thirdparty
|
||||||
|
|
||||||
|
$contactid = GETPOST('contactid', 'alpha');
|
||||||
|
|
||||||
|
if (!empty($contactid)) {
|
||||||
|
$contact = new Contact($this->db);
|
||||||
|
$res = $contact->fetch($contactid);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($res > 0 && !empty($contact->email) && !empty($contact->statut)) {
|
||||||
|
$sendto = $contact->email;
|
||||||
|
} elseif (!empty($object->fk_soc)) {
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
$sendto = $object->thirdparty->email;
|
$sendto = $object->thirdparty->email;
|
||||||
} else {
|
|
||||||
$sendto = $user->email;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sendto) {
|
if ($sendto) {
|
||||||
|
|||||||
@ -475,7 +475,7 @@ if (empty($reshook))
|
|||||||
$outputlangs = new Translate("", $conf);
|
$outputlangs = new Translate("", $conf);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
}
|
}
|
||||||
$desc = (!empty($productsupplier->multilangs [$outputlangs->defaultlang] ["description"])) ? $productsupplier->multilangs [$outputlangs->defaultlang] ["description"] : $productsupplier->description;
|
$desc = (!empty($productsupplier->multilangs[$outputlangs->defaultlang]["description"])) ? $productsupplier->multilangs[$outputlangs->defaultlang]["description"] : $productsupplier->description;
|
||||||
} else {
|
} else {
|
||||||
$desc = $productsupplier->description;
|
$desc = $productsupplier->description;
|
||||||
}
|
}
|
||||||
@ -484,7 +484,13 @@ if (empty($reshook))
|
|||||||
$desc = $productsupplier->desc_supplier;
|
$desc = $productsupplier->desc_supplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
|
//If text set in desc is the same as product descpription (as now it's preloaded) whe add it only one time
|
||||||
|
if ($product_desc==$desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) {
|
||||||
|
$product_desc='';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc = $product_desc;
|
||||||
|
if (!empty($product_desc) && trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
|
||||||
|
|
||||||
$type = $productsupplier->type;
|
$type = $productsupplier->type;
|
||||||
if ($price_ht != '' || $price_ht_devise != '') {
|
if ($price_ht != '' || $price_ht_devise != '') {
|
||||||
|
|||||||
@ -1079,7 +1079,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);
|
$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);
|
||||||
|
|
||||||
if (GETPOST('price_ht') != '')
|
if (GETPOST('price_ht') != '' || GETPOST('multicurrency_subprice') != '')
|
||||||
{
|
{
|
||||||
$up = price2num(GETPOST('price_ht'));
|
$up = price2num(GETPOST('price_ht'));
|
||||||
$price_base_type = 'HT';
|
$price_base_type = 'HT';
|
||||||
@ -1289,7 +1289,12 @@ if (empty($reshook))
|
|||||||
$desc = $productsupplier->desc_supplier;
|
$desc = $productsupplier->desc_supplier;
|
||||||
} else $desc = $productsupplier->description;
|
} else $desc = $productsupplier->description;
|
||||||
|
|
||||||
if (trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
|
//If text set in desc is the same as product descpription (as now it's preloaded) whe add it only one time
|
||||||
|
if ($product_desc==$desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) {
|
||||||
|
$product_desc='';
|
||||||
|
}
|
||||||
|
if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc = $product_desc;
|
||||||
|
if (!empty($product_desc) && trim($product_desc) != trim($desc)) $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
|
||||||
|
|
||||||
$type = $productsupplier->type;
|
$type = $productsupplier->type;
|
||||||
if ($price_ht != '' || $price_ht_devise != '') {
|
if ($price_ht != '' || $price_ht_devise != '') {
|
||||||
|
|||||||
@ -1182,7 +1182,7 @@ class Parsedown
|
|||||||
'src' => $Link['element']['attributes']['href'],
|
'src' => $Link['element']['attributes']['href'],
|
||||||
'alt' => $Link['element']['text'],
|
'alt' => $Link['element']['text'],
|
||||||
// @CHANGE LDR
|
// @CHANGE LDR
|
||||||
'class' => $Link['element']['attributes']['class']
|
'class' => (!empty($Link['element']['attributes']['class']) ? $Link['element']['attributes']['class'] : '')
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -312,7 +312,7 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
|
|||||||
$boxstatItem .= '<a href="'.$links[$val].'" class="boxstatsindicator thumbstat nobold nounderline">';
|
$boxstatItem .= '<a href="'.$links[$val].'" class="boxstatsindicator thumbstat nobold nounderline">';
|
||||||
$boxstatItem .= '<div class="boxstats">';
|
$boxstatItem .= '<div class="boxstats">';
|
||||||
$boxstatItem .= '<span class="boxstatstext" title="'.dol_escape_htmltag($text).'">'.$text.'</span><br>';
|
$boxstatItem .= '<span class="boxstatstext" title="'.dol_escape_htmltag($text).'">'.$text.'</span><br>';
|
||||||
$boxstatItem .= '<span class="boxstatsindicator">'.img_object("", $board->picto, 'class="inline-block"').' '.($board->nb[$val] ? $board->nb[$val] : 0).'</span>';
|
$boxstatItem .= '<span class="boxstatsindicator">'.img_object("", $board->picto, 'class="inline-block"').' '.(!empty($board->nb[$val]) ? $board->nb[$val] : 0).'</span>';
|
||||||
$boxstatItem .= '</div>';
|
$boxstatItem .= '</div>';
|
||||||
$boxstatItem .= '</a>';
|
$boxstatItem .= '</a>';
|
||||||
|
|
||||||
@ -675,7 +675,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|||||||
// get key index of stats used in $includes, $classes, $keys, $icons, $titres, $links
|
// get key index of stats used in $includes, $classes, $keys, $icons, $titres, $links
|
||||||
$keyIndex = array_search($globalStatsKey, $keys);
|
$keyIndex = array_search($globalStatsKey, $keys);
|
||||||
|
|
||||||
$classe = $classes[$keyIndex];
|
$classe = (!empty($classes[$keyIndex]) ? $classes[$keyIndex] : '');
|
||||||
if (isset($boardloaded[$classe]) && is_object($boardloaded[$classe]))
|
if (isset($boardloaded[$classe]) && is_object($boardloaded[$classe]))
|
||||||
{
|
{
|
||||||
$groupElement['globalStats']['total'] = $boardloaded[$classe]->nb[$globalStatsKey] ? $boardloaded[$classe]->nb[$globalStatsKey] : 0;
|
$groupElement['globalStats']['total'] = $boardloaded[$classe]->nb[$globalStatsKey] ? $boardloaded[$classe]->nb[$globalStatsKey] : 0;
|
||||||
@ -762,7 +762,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($showweather && !empty($isIntopOpenedDashBoard)) {
|
if ($showweather && !empty($isIntopOpenedDashBoard)) {
|
||||||
$appendClass = $conf->global->MAIN_DISABLE_METEO == 2 ? ' hideonsmartphone' : '';
|
$appendClass = (!empty($conf->global->MAIN_DISABLE_METEO) && $conf->global->MAIN_DISABLE_METEO == 2 ? ' hideonsmartphone' : '');
|
||||||
$weather = getWeatherStatus($totallate);
|
$weather = getWeatherStatus($totallate);
|
||||||
|
|
||||||
$text = '';
|
$text = '';
|
||||||
@ -889,7 +889,7 @@ print '<div class="fichecenter fichecenterbis">';
|
|||||||
* Show widgets (boxes)
|
* Show widgets (boxes)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$boxlist .= '<div class="twocolumns">';
|
$boxlist = '<div class="twocolumns">';
|
||||||
|
|
||||||
$boxlist .= '<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
|
$boxlist .= '<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
|
||||||
if (!empty($nbworkboardcount))
|
if (!empty($nbworkboardcount))
|
||||||
@ -914,7 +914,7 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($boxstatFromHook) || !empty($boxstatItems)) {
|
if (!empty($boxstatFromHook) || !empty($boxstatItems)) {
|
||||||
$boxstat .= '<!-- Database statistics -->'."\n";
|
$boxstat = '<!-- Database statistics -->'."\n";
|
||||||
$boxstat .= '<div class="box">';
|
$boxstat .= '<div class="box">';
|
||||||
$boxstat .= '<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="noborder boxtable boxtablenobottom nohover widgetstats" width="100%">';
|
$boxstat .= '<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="noborder boxtable boxtablenobottom nohover widgetstats" width="100%">';
|
||||||
$boxstat .= '<tr class="liste_titre box_titre">';
|
$boxstat .= '<tr class="liste_titre box_titre">';
|
||||||
|
|||||||
@ -145,4 +145,4 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
|
|||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_CREATE','Task created','Executed when a project task is created','project',150);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_CREATE','Task created','Executed when a project task is created','project',150);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_MODIFY','Task modified','Executed when a project task is modified','project',151);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_MODIFY','Task modified','Executed when a project task is modified','project',151);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_DELETE','Task deleted','Executed when a project task is deleted','project',152);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_DELETE','Task deleted','Executed when a project task is deleted','project',152);
|
||||||
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ACTION_CREATE','Action added','Executed when an action is added to the agenda','agenda',700);
|
||||||
|
|||||||
@ -18,7 +18,7 @@ FormatHourShortJQuery=HH:MI
|
|||||||
FormatHourShort=%H:%M
|
FormatHourShort=%H:%M
|
||||||
FormatHourShortDuration=%H:%M
|
FormatHourShortDuration=%H:%M
|
||||||
FormatDateTextShort=%d %b %Y
|
FormatDateTextShort=%d %b %Y
|
||||||
FormatDateText=%d %B %Y
|
FormatDateText=%d. %B %Y
|
||||||
FormatDateHourShort=%d.%m.%Y %H:%M
|
FormatDateHourShort=%d.%m.%Y %H:%M
|
||||||
FormatDateHourSecShort=%d.%m.%Y %H:%M:%S
|
FormatDateHourSecShort=%d.%m.%Y %H:%M:%S
|
||||||
FormatDateHourTextShort=%d %b %Y %H:%M
|
FormatDateHourTextShort=%d %b %Y %H:%M
|
||||||
|
|||||||
@ -1598,8 +1598,13 @@ ServiceSetup=Services module setup
|
|||||||
ProductServiceSetup=Products and Services modules setup
|
ProductServiceSetup=Products and Services modules setup
|
||||||
NumberOfProductShowInSelect=Maximum number of products to show in combo select lists (0=no limit)
|
NumberOfProductShowInSelect=Maximum number of products to show in combo select lists (0=no limit)
|
||||||
ViewProductDescInFormAbility=Display product descriptions in forms (otherwise shown in a tooltip popup)
|
ViewProductDescInFormAbility=Display product descriptions in forms (otherwise shown in a tooltip popup)
|
||||||
|
DoNotAddProductDescAtAddLines=Do not add product description (from product card) on submit add lines on forms
|
||||||
|
OnProductSelectAddProductDesc=How to use the description of the products when adding a product as a line of a document
|
||||||
|
AutoFillFormFieldBeforeSubmit=Auto fill the description input field with the description of product
|
||||||
|
DoNotAutofillButAutoConcat=Do not autofill the input field with description of product. Description of the product will be concatenated to the entered description automatically.
|
||||||
|
DoNotUseDescriptionOfProdut=Description of the product will never be included into the description of lines of documents
|
||||||
MergePropalProductCard=Activate in product/service Attached Files tab an option to merge product PDF document to proposal PDF azur if product/service is in the proposal
|
MergePropalProductCard=Activate in product/service Attached Files tab an option to merge product PDF document to proposal PDF azur if product/service is in the proposal
|
||||||
ViewProductDescInThirdpartyLanguageAbility=Display products descriptions in the language of the third party
|
ViewProductDescInThirdpartyLanguageAbility=Display products descriptions in forms in the language of the third party (otherwise in the language of the user)
|
||||||
UseSearchToSelectProductTooltip=Also if you have a large number of products (> 100 000), you can increase speed by setting constant PRODUCT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string.
|
UseSearchToSelectProductTooltip=Also if you have a large number of products (> 100 000), you can increase speed by setting constant PRODUCT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string.
|
||||||
UseSearchToSelectProduct=Wait until you press a key before loading content of product combo list (This may increase performance if you have a large number of products, but it is less convenient)
|
UseSearchToSelectProduct=Wait until you press a key before loading content of product combo list (This may increase performance if you have a large number of products, but it is less convenient)
|
||||||
SetDefaultBarcodeTypeProducts=Default barcode type to use for products
|
SetDefaultBarcodeTypeProducts=Default barcode type to use for products
|
||||||
|
|||||||
@ -78,6 +78,7 @@ Notify_EXPENSE_REPORT_VALIDATE=Expense report validated (approval required)
|
|||||||
Notify_EXPENSE_REPORT_APPROVE=Expense report approved
|
Notify_EXPENSE_REPORT_APPROVE=Expense report approved
|
||||||
Notify_HOLIDAY_VALIDATE=Leave request validated (approval required)
|
Notify_HOLIDAY_VALIDATE=Leave request validated (approval required)
|
||||||
Notify_HOLIDAY_APPROVE=Leave request approved
|
Notify_HOLIDAY_APPROVE=Leave request approved
|
||||||
|
Notify_ACTION_CREATE=Added action to Agenda
|
||||||
SeeModuleSetup=See setup of module %s
|
SeeModuleSetup=See setup of module %s
|
||||||
NbOfAttachedFiles=Number of attached files/documents
|
NbOfAttachedFiles=Number of attached files/documents
|
||||||
TotalSizeOfAttachedFiles=Total size of attached files/documents
|
TotalSizeOfAttachedFiles=Total size of attached files/documents
|
||||||
@ -215,6 +216,7 @@ EMailTextExpenseReportValidated=Expense report %s has been validated.
|
|||||||
EMailTextExpenseReportApproved=Expense report %s has been approved.
|
EMailTextExpenseReportApproved=Expense report %s has been approved.
|
||||||
EMailTextHolidayValidated=Leave request %s has been validated.
|
EMailTextHolidayValidated=Leave request %s has been validated.
|
||||||
EMailTextHolidayApproved=Leave request %s has been approved.
|
EMailTextHolidayApproved=Leave request %s has been approved.
|
||||||
|
EMailTextActionAdded=The action %s has been added to the Agenda.
|
||||||
ImportedWithSet=Importation data set
|
ImportedWithSet=Importation data set
|
||||||
DolibarrNotification=Automatic notification
|
DolibarrNotification=Automatic notification
|
||||||
ResizeDesc=Enter new width <b>OR</b> new height. Ratio will be kept during resizing...
|
ResizeDesc=Enter new width <b>OR</b> new height. Ratio will be kept during resizing...
|
||||||
|
|||||||
@ -108,7 +108,7 @@ FillWithLastServiceDates=Fill with last service line dates
|
|||||||
MultiPricesAbility=Multiple price segments per product/service (each customer is in one price segment)
|
MultiPricesAbility=Multiple price segments per product/service (each customer is in one price segment)
|
||||||
MultiPricesNumPrices=Number of prices
|
MultiPricesNumPrices=Number of prices
|
||||||
DefaultPriceType=Base of prices per default (with versus without tax) when adding new sale prices
|
DefaultPriceType=Base of prices per default (with versus without tax) when adding new sale prices
|
||||||
AssociatedProductsAbility=Enable Kits (set of other products)
|
AssociatedProductsAbility=Enable Kits (set of several products)
|
||||||
VariantsAbility=Enable Variants (variations of products, for example color, size)
|
VariantsAbility=Enable Variants (variations of products, for example color, size)
|
||||||
AssociatedProducts=Kits
|
AssociatedProducts=Kits
|
||||||
AssociatedProductsNumber=Number of products composing this kit
|
AssociatedProductsNumber=Number of products composing this kit
|
||||||
|
|||||||
@ -78,6 +78,7 @@ Notify_EXPENSE_REPORT_VALIDATE=Note de frais validée (approbation requise)
|
|||||||
Notify_EXPENSE_REPORT_APPROVE=Note de frais approuvé
|
Notify_EXPENSE_REPORT_APPROVE=Note de frais approuvé
|
||||||
Notify_HOLIDAY_VALIDATE=Demande de congé validée (approbation requise)
|
Notify_HOLIDAY_VALIDATE=Demande de congé validée (approbation requise)
|
||||||
Notify_HOLIDAY_APPROVE=Demande de congé approuvée
|
Notify_HOLIDAY_APPROVE=Demande de congé approuvée
|
||||||
|
Notify_ACTION_CREATE=Ajout d'action à l'agenda
|
||||||
SeeModuleSetup=Voir la configuration du module %s
|
SeeModuleSetup=Voir la configuration du module %s
|
||||||
NbOfAttachedFiles=Nombre de fichiers/documents liés
|
NbOfAttachedFiles=Nombre de fichiers/documents liés
|
||||||
TotalSizeOfAttachedFiles=Taille totale fichiers/documents liés
|
TotalSizeOfAttachedFiles=Taille totale fichiers/documents liés
|
||||||
@ -218,6 +219,7 @@ EMailTextExpenseReportValidated=La note de frais %s a été validée.
|
|||||||
EMailTextExpenseReportApproved=La note de frais %s a été approuvée.
|
EMailTextExpenseReportApproved=La note de frais %s a été approuvée.
|
||||||
EMailTextHolidayValidated=La demande de congé %s a été validée.
|
EMailTextHolidayValidated=La demande de congé %s a été validée.
|
||||||
EMailTextHolidayApproved=La demande de congé %s a été approuvée.
|
EMailTextHolidayApproved=La demande de congé %s a été approuvée.
|
||||||
|
EMailTextActionAdded=L'action %s a été ajoutée à l'Agenda.
|
||||||
ImportedWithSet=Lot d'importation (Import key)
|
ImportedWithSet=Lot d'importation (Import key)
|
||||||
DolibarrNotification=Notification automatique
|
DolibarrNotification=Notification automatique
|
||||||
ResizeDesc=Entrer la nouvelle largeur <b>OU</b> la nouvelle hauteur. Le ratio d'aspect est conservé lors du redimensionnement…
|
ResizeDesc=Entrer la nouvelle largeur <b>OU</b> la nouvelle hauteur. Le ratio d'aspect est conservé lors du redimensionnement…
|
||||||
|
|||||||
@ -45,7 +45,9 @@ require_once '../lib/mymodule.lib.php';
|
|||||||
$langs->loadLangs(array("errors", "admin", "mymodule@mymodule"));
|
$langs->loadLangs(array("errors", "admin", "mymodule@mymodule"));
|
||||||
|
|
||||||
// Access control
|
// Access control
|
||||||
if (!$user->admin) accessforbidden();
|
if (!$user->admin) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
// Parameters
|
// Parameters
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
|||||||
@ -52,13 +52,17 @@ $form = new Form($db);
|
|||||||
// List of supported format
|
// List of supported format
|
||||||
$tmptype2label = ExtraFields::$type2label;
|
$tmptype2label = ExtraFields::$type2label;
|
||||||
$type2label = array('');
|
$type2label = array('');
|
||||||
foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val);
|
foreach ($tmptype2label as $key => $val) {
|
||||||
|
$type2label[$key] = $langs->transnoentitiesnoconv($val);
|
||||||
|
}
|
||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$attrname = GETPOST('attrname', 'alpha');
|
$attrname = GETPOST('attrname', 'alpha');
|
||||||
$elementtype = 'mymodule_myobject'; //Must be the $table_element of the class that manage extrafield
|
$elementtype = 'mymodule_myobject'; //Must be the $table_element of the class that manage extrafield
|
||||||
|
|
||||||
if (!$user->admin) accessforbidden();
|
if (!$user->admin) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -91,8 +95,7 @@ print dol_get_fiche_end();
|
|||||||
|
|
||||||
|
|
||||||
// Buttons
|
// Buttons
|
||||||
if ($action != 'create' && $action != 'edit')
|
if ($action != 'create' && $action != 'edit') {
|
||||||
{
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||||
print "</div>";
|
print "</div>";
|
||||||
@ -102,8 +105,7 @@ if ($action != 'create' && $action != 'edit')
|
|||||||
/*
|
/*
|
||||||
* Creation of an optional field
|
* Creation of an optional field
|
||||||
*/
|
*/
|
||||||
if ($action == 'create')
|
if ($action == 'create') {
|
||||||
{
|
|
||||||
print '<br><div id="newattrib"></div>';
|
print '<br><div id="newattrib"></div>';
|
||||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||||
|
|
||||||
@ -113,8 +115,7 @@ if ($action == 'create')
|
|||||||
/*
|
/*
|
||||||
* Edition of an optional field
|
* Edition of an optional field
|
||||||
*/
|
*/
|
||||||
if ($action == 'edit' && !empty($attrname))
|
if ($action == 'edit' && !empty($attrname)) {
|
||||||
{
|
|
||||||
print "<br>";
|
print "<br>";
|
||||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||||
|
|
||||||
|
|||||||
@ -47,7 +47,9 @@ require_once '../lib/mymodule.lib.php';
|
|||||||
$langs->loadLangs(array("admin", "mymodule@mymodule"));
|
$langs->loadLangs(array("admin", "mymodule@mymodule"));
|
||||||
|
|
||||||
// Access control
|
// Access control
|
||||||
if (!$user->admin) accessforbidden();
|
if (!$user->admin) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
// Parameters
|
// Parameters
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
@ -71,28 +73,28 @@ $setupnotempty = 0;
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((float) DOL_VERSION >= 6)
|
if ((float) DOL_VERSION >= 6) {
|
||||||
{
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'updateMask')
|
if ($action == 'updateMask') {
|
||||||
{
|
|
||||||
$maskconstorder = GETPOST('maskconstorder', 'alpha');
|
$maskconstorder = GETPOST('maskconstorder', 'alpha');
|
||||||
$maskorder = GETPOST('maskorder', 'alpha');
|
$maskorder = GETPOST('maskorder', 'alpha');
|
||||||
|
|
||||||
if ($maskconstorder) $res = dolibarr_set_const($db, $maskconstorder, $maskorder, 'chaine', 0, '', $conf->entity);
|
if ($maskconstorder) {
|
||||||
|
$res = dolibarr_set_const($db, $maskconstorder, $maskorder, 'chaine', 0, '', $conf->entity);
|
||||||
|
}
|
||||||
|
|
||||||
if (!$res > 0) $error++;
|
if (!$res > 0) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
if (!$error)
|
if (!$error) {
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
} elseif ($action == 'specimen')
|
} elseif ($action == 'specimen') {
|
||||||
{
|
|
||||||
$modele = GETPOST('module', 'alpha');
|
$modele = GETPOST('module', 'alpha');
|
||||||
$tmpobjectkey = GETPOST('object');
|
$tmpobjectkey = GETPOST('object');
|
||||||
|
|
||||||
@ -102,25 +104,21 @@ if ($action == 'updateMask')
|
|||||||
// Search template files
|
// Search template files
|
||||||
$file = ''; $classname = ''; $filefound = 0;
|
$file = ''; $classname = ''; $filefound = 0;
|
||||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||||
foreach ($dirmodels as $reldir)
|
foreach ($dirmodels as $reldir) {
|
||||||
{
|
|
||||||
$file = dol_buildpath($reldir."core/modules/mymodule/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
|
$file = dol_buildpath($reldir."core/modules/mymodule/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
|
||||||
if (file_exists($file))
|
if (file_exists($file)) {
|
||||||
{
|
|
||||||
$filefound = 1;
|
$filefound = 1;
|
||||||
$classname = "pdf_".$modele;
|
$classname = "pdf_".$modele;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($filefound)
|
if ($filefound) {
|
||||||
{
|
|
||||||
require_once $file;
|
require_once $file;
|
||||||
|
|
||||||
$module = new $classname($db);
|
$module = new $classname($db);
|
||||||
|
|
||||||
if ($module->write_file($tmpobject, $langs) > 0)
|
if ($module->write_file($tmpobject, $langs) > 0) {
|
||||||
{
|
|
||||||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=".strtolower($tmpobjectkey)."&file=SPECIMEN.pdf");
|
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=".strtolower($tmpobjectkey)."&file=SPECIMEN.pdf");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
@ -131,19 +129,15 @@ if ($action == 'updateMask')
|
|||||||
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
} elseif ($action == 'setmod') {
|
||||||
|
|
||||||
elseif ($action == 'setmod') {
|
|
||||||
// TODO Check if numbering module chosen can be activated by calling method canBeActivated
|
// TODO Check if numbering module chosen can be activated by calling method canBeActivated
|
||||||
$tmpobjectkey = GETPOST('object');
|
$tmpobjectkey = GETPOST('object');
|
||||||
if (!empty($tmpobjectkey)) {
|
if (!empty($tmpobjectkey)) {
|
||||||
$constforval = 'MYMODULE_'.strtoupper($tmpobjectkey)."_ADDON";
|
$constforval = 'MYMODULE_'.strtoupper($tmpobjectkey)."_ADDON";
|
||||||
dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity);
|
||||||
}
|
}
|
||||||
}
|
} elseif ($action == 'set') {
|
||||||
|
// Activate a model
|
||||||
// Activate a model
|
|
||||||
elseif ($action == 'set') {
|
|
||||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||||
} elseif ($action == 'del') {
|
} elseif ($action == 'del') {
|
||||||
$ret = delDocumentModel($value, $type);
|
$ret = delDocumentModel($value, $type);
|
||||||
@ -154,10 +148,8 @@ elseif ($action == 'set') {
|
|||||||
if ($conf->global->$constforval == "$value") dolibarr_del_const($db, $constforval, $conf->entity);
|
if ($conf->global->$constforval == "$value") dolibarr_del_const($db, $constforval, $conf->entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} elseif ($action == 'setdoc') {
|
||||||
|
// Set or unset default model
|
||||||
// Set or unset default model
|
|
||||||
elseif ($action == 'setdoc') {
|
|
||||||
$tmpobjectkey = GETPOST('object');
|
$tmpobjectkey = GETPOST('object');
|
||||||
if (!empty($tmpobjectkey)) {
|
if (!empty($tmpobjectkey)) {
|
||||||
$constforval = 'MYMODULE_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
|
$constforval = 'MYMODULE_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||||
@ -207,8 +199,7 @@ print dol_get_fiche_head($head, 'settings', '', -1, "mymodule@mymodule");
|
|||||||
echo '<span class="opacitymedium">'.$langs->trans("MyModuleSetupPage").'</span><br><br>';
|
echo '<span class="opacitymedium">'.$langs->trans("MyModuleSetupPage").'</span><br><br>';
|
||||||
|
|
||||||
|
|
||||||
if ($action == 'edit')
|
if ($action == 'edit') {
|
||||||
{
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
@ -216,8 +207,7 @@ if ($action == 'edit')
|
|||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||||
|
|
||||||
foreach ($arrayofparameters as $key => $val)
|
foreach ($arrayofparameters as $key => $val) {
|
||||||
{
|
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
$tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
|
$tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
|
||||||
print $form->textwithpicto($langs->trans($key), $tooltiphelp);
|
print $form->textwithpicto($langs->trans($key), $tooltiphelp);
|
||||||
@ -232,13 +222,11 @@ if ($action == 'edit')
|
|||||||
print '</form>';
|
print '</form>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
} else {
|
} else {
|
||||||
if (!empty($arrayofparameters))
|
if (!empty($arrayofparameters)) {
|
||||||
{
|
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||||
|
|
||||||
foreach ($arrayofparameters as $key => $val)
|
foreach ($arrayofparameters as $key => $val) {
|
||||||
{
|
|
||||||
$setupnotempty++;
|
$setupnotempty++;
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
@ -264,7 +252,9 @@ $myTmpObjects['MyObject'] = array('includerefgeneration'=>0, 'includedocgenerati
|
|||||||
|
|
||||||
|
|
||||||
foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
||||||
if ($myTmpObjectKey == 'MyObject') continue;
|
if ($myTmpObjectKey == 'MyObject') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if ($myTmpObjectArray['includerefgeneration']) {
|
if ($myTmpObjectArray['includerefgeneration']) {
|
||||||
/*
|
/*
|
||||||
* Orders Numbering model
|
* Orders Numbering model
|
||||||
@ -284,19 +274,14 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
foreach ($dirmodels as $reldir)
|
foreach ($dirmodels as $reldir) {
|
||||||
{
|
|
||||||
$dir = dol_buildpath($reldir."core/modules/".$moduledir);
|
$dir = dol_buildpath($reldir."core/modules/".$moduledir);
|
||||||
|
|
||||||
if (is_dir($dir))
|
if (is_dir($dir)) {
|
||||||
{
|
|
||||||
$handle = opendir($dir);
|
$handle = opendir($dir);
|
||||||
if (is_resource($handle))
|
if (is_resource($handle)) {
|
||||||
{
|
while (($file = readdir($handle)) !== false) {
|
||||||
while (($file = readdir($handle)) !== false)
|
if (strpos($file, 'mod_'.strtolower($myTmpObjectKey).'_') === 0 && substr($file, dol_strlen($file) - 3, 3) == 'php') {
|
||||||
{
|
|
||||||
if (strpos($file, 'mod_'.strtolower($myTmpObjectKey).'_') === 0 && substr($file, dol_strlen($file) - 3, 3) == 'php')
|
|
||||||
{
|
|
||||||
$file = substr($file, 0, dol_strlen($file) - 4);
|
$file = substr($file, 0, dol_strlen($file) - 4);
|
||||||
|
|
||||||
require_once $dir.'/'.$file.'.php';
|
require_once $dir.'/'.$file.'.php';
|
||||||
@ -304,11 +289,14 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||||||
$module = new $file($db);
|
$module = new $file($db);
|
||||||
|
|
||||||
// Show modules according to features level
|
// Show modules according to features level
|
||||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
|
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
|
||||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
|
continue;
|
||||||
|
}
|
||||||
|
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if ($module->isEnabled())
|
if ($module->isEnabled()) {
|
||||||
{
|
|
||||||
dol_include_once('/'.$moduledir.'/class/'.strtolower($myTmpObjectKey).'.class.php');
|
dol_include_once('/'.$moduledir.'/class/'.strtolower($myTmpObjectKey).'.class.php');
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
|
print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
|
||||||
@ -321,14 +309,16 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||||||
if (preg_match('/^Error/', $tmp)) {
|
if (preg_match('/^Error/', $tmp)) {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||||
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
} elseif ($tmp == 'NotConfigured') {
|
||||||
else print $tmp;
|
print $langs->trans($tmp);
|
||||||
|
} else {
|
||||||
|
print $tmp;
|
||||||
|
}
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
|
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
$constforvar = 'MYMODULE_'.strtoupper($myTmpObjectKey).'_ADDON';
|
$constforvar = 'MYMODULE_'.strtoupper($myTmpObjectKey).'_ADDON';
|
||||||
if ($conf->global->$constforvar == $file)
|
if ($conf->global->$constforvar == $file) {
|
||||||
{
|
|
||||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
} else {
|
} else {
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&object='.strtolower($myTmpObjectKey).'&value='.urlencode($file).'">';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&object='.strtolower($myTmpObjectKey).'&value='.urlencode($file).'">';
|
||||||
@ -387,12 +377,10 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||||||
$sql .= " WHERE type = '".$db->escape($type)."'";
|
$sql .= " WHERE type = '".$db->escape($type)."'";
|
||||||
$sql .= " AND entity = ".$conf->entity;
|
$sql .= " AND entity = ".$conf->entity;
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$num_rows = $db->num_rows($resql);
|
$num_rows = $db->num_rows($resql);
|
||||||
while ($i < $num_rows)
|
while ($i < $num_rows) {
|
||||||
{
|
|
||||||
$array = $db->fetch_array($resql);
|
$array = $db->fetch_array($resql);
|
||||||
array_push($def, $array[0]);
|
array_push($def, $array[0]);
|
||||||
$i++;
|
$i++;
|
||||||
@ -413,31 +401,23 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
foreach ($dirmodels as $reldir)
|
foreach ($dirmodels as $reldir) {
|
||||||
{
|
foreach (array('', '/doc') as $valdir) {
|
||||||
foreach (array('', '/doc') as $valdir)
|
|
||||||
{
|
|
||||||
$realpath = $reldir."core/modules/".$moduledir.$valdir;
|
$realpath = $reldir."core/modules/".$moduledir.$valdir;
|
||||||
$dir = dol_buildpath($realpath);
|
$dir = dol_buildpath($realpath);
|
||||||
|
|
||||||
if (is_dir($dir))
|
if (is_dir($dir)) {
|
||||||
{
|
|
||||||
$handle = opendir($dir);
|
$handle = opendir($dir);
|
||||||
if (is_resource($handle))
|
if (is_resource($handle)) {
|
||||||
{
|
while (($file = readdir($handle)) !== false) {
|
||||||
while (($file = readdir($handle)) !== false)
|
|
||||||
{
|
|
||||||
$filelist[] = $file;
|
$filelist[] = $file;
|
||||||
}
|
}
|
||||||
closedir($handle);
|
closedir($handle);
|
||||||
arsort($filelist);
|
arsort($filelist);
|
||||||
|
|
||||||
foreach ($filelist as $file)
|
foreach ($filelist as $file) {
|
||||||
{
|
if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
|
||||||
if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file))
|
if (file_exists($dir.'/'.$file)) {
|
||||||
{
|
|
||||||
if (file_exists($dir.'/'.$file))
|
|
||||||
{
|
|
||||||
$name = substr($file, 4, dol_strlen($file) - 16);
|
$name = substr($file, 4, dol_strlen($file) - 16);
|
||||||
$classname = substr($file, 0, dol_strlen($file) - 12);
|
$classname = substr($file, 0, dol_strlen($file) - 12);
|
||||||
|
|
||||||
@ -445,21 +425,26 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||||||
$module = new $classname($db);
|
$module = new $classname($db);
|
||||||
|
|
||||||
$modulequalified = 1;
|
$modulequalified = 1;
|
||||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0;
|
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
|
||||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0;
|
$modulequalified = 0;
|
||||||
|
}
|
||||||
|
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
|
||||||
|
$modulequalified = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if ($modulequalified)
|
if ($modulequalified) {
|
||||||
{
|
|
||||||
print '<tr class="oddeven"><td width="100">';
|
print '<tr class="oddeven"><td width="100">';
|
||||||
print (empty($module->name) ? $name : $module->name);
|
print (empty($module->name) ? $name : $module->name);
|
||||||
print "</td><td>\n";
|
print "</td><td>\n";
|
||||||
if (method_exists($module, 'info')) print $module->info($langs);
|
if (method_exists($module, 'info')) {
|
||||||
else print $module->description;
|
print $module->info($langs);
|
||||||
|
} else {
|
||||||
|
print $module->description;
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Active
|
// Active
|
||||||
if (in_array($name, $def))
|
if (in_array($name, $def)) {
|
||||||
{
|
|
||||||
print '<td class="center">'."\n";
|
print '<td class="center">'."\n";
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.$name.'">';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.$name.'">';
|
||||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||||
@ -486,8 +471,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||||||
// Info
|
// Info
|
||||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
|
$htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
|
||||||
if ($module->type == 'pdf')
|
if ($module->type == 'pdf') {
|
||||||
{
|
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||||
}
|
}
|
||||||
$htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
|
$htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
|
||||||
@ -502,8 +486,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||||||
|
|
||||||
// Preview
|
// Preview
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($module->type == 'pdf')
|
if ($module->type == 'pdf') {
|
||||||
{
|
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&object='.$myTmpObjectKey.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&object='.$myTmpObjectKey.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||||
|
|||||||
@ -410,7 +410,9 @@ class modMyModule extends DolibarrModules
|
|||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$result = $this->_load_tables('/mymodule/sql/');
|
$result = $this->_load_tables('/mymodule/sql/');
|
||||||
if ($result < 0) return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
|
if ($result < 0) {
|
||||||
|
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
|
||||||
|
}
|
||||||
|
|
||||||
// Create extrafields during init
|
// Create extrafields during init
|
||||||
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
@ -432,19 +434,19 @@ class modMyModule extends DolibarrModules
|
|||||||
$myTmpObjects['MyObject'] = array('includerefgeneration'=>0, 'includedocgeneration'=>0);
|
$myTmpObjects['MyObject'] = array('includerefgeneration'=>0, 'includedocgeneration'=>0);
|
||||||
|
|
||||||
foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
||||||
if ($myTmpObjectKey == 'MyObject') continue;
|
if ($myTmpObjectKey == 'MyObject') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if ($myTmpObjectArray['includerefgeneration']) {
|
if ($myTmpObjectArray['includerefgeneration']) {
|
||||||
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/mymodule/template_myobjects.odt';
|
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/mymodule/template_myobjects.odt';
|
||||||
$dirodt = DOL_DATA_ROOT.'/doctemplates/mymodule';
|
$dirodt = DOL_DATA_ROOT.'/doctemplates/mymodule';
|
||||||
$dest = $dirodt.'/template_myobjects.odt';
|
$dest = $dirodt.'/template_myobjects.odt';
|
||||||
|
|
||||||
if (file_exists($src) && !file_exists($dest))
|
if (file_exists($src) && !file_exists($dest)) {
|
||||||
{
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
dol_mkdir($dirodt);
|
dol_mkdir($dirodt);
|
||||||
$result = dol_copy($src, $dest, 0, 0);
|
$result = dol_copy($src, $dest, 0, 0);
|
||||||
if ($result < 0)
|
if ($result < 0) {
|
||||||
{
|
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest);
|
$this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest);
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@ -54,8 +54,7 @@ if (!$res) die("Include of main fails");
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
|
||||||
// Load user to have $user->conf loaded (not done by default here because of NOLOGIN constant defined) and load permission if we need to use them in CSS
|
// Load user to have $user->conf loaded (not done by default here because of NOLOGIN constant defined) and load permission if we need to use them in CSS
|
||||||
/*if (empty($user->id) && ! empty($_SESSION['dol_login']))
|
/*if (empty($user->id) && ! empty($_SESSION['dol_login'])) {
|
||||||
{
|
|
||||||
$user->fetch('',$_SESSION['dol_login']);
|
$user->fetch('',$_SESSION['dol_login']);
|
||||||
$user->getrights();
|
$user->getrights();
|
||||||
}*/
|
}*/
|
||||||
@ -65,8 +64,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
|||||||
header('Content-type: text/css');
|
header('Content-type: text/css');
|
||||||
// Important: Following code is to cache this file to avoid page request by browser at each Dolibarr page access.
|
// Important: Following code is to cache this file to avoid page request by browser at each Dolibarr page access.
|
||||||
// You can use CTRL+F5 to refresh your browser cache.
|
// You can use CTRL+F5 to refresh your browser cache.
|
||||||
if (empty($dolibarr_nocache)) header('Cache-Control: max-age=10800, public, must-revalidate');
|
if (empty($dolibarr_nocache)) {
|
||||||
else header('Cache-Control: no-cache');
|
header('Cache-Control: max-age=10800, public, must-revalidate');
|
||||||
|
} else {
|
||||||
|
header('Cache-Control: no-cache');
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@ -48,10 +48,11 @@ $action = GETPOST('action', 'aZ09');
|
|||||||
|
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
//if (! $user->rights->mymodule->myobject->read) accessforbidden();
|
// if (! $user->rights->mymodule->myobject->read) {
|
||||||
|
// accessforbidden();
|
||||||
|
// }
|
||||||
$socid = GETPOST('socid', 'int');
|
$socid = GETPOST('socid', 'int');
|
||||||
if (isset($user->socid) && $user->socid > 0)
|
if (isset($user->socid) && $user->socid > 0) {
|
||||||
{
|
|
||||||
$action = '';
|
$action = '';
|
||||||
$socid = $user->socid;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,7 +77,9 @@ $backtopage = GETPOST('backtopage', 'alpha');
|
|||||||
|
|
||||||
if (GETPOST('actioncode', 'array')) {
|
if (GETPOST('actioncode', 'array')) {
|
||||||
$actioncode = GETPOST('actioncode', 'array', 3);
|
$actioncode = GETPOST('actioncode', 'array', 3);
|
||||||
if (!count($actioncode)) $actioncode = '0';
|
if (!count($actioncode)) {
|
||||||
|
$actioncode = '0';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
|
$actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
|
||||||
}
|
}
|
||||||
@ -87,12 +89,18 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
|||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) {
|
||||||
|
$page = 0;
|
||||||
|
} // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
if (!$sortfield) $sortfield = 'a.datep,a.id';
|
if (!$sortfield) {
|
||||||
if (!$sortorder) $sortorder = 'DESC,DESC';
|
$sortfield = 'a.datep,a.id';
|
||||||
|
}
|
||||||
|
if (!$sortorder) {
|
||||||
|
$sortorder = 'DESC,DESC';
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize technical objects
|
// Initialize technical objects
|
||||||
$object = new MyObject($db);
|
$object = new MyObject($db);
|
||||||
@ -104,7 +112,9 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
|
|
||||||
// Load object
|
// Load object
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||||
if ($id > 0 || !empty($ref)) $upload_dir = $conf->mymodule->multidir_output[$object->entity]."/".$object->id;
|
if ($id > 0 || !empty($ref)) {
|
||||||
|
$upload_dir = $conf->mymodule->multidir_output[$object->entity]."/".$object->id;
|
||||||
|
}
|
||||||
|
|
||||||
// Security check - Protection if external user
|
// Security check - Protection if external user
|
||||||
//if ($user->socid > 0) accessforbidden();
|
//if ($user->socid > 0) accessforbidden();
|
||||||
@ -120,20 +130,19 @@ $permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the incl
|
|||||||
|
|
||||||
$parameters = array('id'=>$id);
|
$parameters = array('id'=>$id);
|
||||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($reshook))
|
if (empty($reshook)) {
|
||||||
{
|
|
||||||
// Cancel
|
// Cancel
|
||||||
if (GETPOST('cancel', 'alpha') && !empty($backtopage))
|
if (GETPOST('cancel', 'alpha') && !empty($backtopage)) {
|
||||||
{
|
|
||||||
header("Location: ".$backtopage);
|
header("Location: ".$backtopage);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Purge search criteria
|
// Purge search criteria
|
||||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
|
||||||
{
|
|
||||||
$actioncode = '';
|
$actioncode = '';
|
||||||
$search_agenda_label = '';
|
$search_agenda_label = '';
|
||||||
}
|
}
|
||||||
@ -147,14 +156,15 @@ if (empty($reshook))
|
|||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
if ($object->id > 0)
|
if ($object->id > 0) {
|
||||||
{
|
|
||||||
$title = $langs->trans("Agenda");
|
$title = $langs->trans("Agenda");
|
||||||
//if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
|
//if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
|
||||||
$help_url = '';
|
$help_url = '';
|
||||||
llxHeader('', $title, $help_url);
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
if (!empty($conf->notification->enabled)) $langs->load("mails");
|
if (!empty($conf->notification->enabled)) {
|
||||||
|
$langs->load("mails");
|
||||||
|
}
|
||||||
$head = myobjectPrepareHead($object);
|
$head = myobjectPrepareHead($object);
|
||||||
|
|
||||||
|
|
||||||
@ -172,14 +182,13 @@ if ($object->id > 0)
|
|||||||
// Thirdparty
|
// Thirdparty
|
||||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||||
// Project
|
// Project
|
||||||
if (! empty($conf->projet->enabled))
|
if (! empty($conf->projet->enabled)) {
|
||||||
{
|
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||||
if ($permissiontoadd)
|
if ($permissiontoadd) {
|
||||||
{
|
if ($action != 'classify') {
|
||||||
if ($action != 'classify')
|
|
||||||
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||||
|
}
|
||||||
$morehtmlref.=' : ';
|
$morehtmlref.=' : ';
|
||||||
if ($action == 'classify') {
|
if ($action == 'classify') {
|
||||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||||
@ -228,10 +237,11 @@ if ($object->id > 0)
|
|||||||
$urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id;
|
$urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id;
|
||||||
$out .= '&backtopage='.urlencode($urlbacktopage);
|
$out .= '&backtopage='.urlencode($urlbacktopage);
|
||||||
$permok = $user->rights->agenda->myactions->create;
|
$permok = $user->rights->agenda->myactions->create;
|
||||||
if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok)
|
if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) {
|
||||||
{
|
|
||||||
//$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
//$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
||||||
if (get_class($objthirdparty) == 'Societe') $out .= '&socid='.urlencode($objthirdparty->id);
|
if (get_class($objthirdparty) == 'Societe') {
|
||||||
|
$out .= '&socid='.urlencode($objthirdparty->id);
|
||||||
|
}
|
||||||
$out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : '').'&percentage=-1';
|
$out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : '').'&percentage=-1';
|
||||||
//$out.=$langs->trans("AddAnAction").' ';
|
//$out.=$langs->trans("AddAnAction").' ';
|
||||||
//$out.=img_picto($langs->trans("AddAnAction"),'filenew');
|
//$out.=img_picto($langs->trans("AddAnAction"),'filenew');
|
||||||
@ -241,10 +251,8 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
if (!empty($conf->agenda->enabled))
|
if (!empty($conf->agenda->enabled)) {
|
||||||
{
|
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create))
|
|
||||||
{
|
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||||
} else {
|
} else {
|
||||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||||
@ -253,11 +261,14 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read)))
|
if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
|
||||||
{
|
|
||||||
$param = '&id='.$object->id.'&socid='.$socid;
|
$param = '&id='.$object->id.'&socid='.$socid;
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
$param .= '&contextpage='.urlencode($contextpage);
|
||||||
|
}
|
||||||
|
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||||
|
$param .= '&limit='.urlencode($limit);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//print load_fiche_titre($langs->trans("ActionsOnMyObject"), '', '');
|
//print load_fiche_titre($langs->trans("ActionsOnMyObject"), '', '');
|
||||||
|
|||||||
@ -73,7 +73,7 @@ $ref = GETPOST('ref', 'alpha');
|
|||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
$cancel = GETPOST('cancel', 'aZ09');
|
$cancel = GETPOST('cancel', 'aZ09');
|
||||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search
|
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search
|
||||||
$backtopage = GETPOST('backtopage', 'alpha');
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
||||||
//$lineid = GETPOST('lineid', 'int');
|
//$lineid = GETPOST('lineid', 'int');
|
||||||
@ -92,12 +92,15 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen
|
|||||||
// Initialize array of search criterias
|
// Initialize array of search criterias
|
||||||
$search_all = GETPOST("search_all", 'alpha');
|
$search_all = GETPOST("search_all", 'alpha');
|
||||||
$search = array();
|
$search = array();
|
||||||
foreach ($object->fields as $key => $val)
|
foreach ($object->fields as $key => $val) {
|
||||||
{
|
if (GETPOST('search_'.$key, 'alpha')) {
|
||||||
if (GETPOST('search_'.$key, 'alpha')) $search[$key] = GETPOST('search_'.$key, 'alpha');
|
$search[$key] = GETPOST('search_'.$key, 'alpha');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($action) && empty($id) && empty($ref)) $action = 'view';
|
if (empty($action) && empty($id) && empty($ref)) {
|
||||||
|
$action = 'view';
|
||||||
|
}
|
||||||
|
|
||||||
// Load object
|
// Load object
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
||||||
@ -127,8 +130,7 @@ $parameters = array();
|
|||||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
if (empty($reshook))
|
if (empty($reshook)) {
|
||||||
{
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$backurlforlist = dol_buildpath('/mymodule/myobject_list.php', 1);
|
$backurlforlist = dol_buildpath('/mymodule/myobject_list.php', 1);
|
||||||
@ -157,12 +159,10 @@ if (empty($reshook))
|
|||||||
// Action to build doc
|
// Action to build doc
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||||
|
|
||||||
if ($action == 'set_thirdparty' && $permissiontoadd)
|
if ($action == 'set_thirdparty' && $permissiontoadd) {
|
||||||
{
|
|
||||||
$object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname);
|
$object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname);
|
||||||
}
|
}
|
||||||
if ($action == 'classin' && $permissiontoadd)
|
if ($action == 'classin' && $permissiontoadd) {
|
||||||
{
|
|
||||||
$object->setProject(GETPOST('projectid', 'int'));
|
$object->setProject(GETPOST('projectid', 'int'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -207,15 +207,18 @@ jQuery(document).ready(function() {
|
|||||||
|
|
||||||
|
|
||||||
// Part to create
|
// Part to create
|
||||||
if ($action == 'create')
|
if ($action == 'create') {
|
||||||
{
|
|
||||||
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("MyObject")), '', 'object_'.$object->picto);
|
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("MyObject")), '', 'object_'.$object->picto);
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
if ($backtopage) {
|
||||||
if ($backtopageforcancel) print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
|
}
|
||||||
|
if ($backtopageforcancel) {
|
||||||
|
print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
|
||||||
|
}
|
||||||
|
|
||||||
print dol_get_fiche_head(array(), '');
|
print dol_get_fiche_head(array(), '');
|
||||||
|
|
||||||
@ -246,16 +249,19 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Part to edit record
|
// Part to edit record
|
||||||
if (($id || $ref) && $action == 'edit')
|
if (($id || $ref) && $action == 'edit') {
|
||||||
{
|
|
||||||
print load_fiche_titre($langs->trans("MyObject"), '', 'object_'.$object->picto);
|
print load_fiche_titre($langs->trans("MyObject"), '', 'object_'.$object->picto);
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||||
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
if ($backtopage) {
|
||||||
if ($backtopageforcancel) print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
|
}
|
||||||
|
if ($backtopageforcancel) {
|
||||||
|
print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
|
||||||
|
}
|
||||||
|
|
||||||
print dol_get_fiche_head();
|
print dol_get_fiche_head();
|
||||||
|
|
||||||
@ -279,8 +285,7 @@ if (($id || $ref) && $action == 'edit')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Part to show record
|
// Part to show record
|
||||||
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
|
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
|
||||||
{
|
|
||||||
$res = $object->fetch_optionals();
|
$res = $object->fetch_optionals();
|
||||||
|
|
||||||
$head = myobjectPrepareHead($object);
|
$head = myobjectPrepareHead($object);
|
||||||
@ -304,8 +309,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Confirmation of action xxxx
|
// Confirmation of action xxxx
|
||||||
if ($action == 'xxx')
|
if ($action == 'xxx') {
|
||||||
{
|
|
||||||
$formquestion = array();
|
$formquestion = array();
|
||||||
/*
|
/*
|
||||||
$forcecombo=0;
|
$forcecombo=0;
|
||||||
@ -323,8 +327,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
// Call Hook formConfirm
|
// Call Hook formConfirm
|
||||||
$parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
|
$parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
|
||||||
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
if (empty($reshook)) $formconfirm .= $hookmanager->resPrint;
|
if (empty($reshook)) {
|
||||||
elseif ($reshook > 0) $formconfirm = $hookmanager->resPrint;
|
$formconfirm .= $hookmanager->resPrint;
|
||||||
|
} elseif ($reshook > 0) {
|
||||||
|
$formconfirm = $hookmanager->resPrint;
|
||||||
|
}
|
||||||
|
|
||||||
// Print form confirm
|
// Print form confirm
|
||||||
print $formconfirm;
|
print $formconfirm;
|
||||||
@ -342,12 +349,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
// Thirdparty
|
// Thirdparty
|
||||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||||
// Project
|
// Project
|
||||||
if (! empty($conf->projet->enabled))
|
if (! empty($conf->projet->enabled)) {
|
||||||
{
|
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
$morehtmlref .= '<br>'.$langs->trans('Project') . ' ';
|
$morehtmlref .= '<br>'.$langs->trans('Project') . ' ';
|
||||||
if ($permissiontoadd)
|
if ($permissiontoadd) {
|
||||||
{
|
|
||||||
//if ($action != 'classify') $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
|
//if ($action != 'classify') $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
|
||||||
$morehtmlref .= ' : ';
|
$morehtmlref .= ' : ';
|
||||||
if ($action == 'classify') {
|
if ($action == 'classify') {
|
||||||
@ -404,8 +409,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
* Lines
|
* Lines
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!empty($object->table_element_line))
|
if (!empty($object->table_element_line)) {
|
||||||
{
|
|
||||||
// Show object lines
|
// Show object lines
|
||||||
$result = $object->getLinesArray();
|
$result = $object->getLinesArray();
|
||||||
|
|
||||||
@ -421,21 +425,17 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline'))
|
if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) {
|
||||||
{
|
|
||||||
print '<table id="tablelines" class="noborder noshadow" width="100%">';
|
print '<table id="tablelines" class="noborder noshadow" width="100%">';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($object->lines))
|
if (!empty($object->lines)) {
|
||||||
{
|
|
||||||
$object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1);
|
$object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Form to add new line
|
// Form to add new line
|
||||||
if ($object->status == 0 && $permissiontoadd && $action != 'selectlines')
|
if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') {
|
||||||
{
|
if ($action != 'editline') {
|
||||||
if ($action != 'editline')
|
|
||||||
{
|
|
||||||
// Add products/services form
|
// Add products/services form
|
||||||
$object->formAddObjectLine(1, $mysoc, $soc);
|
$object->formAddObjectLine(1, $mysoc, $soc);
|
||||||
|
|
||||||
@ -444,8 +444,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline'))
|
if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) {
|
||||||
{
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
print '</div>';
|
print '</div>';
|
||||||
@ -462,8 +461,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
if (empty($reshook))
|
if (empty($reshook)) {
|
||||||
{
|
|
||||||
// Send
|
// Send
|
||||||
if (empty($user->socid)) {
|
if (empty($user->socid)) {
|
||||||
print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle');
|
print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle');
|
||||||
@ -491,16 +489,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=scrumsprint', '', $permissiontoadd);
|
print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=scrumsprint', '', $permissiontoadd);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if ($permissiontoadd)
|
if ($permissiontoadd) {
|
||||||
{
|
|
||||||
if ($object->status == $object::STATUS_ENABLED) {
|
if ($object->status == $object::STATUS_ENABLED) {
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=disable">'.$langs->trans("Disable").'</a>'."\n";
|
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=disable">'.$langs->trans("Disable").'</a>'."\n";
|
||||||
} else {
|
} else {
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=enable">'.$langs->trans("Enable").'</a>'."\n";
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=enable">'.$langs->trans("Enable").'</a>'."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($permissiontoadd)
|
if ($permissiontoadd) {
|
||||||
{
|
|
||||||
if ($object->status == $object::STATUS_VALIDATED) {
|
if ($object->status == $object::STATUS_VALIDATED) {
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close">'.$langs->trans("Cancel").'</a>'."\n";
|
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close">'.$langs->trans("Cancel").'</a>'."\n";
|
||||||
} else {
|
} else {
|
||||||
@ -521,8 +517,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
$action = 'presend';
|
$action = 'presend';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action != 'presend')
|
if ($action != 'presend') {
|
||||||
{
|
|
||||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||||
print '<a name="builddoc"></a>'; // ancre
|
print '<a name="builddoc"></a>'; // ancre
|
||||||
|
|
||||||
@ -561,7 +556,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Select mail models is same action as presend
|
//Select mail models is same action as presend
|
||||||
if (GETPOST('modelselected')) $action = 'presend';
|
if (GETPOST('modelselected')) {
|
||||||
|
$action = 'presend';
|
||||||
|
}
|
||||||
|
|
||||||
// Presend form
|
// Presend form
|
||||||
$modelmail = 'myobject';
|
$modelmail = 'myobject';
|
||||||
|
|||||||
@ -79,12 +79,18 @@ $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
|||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) {
|
||||||
|
$page = 0;
|
||||||
|
} // If $page is not defined, or '' or -1
|
||||||
$offset = $liste_limit * $page;
|
$offset = $liste_limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
if (!$sortorder) $sortorder = "ASC";
|
if (!$sortorder) {
|
||||||
if (!$sortfield) $sortfield = "name";
|
$sortorder = "ASC";
|
||||||
|
}
|
||||||
|
if (!$sortfield) {
|
||||||
|
$sortfield = "name";
|
||||||
|
}
|
||||||
//if (! $sortfield) $sortfield="position_name";
|
//if (! $sortfield) $sortfield="position_name";
|
||||||
|
|
||||||
// Initialize technical objects
|
// Initialize technical objects
|
||||||
@ -98,7 +104,9 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
// Load object
|
// Load object
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||||
|
|
||||||
if ($id > 0 || !empty($ref)) $upload_dir = $conf->mymodule->multidir_output[$object->entity ? $object->entity : $conf->entity]."/myobject/".get_exdir(0, 0, 0, 1, $object);
|
if ($id > 0 || !empty($ref)) {
|
||||||
|
$upload_dir = $conf->mymodule->multidir_output[$object->entity ? $object->entity : $conf->entity]."/myobject/".get_exdir(0, 0, 0, 1, $object);
|
||||||
|
}
|
||||||
|
|
||||||
// Security check - Protection if external user
|
// Security check - Protection if external user
|
||||||
//if ($user->socid > 0) accessforbidden();
|
//if ($user->socid > 0) accessforbidden();
|
||||||
@ -127,8 +135,7 @@ $help_url = '';
|
|||||||
//$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
|
//$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
|
||||||
llxHeader('', $title, $help_url);
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
if ($object->id)
|
if ($object->id) {
|
||||||
{
|
|
||||||
/*
|
/*
|
||||||
* Show tabs
|
* Show tabs
|
||||||
*/
|
*/
|
||||||
@ -140,8 +147,7 @@ if ($object->id)
|
|||||||
// Build file list
|
// Build file list
|
||||||
$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
|
$filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
|
||||||
$totalsize = 0;
|
$totalsize = 0;
|
||||||
foreach ($filearray as $key => $file)
|
foreach ($filearray as $key => $file) {
|
||||||
{
|
|
||||||
$totalsize += $file['size'];
|
$totalsize += $file['size'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user