Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into dev_new_add_ref_clinet_intervention
This commit is contained in:
commit
566806bbea
99
ChangeLog
99
ChangeLog
@ -41,6 +41,105 @@ Following changes may create regressions for some external modules, but were nec
|
||||
* Method fetch_all of DolResource has been renamed into fetchAll() to match naming conventions.
|
||||
* The hook 'upgrade' and 'doUpgrade2" has been renamed 'doUpgradeBefore' and 'doUpgradeAfterDB'. A new trigger 'doUpgradeAfterFiles' has been introduced.
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 15.0.2 compared to 15.0.1 *****
|
||||
|
||||
FIX: #19777 #20281
|
||||
FIX: #20140 #20301
|
||||
FIX: #20279 Accountancy - PostGreSQL - Error on mass update lines already binded
|
||||
FIX: #20476 migration postgresql 14.0.x to 15.0.x packaging type
|
||||
FIX: #20733 Inventory: Do not use batch qty even if present if batch module is disabled.
|
||||
FIX: action comm list: holiday last day not included + handle duration with halfdays
|
||||
FIX: Add missing entity on salary's payment
|
||||
FIX: Add 'recruitment' into check array
|
||||
FIX: add tools to fix bad bank amount in accounting with multicurrency
|
||||
FIX: assign member cateogry to a member
|
||||
FIX: backport
|
||||
FIX: bad bank amount in accounting with multicurrency
|
||||
FIX: Bad condition on remx
|
||||
FIX: Bad filter on date on salary list
|
||||
FIX: bad link to add a customer price (token duplicated)
|
||||
FIX: bad status of member on widget by type and status
|
||||
FIX: better error management at product selling price update
|
||||
FIX: Can't edit bank record
|
||||
FIX: check mandatory thirdparty fields for mass action
|
||||
FIX: check thirdparty object loaded and properties exist
|
||||
FIX: comment
|
||||
FIX: compatibility for ticket number sharing
|
||||
FIX: compatibility with multicompany sharings
|
||||
FIX: contact card: single extrafield update failed
|
||||
FIX: country not visible into list of states
|
||||
FIX: Delete an extrafield where type is double
|
||||
FIX: deprecated module are not more viewed as external modules
|
||||
FIX: Disable customer type by default if type prospect/customer is disabled
|
||||
FIX: each time we create a supplier order, we need to give it a ref_supplier
|
||||
FIX: Error management
|
||||
FIX: fatal error for $db usage in tpl
|
||||
FIX: filter into the list of product lots
|
||||
FIX: Filter on Object Referent page give CRSF page
|
||||
FIX: Fix default options ($hidedetails, $hidedesc, $hideref) with globales when generate PDF in mass actions
|
||||
FIX: Fix search by filters
|
||||
FIX: Fix the adding of lines in the create invoice functions
|
||||
FIX: forgotten form confirm before various payment delete
|
||||
FIX: holiday/leave requests: write status change emails in HTML
|
||||
FIX: include discount price for PMP after a reception (Issue #20029)
|
||||
FIX: incrementation
|
||||
FIX: in salary stats and payment list, we must check right perms as well as salary list
|
||||
FIX: intervention entity missing
|
||||
FIX: label tax cat trad
|
||||
FIX: Mass action ship orders
|
||||
FIX: missing advanced perms
|
||||
FIX: missing call to executeHooks()
|
||||
FIX: Missing entity on adding new VAT
|
||||
FIX: missing hook for row ordering
|
||||
FIX: missing hook parameter ($possiblelinks)
|
||||
FIX: missing parenthesis
|
||||
FIX: missing picto in combo of mass actions of thirdparties.
|
||||
FIX: missing signature library when ODT model is used
|
||||
FIX: Missing unset fields after updateline expensereport
|
||||
FIX: ModuileBuilder - Fix getLinesArray() error reporting
|
||||
FIX: Move delete task time trigger position
|
||||
FIX: Navigation between invoices
|
||||
FIX: No empty line inserted into accounting_bookkeeping
|
||||
FIX: Numbering of sepa files
|
||||
FIX: object cloning: set unique extrafield values to null to prevent duplicates
|
||||
FIX: on update with action reminder in future there is user key error
|
||||
FIX: originproductline array td identification data-id
|
||||
FIX: out of memory when more than 100 000 invoices.
|
||||
FIX: permit access to medias when logged in a different entity
|
||||
FIX: phpcs
|
||||
FIX: project creation prevented if PROJECTLEADER contact role renamed, de-activated or deleted
|
||||
FIX: project timesheet by week: cleanup unused code
|
||||
FIX: project timesheet: public holidays offset by 1 day
|
||||
FIX: project timesheets: assume Saturday and Sunday as default weekend days when working days conf is empty or badly formed
|
||||
FIX: propal list: bad error management when setting "not signed" mass action
|
||||
FIX: propal list mass action translations and error management (v14 edition)
|
||||
FIX: propal list: missing not signed massaction translation keys for transifex
|
||||
FIX: PR returns
|
||||
FIX: ref_client doesn't exists on supplier invoice, then ref_fourn needs to have a default value when we want to bill several supplier orders
|
||||
FIX: replenish and manage product stock by warhouse
|
||||
FIX: sending email on payment of registration of event
|
||||
FIX: SEPA ICS is not mandatory for bank transfer
|
||||
FIX: Set datec when add time spent on a project task
|
||||
FIX: status filter on supplierOrder stats doesn't work
|
||||
FIX: stickler-ci
|
||||
FIX: still prevent project creation if PROJECTLEADER role unavailable, but with a specific error message
|
||||
FIX: Supplier order stats
|
||||
FIX: Tabulation must be allowed for HTML content
|
||||
FIX: tool to fix bank account not in main currency for vendor invoice
|
||||
FIX: translations
|
||||
FIX: Travis + Update dev
|
||||
FIX: truncate Customer Reference too long on PDF header (PR #20718)
|
||||
FIX: uniformize code
|
||||
FIX: Update of sale price (log not correctly updated)
|
||||
FIX: user actions rights when mulit-company transverse mode is enabled
|
||||
FIX: user employee tab: offset in open days messes up holiday length calculation
|
||||
FIX: We need to have a different default_ref_supplier for each new fourn invoice
|
||||
FIX: "WHERE" clause missing on resource export
|
||||
FIX: #yogosha9754
|
||||
|
||||
|
||||
***** ChangeLog for 15.0.1 compared to 15.0.0 *****
|
||||
FIX: #19777 #20281
|
||||
FIX: bad position of extrafields for interventions
|
||||
|
||||
@ -748,6 +748,7 @@ class AccountingAccount extends CommonObject
|
||||
$reshook = $hookmanager->executeHooks('accoutancyBindingCalculation', $parameters); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
if (empty($reshook)) {
|
||||
$const_name = '';
|
||||
if ($type == 'customer') {
|
||||
$const_name = "SOLD";
|
||||
} elseif ($type == 'supplier') {
|
||||
|
||||
@ -699,6 +699,8 @@ class Lettering extends BookKeeping
|
||||
return $grouped_payments;
|
||||
}
|
||||
|
||||
$save_payment_by_element = null;
|
||||
$save_element_by_payment = null;
|
||||
if ($element_id == 0) {
|
||||
// Save list when is the begin of recursive function
|
||||
$save_payment_by_element = $payment_by_element;
|
||||
|
||||
@ -420,7 +420,7 @@ if (!empty($moreforfilter)) {
|
||||
}
|
||||
|
||||
$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, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields
|
||||
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||
|
||||
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
|
||||
@ -36,10 +36,10 @@ $langs->loadLangs(array("admin", "trips", "errors", "other", "dict"));
|
||||
$error = 0;
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$ikoffset = GETPOST('ikoffset', 'int');
|
||||
$coef = GETPOST('coef', 'int');
|
||||
|
||||
$fk_c_exp_tax_cat = GETPOST('fk_c_exp_tax_cat');
|
||||
$fk_range = GETPOST('fk_range', 'int');
|
||||
|
||||
@ -62,9 +62,16 @@ if ($action == 'updateik') {
|
||||
}
|
||||
}
|
||||
|
||||
$expIk->setValues($_POST);
|
||||
$result = $expIk->create($user);
|
||||
$expIk->coef = $coef;
|
||||
$expIk->ikoffset = $ikoffset;
|
||||
$expIk->fk_c_exp_tax_cat = $fk_c_exp_tax_cat;
|
||||
$expIk->fk_range = $fk_range;
|
||||
|
||||
if ($expIk->id > 0) {
|
||||
$result = $expIk->update($user);
|
||||
} else {
|
||||
$result = $expIk->create($user);
|
||||
}
|
||||
if ($result > 0) {
|
||||
setEventMessages('SetupSaved', null, 'mesgs');
|
||||
|
||||
|
||||
@ -34,13 +34,19 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_rule.class.ph
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("admin", "other", "trips", "errors", "dict"));
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('admin', 'dictionaryadmin','expensereport_rules'));
|
||||
|
||||
$object = new ExpenseReportRule($db);
|
||||
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('admin', 'dictionaryadmin','expensereport_rules'));
|
||||
|
||||
/*
|
||||
* Action
|
||||
*/
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
@ -51,7 +57,6 @@ if ($reshook < 0) {
|
||||
if (empty($reshook)) {
|
||||
//Init error
|
||||
$error = false;
|
||||
$message = false;
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$id = GETPOST('id', 'int');
|
||||
@ -59,21 +64,20 @@ if (empty($reshook)) {
|
||||
$apply_to = GETPOST('apply_to');
|
||||
$fk_user = GETPOST('fk_user', 'int');
|
||||
$fk_usergroup = GETPOST('fk_usergroup', 'int');
|
||||
|
||||
$fk_c_type_fees = GETPOST('fk_c_type_fees');
|
||||
$restrictive = GETPOST('restrictive', 'int');
|
||||
$fk_c_type_fees = GETPOST('fk_c_type_fees', 'int');
|
||||
$code_expense_rules_type = GETPOST('code_expense_rules_type');
|
||||
$dates = dol_mktime(12, 0, 0, GETPOST('startmonth'), GETPOST('startday'), GETPOST('startyear'));
|
||||
$datee = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear'));
|
||||
$amount = GETPOST('amount');
|
||||
$amount = price2num(GETPOST('amount'), 'MT', 2);
|
||||
|
||||
$object = new ExpenseReportRule($db);
|
||||
if (!empty($id)) {
|
||||
$result = $object->fetch($id);
|
||||
if ($result < 0) {
|
||||
dol_print_error('', $object->error, $object->errors);
|
||||
}
|
||||
}
|
||||
// TODO do action
|
||||
|
||||
if ($action == 'save') {
|
||||
$error = 0;
|
||||
|
||||
@ -104,8 +108,6 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
if (empty($error)) {
|
||||
$object->setValues($_POST);
|
||||
|
||||
if ($apply_to == 'U') {
|
||||
$object->fk_user = (int) $fk_user;
|
||||
$object->fk_usergroup = 0;
|
||||
@ -122,18 +124,30 @@ if (empty($reshook)) {
|
||||
|
||||
$object->dates = $dates;
|
||||
$object->datee = $datee;
|
||||
|
||||
$object->restrictive = $restrictive;
|
||||
$object->fk_c_type_fees = $fk_c_type_fees;
|
||||
$object->code_expense_rules_type = $code_expense_rules_type;
|
||||
$object->amount = $amount;
|
||||
$object->entity = $conf->entity;
|
||||
|
||||
$res = $object->create($user);
|
||||
if ($object->id > 0) {
|
||||
$res = $object->update($user);
|
||||
} else {
|
||||
$res = $object->create($user);
|
||||
}
|
||||
if ($res > 0) {
|
||||
setEventMessages($langs->trans('ExpenseReportRuleSave'), null);
|
||||
} else {
|
||||
dol_print_error($object->db);
|
||||
$error++;
|
||||
}
|
||||
|
||||
header('Location: ' . $_SERVER['PHP_SELF']);
|
||||
exit;
|
||||
if (!$error) {
|
||||
header('Location: ' . $_SERVER['PHP_SELF']);
|
||||
exit;
|
||||
} else {
|
||||
$action = '';
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'delete') {
|
||||
// TODO add confirm
|
||||
@ -207,7 +221,7 @@ if ($action != 'edit') {
|
||||
echo '<td class="linecoltyperule">' . $form->selectarray('code_expense_rules_type', $tab_rules_type, '', 0) . '</td>';
|
||||
echo '<td class="linecoldatestart">' . $form->selectDate(strtotime(date('Y-m-01', dol_now())), 'start', '', '', 0, '', 1, 0) . '</td>';
|
||||
echo '<td class="linecoldateend>' . $form->selectDate(strtotime(date('Y-m-t', dol_now())), 'end', '', '', 0, '', 1, 0) . '</td>';
|
||||
echo '<td class="linecolamount"><input type="text" value="" class="maxwidth100" name="amount" class="amount" /> ' . $conf->currency . '</td>';
|
||||
echo '<td class="linecolamount"><input type="text" value="" class="maxwidth100" name="amount" class="amount right" /></td>';
|
||||
echo '<td class="linecolrestrictive">' . $form->selectyesno('restrictive', 0, 1) . '</td>';
|
||||
echo '<td class="right linecolbutton"><input type="submit" class="button button-add" value="' . $langs->trans('Add') . '" /></td>';
|
||||
echo '</tr>';
|
||||
@ -304,10 +318,10 @@ foreach ($rules as $rule) {
|
||||
}
|
||||
echo '</td>';
|
||||
|
||||
|
||||
// Amount
|
||||
echo '<td class="linecolamount">';
|
||||
if ($action == 'edit' && $object->id == $rule->id) {
|
||||
echo '<input type="text" value="' . price2num($object->amount) . '" name="amount" class="amount" />' . $conf->currency;
|
||||
echo '<input type="text" value="' . price2num($object->amount) . '" name="amount" class="amount width50 right" />';
|
||||
} else {
|
||||
echo price($rule->amount, 0, $langs, 1, -1, -1, $conf->currency);
|
||||
}
|
||||
|
||||
@ -1621,7 +1621,7 @@ class ActionComm extends CommonObject
|
||||
$label = $langs->trans("ShowAction");
|
||||
$linkclose .= ' alt="'.dol_escape_htmltag($tooltip, 1).'"';
|
||||
}
|
||||
$linkclose .= ' title="'.dol_escape_htmltag($tooltip, 1, 0, 0, '', 1).'"';
|
||||
$linkclose .= ' title="'.dol_escape_htmltag($tooltip, 1, 0, '', 1).'"';
|
||||
$linkclose .= ' class="'.$classname.' classfortooltip"';
|
||||
/*
|
||||
$hookmanager->initHooks(array('actiondao'));
|
||||
|
||||
@ -110,7 +110,7 @@ $week = GETPOST("week", "int") ?GETPOST("week", "int") : date("W");
|
||||
$day = GETPOST("day", "int") ?GETPOST("day", "int") : date("d");
|
||||
$pid = GETPOST("search_projectid", "int", 3) ? GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3);
|
||||
$status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo'
|
||||
$type = GETPOSTISSET("search_type", 'aZ09') ? GETPOST("search_type", 'aZ09') : GETPOST("type", 'aZ09');
|
||||
$type = GETPOSTISSET("search_type") ? GETPOST("search_type", 'aZ09') : GETPOST("type", 'aZ09');
|
||||
$maxprint = GETPOSTISSET("maxprint") ? GETPOST("maxprint", 'int') : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW;
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
|
||||
|
||||
@ -634,7 +634,11 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire) {
|
||||
print $s;
|
||||
|
||||
print '</td>';
|
||||
print '<td class="right nowrap tddate">'.dol_print_date($db->jdate($objp->tms), 'day').'</td>';
|
||||
|
||||
$datem = $db->jdate($objp->tms);
|
||||
print '<td class="right nowrap tddate" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'">';
|
||||
print dol_print_date($datem, 'day', 'tzuserrel');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$i++;
|
||||
@ -725,7 +729,11 @@ if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_S
|
||||
print $s;
|
||||
|
||||
print '</td>';
|
||||
print '<td class="right tddate">'.dol_print_date($db->jdate($objp->dm), 'day').'</td>';
|
||||
|
||||
$datem = $db->jdate($objp->dm);
|
||||
print '<td class="right tddate" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'">';
|
||||
print dol_print_date($datem, 'day', 'tzuserrel');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$i++;
|
||||
@ -922,7 +930,10 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
|
||||
print '</td>';
|
||||
|
||||
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'customer', 44).'</td>';
|
||||
print '<td class="right tddate">'.dol_print_date($db->jdate($obj->dp), 'day').'</td>';
|
||||
$datem = $db->jdate($obj->dp);
|
||||
print '<td class="center tddate" title="'.dol_escape_htmltag($langs->trans("Date").': '.dol_print_date($datem, 'day', 'tzserver')).'">';
|
||||
print dol_print_date($datem, 'day', 'tzserver');
|
||||
print '</td>';
|
||||
print '<td class="right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
|
||||
print '<td align="center" width="14">'.$propalstatic->LibStatut($obj->fk_statut, 3).'</td>';
|
||||
|
||||
@ -1039,7 +1050,11 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
||||
print '</td>';
|
||||
|
||||
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'customer', 44).'</td>';
|
||||
print '<td class="right tddate">'.dol_print_date($db->jdate($obj->dv), 'day').'</td>';
|
||||
$datem = $db->jdate($obj->dv);
|
||||
print '<td class="center tddate" title="'.dol_escape_htmltag($langs->trans("DateValue").': '.dol_print_date($datem, 'day', 'tzserver')).'">';
|
||||
print dol_print_date($datem, 'day', 'tzserver');
|
||||
print '</td>';
|
||||
|
||||
print '<td class="right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
|
||||
print '<td align="center" width="14">'.$orderstatic->LibStatut($obj->fk_statut, $obj->billed, 3).'</td>';
|
||||
|
||||
|
||||
@ -765,12 +765,12 @@ if ($resql) {
|
||||
if ($socid > 0) {
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($socid);
|
||||
$title = $langs->trans('ListOfProposals').' - '.$soc->name;
|
||||
$title = $langs->trans('Proposals').' - '.$soc->name;
|
||||
if (empty($search_societe)) {
|
||||
$search_societe = $soc->name;
|
||||
}
|
||||
} else {
|
||||
$title = $langs->trans('ListOfProposals');
|
||||
$title = $langs->trans('Proposals');
|
||||
}
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
@ -1733,10 +1733,10 @@ if ($action == 'create' && $usercancreate) {
|
||||
$form->selectAvailabilityDelay($availability_id, 'availability_id', '', 1, 'maxwidth200 widthcentpercentminusx');
|
||||
print '</td></tr>';
|
||||
|
||||
// Terms of the settlement
|
||||
// Terms of payment
|
||||
print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
|
||||
print img_picto('', 'paiment', 'class="pictofixedwidth"');
|
||||
$form->select_conditions_paiements($cond_reglement_id, 'cond_reglement_id', 1, 1, 0, '', $deposit_percent);
|
||||
print img_picto('', 'payment', 'class="pictofixedwidth"');
|
||||
$form->select_conditions_paiements($cond_reglement_id, 'cond_reglement_id', 1, 1, 0, 'maxwidth200 widthcentpercentminusx', $deposit_percent);
|
||||
print '</td></tr>';
|
||||
|
||||
// Payment mode
|
||||
@ -1836,7 +1836,7 @@ if ($action == 'create' && $usercancreate) {
|
||||
print '<tr>';
|
||||
print '<td>'.$form->editfieldkey("Currency", 'multicurrency_code', '', $object, 0).'</td>';
|
||||
print '<td class="maxwidthonsmartphone">';
|
||||
print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency($currency_code, 'multicurrency_code');
|
||||
print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency($currency_code, 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -1015,12 +1015,12 @@ if ($resql) {
|
||||
if ($socid > 0) {
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($socid);
|
||||
$title = $langs->trans('ListOfOrders').' - '.$soc->name;
|
||||
$title = $langs->trans('CustomersOrders').' - '.$soc->name;
|
||||
if (empty($search_company)) {
|
||||
$search_company = $soc->name;
|
||||
}
|
||||
} else {
|
||||
$title = $langs->trans('ListOfOrders');
|
||||
$title = $langs->trans('CustomersOrders');
|
||||
}
|
||||
if (strval($search_status) == '0') {
|
||||
$title .= ' - '.$langs->trans('StatusOrderDraftShort');
|
||||
|
||||
@ -165,7 +165,7 @@ class PaymentVarious extends CommonObject
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct($db)
|
||||
public function __construct(DoliDB $db)
|
||||
{
|
||||
$this->db = $db;
|
||||
$this->element = 'payment_various';
|
||||
|
||||
@ -534,7 +534,7 @@ foreach ($accounts as $key => $type) {
|
||||
|
||||
// Ref
|
||||
if (!empty($arrayfields['b.ref']['checked'])) {
|
||||
print '<td class="nowrap">'.$objecttmp->getNomUrl(1).'</td>';
|
||||
print '<td class="nowraponall">'.$objecttmp->getNomUrl(1).'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@ -586,7 +586,7 @@ foreach ($accounts as $key => $type) {
|
||||
|
||||
// Accountancy journal
|
||||
if (!empty($arrayfields['b.fk_accountancy_journal']['checked'])) {
|
||||
print '<td>';
|
||||
print '<td class="tdoverflowmax125">';
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (empty($objecttmp->fk_accountancy_journal)) {
|
||||
print img_warning($langs->trans("Mandatory"));
|
||||
@ -606,7 +606,7 @@ foreach ($accounts as $key => $type) {
|
||||
|
||||
// Currency
|
||||
if (!empty($arrayfields['b.currency_code']['checked'])) {
|
||||
print '<td class="center">';
|
||||
print '<td class="center nowraponall">';
|
||||
print $objecttmp->currency_code;
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
@ -616,7 +616,7 @@ foreach ($accounts as $key => $type) {
|
||||
|
||||
// Transactions to reconcile
|
||||
if (!empty($arrayfields['toreconcile']['checked'])) {
|
||||
print '<td class="center">';
|
||||
print '<td class="center tdoverflowmax125">';
|
||||
|
||||
$conciliate = $objecttmp->canBeConciliated();
|
||||
if ($conciliate == -2) {
|
||||
@ -663,7 +663,7 @@ foreach ($accounts as $key => $type) {
|
||||
print $hookmanager->resPrint;
|
||||
// Date creation
|
||||
if (!empty($arrayfields['b.datec']['checked'])) {
|
||||
print '<td class="center">';
|
||||
print '<td class="center nowraponall">';
|
||||
print dol_print_date($objecttmp->date_creation, 'dayhour');
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
@ -672,7 +672,7 @@ foreach ($accounts as $key => $type) {
|
||||
}
|
||||
// Date modification
|
||||
if (!empty($arrayfields['b.tms']['checked'])) {
|
||||
print '<td class="center">';
|
||||
print '<td class="center nowraponall">';
|
||||
print dol_print_date($objecttmp->date_update, 'dayhour');
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
|
||||
@ -539,7 +539,7 @@ if ($resql) {
|
||||
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidthsearch center ');
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@ -656,7 +656,7 @@ if ($resql) {
|
||||
if ($arrayfields['account']['checked']) {
|
||||
$accountingaccount->fetch('', $obj->accountancy_code, 1);
|
||||
|
||||
print '<td>'.$accountingaccount->getNomUrl(0, 1, 1, '', 1).'</td>';
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->accountancy_code.' '.$obj->accountancy_label).'">'.$accountingaccount->getNomUrl(0, 1, 1, '', 1).'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@ -664,7 +664,7 @@ if ($resql) {
|
||||
|
||||
// Accounting subledger account
|
||||
if ($arrayfields['subledger']['checked']) {
|
||||
print '<td>'.length_accounta($obj->subledger_account).'</td>';
|
||||
print '<td class="tdoverflowmax150">'.length_accounta($obj->subledger_account).'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -121,7 +121,7 @@ class Deplacement extends CommonObject
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct($db)
|
||||
public function __construct(DoliDB $db)
|
||||
{
|
||||
$this->db = $db;
|
||||
|
||||
|
||||
@ -158,7 +158,7 @@ if ($resql) {
|
||||
print '<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.$day.'">';
|
||||
}
|
||||
print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
|
||||
$formother->select_year($year ? $year : -1, 'year', 1, 20, 5);
|
||||
print $formother->selectyear($year ? $year : -1, 'year', 1, 20, 5);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" size="10" type="text" name="search_name" value="'.$search_name.'">';
|
||||
|
||||
@ -222,7 +222,7 @@ class FactureRec extends CommonInvoice
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct($db)
|
||||
public function __construct(DoliDB $db)
|
||||
{
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
@ -428,7 +428,7 @@ class Facture extends CommonInvoice
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct($db)
|
||||
public function __construct(DoliDB $db)
|
||||
{
|
||||
$this->db = $db;
|
||||
}
|
||||
@ -1652,13 +1652,13 @@ class Facture extends CommonInvoice
|
||||
0, // date_start
|
||||
0, // date_end
|
||||
0,
|
||||
$lines[$i]->info_bits, // info_bits
|
||||
0, // info_bits
|
||||
0,
|
||||
'HT',
|
||||
0,
|
||||
0, // product_type
|
||||
1,
|
||||
$lines[$i]->special_code,
|
||||
0, // special_code
|
||||
$deposit->origin,
|
||||
0,
|
||||
0,
|
||||
@ -5503,6 +5503,7 @@ class Facture extends CommonInvoice
|
||||
$sendContent = make_substitutions($content, $substitutionarray, $outputlangs, 1);
|
||||
|
||||
// Recipient
|
||||
$to = '';
|
||||
$res = $tmpinvoice->fetch_thirdparty();
|
||||
$recipient = $tmpinvoice->thirdparty;
|
||||
if ($res > 0) {
|
||||
@ -5524,7 +5525,7 @@ class Facture extends CommonInvoice
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
if (!$error && $to) {
|
||||
// Errors Recipient
|
||||
$errors_to = $conf->global->MAIN_MAIL_ERRORS_TO;
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@ class FactureStats extends Stats
|
||||
* @param int $typentid Id typent of thirdpary for filter
|
||||
* @param int $categid Id category of thirdpary for filter
|
||||
*/
|
||||
public function __construct($db, $socid, $mode, $userid = 0, $typentid = 0, $categid = 0)
|
||||
public function __construct(DoliDB $db, $socid, $mode, $userid = 0, $typentid = 0, $categid = 0)
|
||||
{
|
||||
global $user, $conf;
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ class PaymentTerm // extends CommonObject
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct($db)
|
||||
public function __construct(DoliDB $db)
|
||||
{
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
@ -172,7 +172,7 @@ if ($resql) {
|
||||
print '<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.$day.'">';
|
||||
}
|
||||
print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
|
||||
$formother->select_year($year ? $year : -1, 'year', 1, 20, 5);
|
||||
print $formother->selectyear($year ? $year : -1, 'year', 1, 20, 5);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre">';
|
||||
$form->select_comptes($search_account, 'search_account', 0, '', 1);
|
||||
|
||||
@ -102,7 +102,7 @@ $syear = GETPOST("reyear") ?GETPOST("reyear") : date("Y", time());
|
||||
|
||||
print $formother->select_month($cmonth, 'remonth');
|
||||
|
||||
print $formother->select_year($syear, 'reyear');
|
||||
print $formother->selectyear($syear, 'reyear');
|
||||
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Create").'">';
|
||||
print '</form>';
|
||||
|
||||
@ -123,7 +123,7 @@ class ChargeSociales extends CommonObject
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct($db)
|
||||
public function __construct(DoliDB $db)
|
||||
{
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
@ -105,7 +105,7 @@ class PaymentSocialContribution extends CommonObject
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct($db)
|
||||
public function __construct(DoliDB $db)
|
||||
{
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
@ -410,7 +410,7 @@ if ($sql_select) {
|
||||
print '</td>';
|
||||
print '<td class="liste_titre nowrap center">'; // date
|
||||
print $formother->select_month($month ? $month : -1, 'month', 1, 0, 'valignmiddle');
|
||||
$formother->select_year($year ? $year : -1, 'year', 1, 20, 1);
|
||||
print $formother->selectyear($year ? $year : -1, 'year', 1, 20, 1);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre center">';
|
||||
print '</td>';
|
||||
|
||||
@ -361,7 +361,8 @@ if ($result) {
|
||||
print img_warning($langs->trans("Late"));
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
|
||||
print '<td class="tdoverflowmax150">';
|
||||
print $staticcompany->getNomUrl(1, '', 20);
|
||||
print '</td>';
|
||||
print '<td class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'">';
|
||||
@ -444,7 +445,7 @@ if ($resql) {
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<td class="tdoverflowmax125">';
|
||||
$staticcompany->id = $obj->fk_soc;
|
||||
$staticcompany->name = $obj->name;
|
||||
print $staticcompany->getNomUrl(1, '', 20);
|
||||
@ -526,7 +527,7 @@ if ($resql) {
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<td class="tdoverflowmax125">';
|
||||
$staticcompany->id = $obj->fk_soc;
|
||||
$staticcompany->name = $obj->name;
|
||||
print $staticcompany->getNomUrl(1, '', 20);
|
||||
@ -609,7 +610,7 @@ if ($resql) {
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<td class="tdoverflowmax125">';
|
||||
$staticcompany->id = $obj->fk_soc;
|
||||
$staticcompany->name = $obj->name;
|
||||
print $staticcompany->getNomUrl(1, '', 20);
|
||||
|
||||
@ -693,7 +693,7 @@ if (!empty($arrayfields['lower_planned_end_date']['checked'])) {
|
||||
print '</br>';
|
||||
print $formother->select_month($search_dfmonth, 'search_dfmonth', 1, 0);
|
||||
print ' ';
|
||||
$formother->select_year($search_dfyear, 'search_dfyear', 1, 20, 5, 0, 0, '');
|
||||
print $formother->selectyear($search_dfyear, 'search_dfyear', 1, 20, 5, 0, 0, '');
|
||||
print '</td>';
|
||||
}
|
||||
// Status
|
||||
|
||||
@ -65,6 +65,26 @@ abstract class CommonDocGenerator
|
||||
*/
|
||||
public $scandir;
|
||||
|
||||
public $page_hauteur;
|
||||
public $page_largeur;
|
||||
public $marge_gauche;
|
||||
public $marge_droite;
|
||||
public $marge_haute;
|
||||
public $marge_basse;
|
||||
|
||||
public $option_logo;
|
||||
public $option_tva;
|
||||
public $option_multilang;
|
||||
public $option_freetext;
|
||||
public $option_draft_watermark;
|
||||
|
||||
public $option_modereg;
|
||||
public $option_condreg;
|
||||
public $option_escompte;
|
||||
public $option_credit_note;
|
||||
|
||||
public $emetteur;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
||||
@ -115,6 +115,11 @@ abstract class CommonObject
|
||||
*/
|
||||
public $array_languages = null; // Value is array() when load already tried
|
||||
|
||||
/**
|
||||
* @var mixed Array of linked objects, set and used when calling ->create() to be able to create links during the creation of object
|
||||
*/
|
||||
public $linked_objects;
|
||||
|
||||
/**
|
||||
* @var int[][] Array of linked objects ids. Loaded by ->fetchObjectLinked
|
||||
*/
|
||||
@ -201,7 +206,7 @@ abstract class CommonObject
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* @var string The type of originating object ('commande', 'facture', ...)
|
||||
* @var string The type of originating object ('commande', 'facture', ...). Note: on some object this field is called $origin_type
|
||||
* @see fetch_origin()
|
||||
*/
|
||||
public $origin;
|
||||
|
||||
@ -61,6 +61,19 @@ abstract class CommonObjectLine extends CommonObject
|
||||
public $date_fin_prevue;
|
||||
public $date_fin_reel;
|
||||
|
||||
public $weight;
|
||||
public $weight_units;
|
||||
public $width;
|
||||
public $width_units;
|
||||
public $height;
|
||||
public $height_units;
|
||||
public $length;
|
||||
public $length_units;
|
||||
public $surface;
|
||||
public $surface_units;
|
||||
public $volume;
|
||||
public $volume_units;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
||||
@ -1,413 +0,0 @@
|
||||
<?php
|
||||
/* EXPERIMENTAL
|
||||
*
|
||||
* Copyright (C) 2016 ATM Consulting <support@atm-consulting.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/class/coreobject.class.php
|
||||
* \ingroup core
|
||||
* \brief File of class to manage all object. Might be replace or merge into commonobject
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
||||
|
||||
// TODO Remove this class (used in Expensereportik and ExpenseReportRule
|
||||
/**
|
||||
* CoreObject
|
||||
*/
|
||||
class CoreObject extends CommonObject
|
||||
{
|
||||
public $withChild = true;
|
||||
|
||||
/**
|
||||
* @var Array $_fields Fields to synchronize with Database
|
||||
*/
|
||||
protected $fields = array();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct(DoliDB &$db)
|
||||
{
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to init fields
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function init()
|
||||
{
|
||||
$this->id = 0;
|
||||
$this->datec = 0;
|
||||
$this->tms = 0;
|
||||
|
||||
if (!empty($this->fields)) {
|
||||
foreach ($this->fields as $field => $info) {
|
||||
if ($this->isDate($info)) {
|
||||
$this->{$field} = time();
|
||||
} elseif ($this->isArray($info)) {
|
||||
$this->{$field} = array();
|
||||
} elseif ($this->isInt($info)) {
|
||||
$this->{$field} = (int) 0;
|
||||
} elseif ($this->isFloat($info)) {
|
||||
$this->{$field} = (double) 0;
|
||||
} else {
|
||||
$this->{$field} = '';
|
||||
}
|
||||
}
|
||||
|
||||
$this->to_delete = false;
|
||||
$this->is_clone = false;
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test type of field
|
||||
*
|
||||
* @param string $field name of field
|
||||
* @param string $type type of field to test
|
||||
* @return boolean value of field or false
|
||||
*/
|
||||
private function checkFieldType($field, $type)
|
||||
{
|
||||
if (isset($this->fields[$field]) && method_exists($this, 'is_'.$type)) {
|
||||
return $this->{'is_'.$type}($this->fields[$field]);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get object and children from database
|
||||
*
|
||||
* @param int $id Id of object to load
|
||||
* @param bool $loadChild used to load children from database
|
||||
* @return int >0 if OK, <0 if KO, 0 if not found
|
||||
*/
|
||||
public function fetch($id, $loadChild = true)
|
||||
{
|
||||
$res = $this->fetchCommon($id);
|
||||
if ($res > 0) {
|
||||
if ($loadChild) {
|
||||
$this->fetchChild();
|
||||
}
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function to instantiate a new child
|
||||
*
|
||||
* @param string $tabName Table name of child
|
||||
* @param int $id If id is given, we try to return his key if exist or load if we try_to_load
|
||||
* @param string $key Attribute name of the object id
|
||||
* @param bool $try_to_load Force the fetch if an id is given
|
||||
* @return int
|
||||
*/
|
||||
public function addChild($tabName, $id = 0, $key = 'id', $try_to_load = false)
|
||||
{
|
||||
if (!empty($id)) {
|
||||
foreach ($this->{$tabName} as $k => &$object) {
|
||||
if ($object->{$key} === $id) {
|
||||
return $k;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$k = count($this->{$tabName});
|
||||
|
||||
$className = ucfirst($tabName);
|
||||
$this->{$tabName}[$k] = new $className($this->db);
|
||||
if ($id > 0 && $key === 'id' && $try_to_load) {
|
||||
$this->{$tabName}[$k]->fetch($id);
|
||||
}
|
||||
|
||||
return $k;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function to set a child as to delete
|
||||
*
|
||||
* @param string $tabName Table name of child
|
||||
* @param int $id Id of child to set as to delete
|
||||
* @param string $key Attribute name of the object id
|
||||
* @return bool
|
||||
*/
|
||||
public function removeChild($tabName, $id, $key = 'id')
|
||||
{
|
||||
foreach ($this->{$tabName} as &$object) {
|
||||
if ($object->{$key} == $id) {
|
||||
$object->to_delete = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function to fetch children objects
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function fetchChild()
|
||||
{
|
||||
if ($this->withChild && !empty($this->childtables) && !empty($this->fk_element)) {
|
||||
foreach ($this->childtables as &$childTable) {
|
||||
$className = ucfirst($childTable);
|
||||
|
||||
$this->{$className} = array();
|
||||
|
||||
$sql = "SELECT rowid FROM ".$this->db->prefix().$childTable." WHERE ".$this->fk_element." = ".((int) $this->id);
|
||||
$res = $this->db->query($sql);
|
||||
|
||||
if ($res) {
|
||||
while ($obj = $this->db->fetch_object($res)) {
|
||||
$o = new $className($this->db);
|
||||
$o->fetch($obj->rowid);
|
||||
|
||||
$this->{$className}[] = $o;
|
||||
}
|
||||
} else {
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to update children data
|
||||
*
|
||||
* @param User $user user object
|
||||
* @return void
|
||||
*/
|
||||
public function saveChild(User &$user)
|
||||
{
|
||||
if ($this->withChild && !empty($this->childtables) && !empty($this->fk_element)) {
|
||||
foreach ($this->childtables as &$childTable) {
|
||||
$className = ucfirst($childTable);
|
||||
if (!empty($this->{$className})) {
|
||||
foreach ($this->{$className} as $i => &$object) {
|
||||
$object->{$this->fk_element} = $this->id;
|
||||
|
||||
$object->update($user);
|
||||
if ($this->unsetChildDeleted && isset($object->to_delete) && $object->to_delete == true) {
|
||||
unset($this->{$className}[$i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function to update object or create or delete if needed
|
||||
*
|
||||
* @param User $user User object
|
||||
* @return int < 0 if KO, > 0 if OK
|
||||
*/
|
||||
public function update(User &$user)
|
||||
{
|
||||
if (empty($this->id)) {
|
||||
return $this->create($user); // To test, with that, no need to test on high level object, the core decide it, update just needed
|
||||
} elseif (isset($this->to_delete) && $this->to_delete == true) {
|
||||
return $this->delete($user);
|
||||
}
|
||||
|
||||
$error = 0;
|
||||
$this->db->begin();
|
||||
|
||||
$res = $this->updateCommon($user);
|
||||
if ($res) {
|
||||
$result = $this->call_trigger(strtoupper($this->element).'_MODIFY', $user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
} else {
|
||||
$this->saveChild($user);
|
||||
}
|
||||
} else {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->error;
|
||||
}
|
||||
|
||||
if (empty($error)) {
|
||||
$this->db->commit();
|
||||
return $this->id;
|
||||
} else {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to create object in database
|
||||
*
|
||||
* @param User $user User object
|
||||
* @return int < 0 if KO, > 0 if OK
|
||||
*/
|
||||
public function create(User $user)
|
||||
{
|
||||
if ($this->id > 0) {
|
||||
return $this->update($user);
|
||||
}
|
||||
|
||||
$error = 0;
|
||||
$this->db->begin();
|
||||
|
||||
$res = $this->createCommon($user);
|
||||
if ($res) {
|
||||
$this->id = $this->db->last_insert_id($this->table_element);
|
||||
|
||||
$result = $this->call_trigger(strtoupper($this->element).'_CREATE', $user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
} else {
|
||||
$this->saveChild($user);
|
||||
}
|
||||
} else {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->error;
|
||||
}
|
||||
|
||||
if (empty($error)) {
|
||||
$this->db->commit();
|
||||
return $this->id;
|
||||
} else {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to delete object in database
|
||||
*
|
||||
* @param User $user user object
|
||||
* @return int < 0 if KO, > 0 if OK
|
||||
*/
|
||||
public function delete(User &$user)
|
||||
{
|
||||
if ($this->id <= 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
$error = 0;
|
||||
$this->db->begin();
|
||||
|
||||
$result = $this->call_trigger(strtoupper($this->element).'_DELETE', $user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$this->deleteCommon($user);
|
||||
if ($this->withChild && !empty($this->childtables)) {
|
||||
foreach ($this->childtables as &$childTable) {
|
||||
$className = ucfirst($childTable);
|
||||
if (!empty($this->{$className})) {
|
||||
foreach ($this->{$className} as &$object) {
|
||||
$object->delete($user);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($error)) {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
} else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->error;
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function to get a formatted date
|
||||
*
|
||||
* @param string $field Attribute to return
|
||||
* @param string $format Output date format
|
||||
* @return string
|
||||
*/
|
||||
public function getDate($field, $format = '')
|
||||
{
|
||||
if (empty($this->{$field})) {
|
||||
return '';
|
||||
} else {
|
||||
return dol_print_date($this->{$field}, $format);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to set date in field
|
||||
*
|
||||
* @param string $field field to set
|
||||
* @param string $date formatted date to convert
|
||||
* @return mixed
|
||||
*/
|
||||
public function setDate($field, $date)
|
||||
{
|
||||
if (empty($date)) {
|
||||
$this->{$field} = 0;
|
||||
} else {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
$this->{$field} = dol_stringtotime($date);
|
||||
}
|
||||
|
||||
return $this->{$field};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function to update current object
|
||||
*
|
||||
* @param array $Tab Array of values
|
||||
* @return int
|
||||
*/
|
||||
public function setValues(&$Tab)
|
||||
{
|
||||
foreach ($Tab as $key => $value) {
|
||||
if ($this->checkFieldType($key, 'date')) {
|
||||
$this->setDate($key, $value);
|
||||
} elseif ($this->checkFieldType($key, 'float')) {
|
||||
$this->{$key} = (double) price2num($value);
|
||||
} elseif ($this->checkFieldType($key, 'int')) {
|
||||
$this->{$key} = (int) price2num($value);
|
||||
} else {
|
||||
$this->{$key} = dol_string_nohtmltag($value);
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -466,6 +466,8 @@ class Form
|
||||
$ext_element = false;
|
||||
$button_only = false;
|
||||
$inputOption = '';
|
||||
$rows = '';
|
||||
$cols = '';
|
||||
|
||||
if (is_object($object)) {
|
||||
$element = $object->element;
|
||||
@ -1001,9 +1003,10 @@ class Form
|
||||
* @param string $htmloption Options html on select object
|
||||
* @param int $forcecombo Force to load all values and output a standard combobox (with no beautification)
|
||||
* @param array $events Event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
|
||||
* @param array $disableautocomplete Disable autocomplete
|
||||
* @return string HTML string with select and input
|
||||
*/
|
||||
public function select_incoterms($selected = '', $location_incoterms = '', $page = '', $htmlname = 'incoterm_id', $htmloption = '', $forcecombo = 1, $events = array())
|
||||
public function select_incoterms($selected = '', $location_incoterms = '', $page = '', $htmlname = 'incoterm_id', $htmloption = '', $forcecombo = 1, $events = array(), $disableautocomplete = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
@ -1038,8 +1041,6 @@ class Form
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
if ($num) {
|
||||
$foundselected = false;
|
||||
|
||||
while ($i < $num) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$incotermArray[$i]['rowid'] = $obj->rowid;
|
||||
@ -1901,6 +1902,7 @@ class Form
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $user, $langs, $hookmanager;
|
||||
global $action;
|
||||
|
||||
// If no preselected user defined, we take current user
|
||||
if ((is_numeric($selected) && ($selected < -2 || empty($selected))) && empty($conf->global->SOCIETE_DISABLE_DEFAULT_SALESREPRESENTATIVE)) {
|
||||
@ -2414,6 +2416,7 @@ class Form
|
||||
|
||||
if (!$forcecombo) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
|
||||
$events = array();
|
||||
$out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT"));
|
||||
}
|
||||
|
||||
@ -4192,6 +4195,7 @@ class Form
|
||||
}
|
||||
}
|
||||
$out .= '>';
|
||||
$value = '';
|
||||
if ($format == 0) {
|
||||
$value = ($maxlength ?dol_trunc($arraytypes['label'], $maxlength) : $arraytypes['label']);
|
||||
} elseif ($format == 1) {
|
||||
@ -5883,14 +5887,16 @@ class Form
|
||||
/**
|
||||
* Return array of currencies in user language
|
||||
*
|
||||
* @param string $selected preselected currency code
|
||||
* @param string $htmlname name of HTML select list
|
||||
* @param integer $useempty 1=Add empty line
|
||||
* @param string $filter Optional filters criteras (example: 'code <> x', ' in (1,3)')
|
||||
* @param bool $excludeConfCurrency false = If company current currency not in table, we add it into list. Should always be available. true = we are in currency_rate update , we don't want to see conf->currency in select
|
||||
* @param string $selected Preselected currency code
|
||||
* @param string $htmlname Name of HTML select list
|
||||
* @param integer $useempty 1=Add empty line
|
||||
* @param string $filter Optional filters criteras (example: 'code <> x', ' in (1,3)')
|
||||
* @param bool $excludeConfCurrency false = If company current currency not in table, we add it into list. Should always be available.
|
||||
* true = we are in currency_rate update , we don't want to see conf->currency in select
|
||||
* @param string $morecss More css
|
||||
* @return string
|
||||
*/
|
||||
public function selectMultiCurrency($selected = '', $htmlname = 'multicurrency_code', $useempty = 0, $filter = '', $excludeConfCurrency = false)
|
||||
public function selectMultiCurrency($selected = '', $htmlname = 'multicurrency_code', $useempty = 0, $filter = '', $excludeConfCurrency = false, $morecss = '')
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
@ -5911,7 +5917,7 @@ class Form
|
||||
}
|
||||
|
||||
$out = '';
|
||||
$out .= '<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">';
|
||||
$out .= '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
|
||||
if ($useempty) {
|
||||
$out .= '<option value=""> </option>';
|
||||
}
|
||||
@ -6331,6 +6337,9 @@ class Form
|
||||
|
||||
// Analysis of the pre-selection date
|
||||
$reg = array();
|
||||
$shour = '';
|
||||
$smin = '';
|
||||
$ssec = '';
|
||||
if (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+)\s?([0-9]+)?:?([0-9]+)?/', $set_time, $reg)) { // deprecated usage
|
||||
// Date format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS'
|
||||
$syear = (!empty($reg[1]) ? $reg[1] : '');
|
||||
@ -6347,10 +6356,6 @@ class Form
|
||||
$shour = dol_print_date($set_time, "%H", $gm);
|
||||
$smin = dol_print_date($set_time, "%M", $gm);
|
||||
$ssec = dol_print_date($set_time, "%S", $gm);
|
||||
} else {
|
||||
$shour = '';
|
||||
$smin = '';
|
||||
$ssec = '';
|
||||
}
|
||||
} else {
|
||||
// Date est '' ou vaut -1
|
||||
@ -6876,6 +6881,7 @@ class Form
|
||||
unset($tickettmpselect);
|
||||
}
|
||||
|
||||
$urloption = '';
|
||||
$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions);
|
||||
|
||||
if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel").' : ';
|
||||
@ -7018,16 +7024,11 @@ class Form
|
||||
protected function constructTicketListOption(&$objp, &$opt, &$optJson, $selected, $filterkey = '')
|
||||
{
|
||||
$outkey = '';
|
||||
$outval = '';
|
||||
$outref = '';
|
||||
$outlabel = '';
|
||||
$outtype = '';
|
||||
|
||||
$label = $objp->label;
|
||||
|
||||
$outkey = $objp->rowid;
|
||||
$outref = $objp->ref;
|
||||
$outlabel = $objp->label;
|
||||
$outtype = $objp->fk_product_type;
|
||||
|
||||
$opt = '<option value="'.$objp->rowid.'"';
|
||||
@ -7036,10 +7037,9 @@ class Form
|
||||
$opt .= $objp->ref;
|
||||
$objRef = $objp->ref;
|
||||
if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
|
||||
$outval .= $objRef;
|
||||
|
||||
$opt .= "</option>\n";
|
||||
$optJson = array('key'=>$outkey, 'value'=>$outref, 'type'=>$outtypem);
|
||||
$optJson = array('key'=>$outkey, 'value'=>$outref, 'type'=>$outtype);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -7619,7 +7619,7 @@ class Form
|
||||
if (!empty($objecttmp->fields)) { // For object that declare it, it is better to use declared fields (like societe, contact, ...)
|
||||
$tmpfieldstoshow = '';
|
||||
foreach ($objecttmp->fields as $key => $val) {
|
||||
if (!dol_eval($val['enabled'], 1, 1, 1, '1')) {
|
||||
if (!dol_eval($val['enabled'], 1, 1, '1')) {
|
||||
continue;
|
||||
}
|
||||
if (!empty($val['showoncombobox'])) {
|
||||
@ -7646,6 +7646,7 @@ class Form
|
||||
|
||||
$out = '';
|
||||
$outarray = array();
|
||||
$tmparray = array();
|
||||
|
||||
$num = 0;
|
||||
|
||||
@ -8284,7 +8285,7 @@ class Form
|
||||
* @param string $htmlname Name of HTML field
|
||||
* @param array $array Array with array of fields we could show. This array may be modified according to setup of user.
|
||||
* @param string $varpage Id of context for page. Can be set by caller with $varpage=(empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage);
|
||||
* @param string $pos position colon on liste value left or right
|
||||
* @param string $pos Position colon on liste value 'left' or '' (meaning 'right').
|
||||
* @return string HTML multiselect string
|
||||
* @see selectarray()
|
||||
*/
|
||||
@ -9351,10 +9352,12 @@ class Form
|
||||
global $conf, $user, $langs;
|
||||
|
||||
// Permettre l'exclusion de groupes
|
||||
$excludeGroups = null;
|
||||
if (is_array($exclude)) {
|
||||
$excludeGroups = implode(",", $exclude);
|
||||
}
|
||||
// Permettre l'inclusion de groupes
|
||||
$includeGroups = null;
|
||||
if (is_array($include)) {
|
||||
$includeGroups = implode(",", $include);
|
||||
}
|
||||
@ -9918,7 +9921,7 @@ class Form
|
||||
//if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled
|
||||
$out .= '>' . $labeltoshow . '</option>';
|
||||
} else {
|
||||
if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
|
||||
if ($disabled && ($selected != $obj->rowid)) {
|
||||
$resultat = '';
|
||||
} else {
|
||||
$resultat = '<option value="' . $obj->rowid . '"';
|
||||
|
||||
@ -73,6 +73,7 @@ class FormTicket
|
||||
public $ispublic; // To show information or not into public form
|
||||
|
||||
public $withtitletopic;
|
||||
public $withtopicreadonly;
|
||||
public $withcompany; // affiche liste déroulante company
|
||||
public $withfromsocid;
|
||||
public $withfromcontactid;
|
||||
@ -84,6 +85,11 @@ class FormTicket
|
||||
|
||||
public $withcancel;
|
||||
|
||||
public $type_code;
|
||||
public $category_code;
|
||||
public $severity_code;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @var array $substit Substitutions
|
||||
@ -113,7 +119,7 @@ class FormTicket
|
||||
$this->withcompany = $conf->societe->enabled ? 1 : 0;
|
||||
$this->withfromsocid = 0;
|
||||
$this->withfromcontactid = 0;
|
||||
//$this->withthreadid=0;
|
||||
//$this->withreadid=0;
|
||||
//$this->withtitletopic='';
|
||||
$this->withnotifytiersatcreate = 0;
|
||||
$this->withusercreate = 1;
|
||||
@ -280,6 +286,7 @@ class FormTicket
|
||||
}
|
||||
|
||||
// If ticket created from another object
|
||||
$subelement = '';
|
||||
if (isset($this->param['origin']) && $this->param['originid'] > 0) {
|
||||
// Parse element/subelement (ex: project_task)
|
||||
$element = $subelement = $this->param['origin'];
|
||||
@ -331,8 +338,8 @@ class FormTicket
|
||||
print $langs->trans('SubjectAnswerToTicket').' '.$this->topic_title;
|
||||
print '</td></tr>';
|
||||
} else {
|
||||
if ($this->withthreadid > 0) {
|
||||
$subject = $langs->trans('SubjectAnswerToTicket').' '.$this->withthreadid.' : '.$this->topic_title.'';
|
||||
if ($this->withreadid > 0) {
|
||||
$subject = $langs->trans('SubjectAnswerToTicket').' '.$this->withreadid.' : '.$this->topic_title.'';
|
||||
}
|
||||
print '<input class="text minwidth500" id="subject" name="subject" value="'.(GETPOST('subject', 'alpha') ? GETPOST('subject', 'alpha') : $subject).'" autofocus />';
|
||||
print '</td></tr>';
|
||||
@ -628,11 +635,11 @@ class FormTicket
|
||||
|
||||
print '<br>';
|
||||
|
||||
print $form->buttonsSaveCancel((($this->withthreadid > 0) ? "SendResponse" : "CreateTicket"), ($this->withcancel ? "Cancel" : ""));
|
||||
print $form->buttonsSaveCancel((($this->withreadid > 0) ? "SendResponse" : "CreateTicket"), ($this->withcancel ? "Cancel" : ""));
|
||||
|
||||
/*
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="add" value="'.$langs->trans(($this->withthreadid > 0 ? "SendResponse" : "CreateTicket")).'" />';
|
||||
print '<input type="submit" class="button" name="add" value="'.$langs->trans(($this->withreadid > 0 ? "SendResponse" : "CreateTicket")).'" />';
|
||||
if ($this->withcancel) {
|
||||
print " ";
|
||||
print '<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
@ -1365,6 +1372,9 @@ class FormTicket
|
||||
|
||||
// External users can't send message email
|
||||
if ($user->rights->ticket->write && !$user->socid) {
|
||||
$ticketstat = new Ticket($this->db);
|
||||
$res = $ticketstat->fetch('', '', $this->track_id);
|
||||
|
||||
print '<tr><td></td><td>';
|
||||
$checkbox_selected = (GETPOST('send_email') == "1" ? ' checked' : ($conf->global->TICKETS_MESSAGE_FORCE_MAIL?'checked':''));
|
||||
print '<input type="checkbox" name="send_email" value="1" id="send_msg_email" '.$checkbox_selected.'/> ';
|
||||
@ -1395,18 +1405,18 @@ class FormTicket
|
||||
|
||||
// Subject
|
||||
print '<tr class="email_line"><td>'.$langs->trans('Subject').'</td>';
|
||||
print '<td><input type="text" class="text minwidth500" name="subject" value="['.$conf->global->MAIN_INFO_SOCIETE_NOM.' - '.$langs->trans("Ticket").' '.$this->ref.'] '.$langs->trans('TicketNewMessage').'" />';
|
||||
print '<td><input type="text" class="text minwidth500" name="subject" value="['.$conf->global->MAIN_INFO_SOCIETE_NOM.' - '.$langs->trans("Ticket").' '.$ticketstat->ref.'] '.$langs->trans('TicketNewMessage').'" />';
|
||||
print '</td></tr>';
|
||||
|
||||
// Destinataires
|
||||
print '<tr class="email_line"><td>'.$langs->trans('MailRecipients').'</td><td>';
|
||||
$ticketstat = new Ticket($this->db);
|
||||
$res = $ticketstat->fetch('', '', $this->track_id);
|
||||
if ($res) {
|
||||
// Retrieve email of all contacts (internal and external)
|
||||
$contacts = $ticketstat->getInfosTicketInternalContact();
|
||||
$contacts = array_merge($contacts, $ticketstat->getInfosTicketExternalContact());
|
||||
|
||||
$sendto = array();
|
||||
|
||||
// Build array to display recipient list
|
||||
if (is_array($contacts) && count($contacts) > 0) {
|
||||
foreach ($contacts as $key => $info_sendto) {
|
||||
@ -1416,7 +1426,7 @@ class FormTicket
|
||||
}
|
||||
}
|
||||
|
||||
if ($ticketstat->origin_email && !in_array($this->dao->origin_email, $sendto)) {
|
||||
if ($ticketstat->origin_email && !in_array($ticketstat->origin_email, $sendto)) {
|
||||
$sendto[] = dol_escape_htmltag($ticketstat->origin_email).' <small class="opacitymedium">('.$langs->trans("TicketEmailOriginIssuer").")</small>";
|
||||
}
|
||||
|
||||
|
||||
@ -342,7 +342,7 @@ class Utils
|
||||
|
||||
$handle = '';
|
||||
|
||||
$lowmemorydump = GETPOSTISSET("lowmemorydump", "alpha") ? GETPOST("lowmemorydump") : getDolGlobalString('MAIN_LOW_MEMORY_DUMP');
|
||||
$lowmemorydump = GETPOSTISSET("lowmemorydump") ? GETPOST("lowmemorydump") : getDolGlobalString('MAIN_LOW_MEMORY_DUMP');
|
||||
|
||||
// Start call method to execute dump
|
||||
$fullcommandcrypted = $command." ".$paramcrypted." 2>&1";
|
||||
|
||||
@ -465,7 +465,7 @@ print '</div>';
|
||||
$count = 0;
|
||||
print '<div class="divadvancedsearchfield">';
|
||||
print '<div class="inline-block opacitymedium"><span class="fas fa-ruler-horizontal paddingright pictofixedwidth" title="'.dol_escape_htmltag($langs->trans("GroupBy")).'"></span></div>';
|
||||
print $formother->selectGroupByField($object, $search_groupby, $arrayofgroupby, 'minwidth200 maxwidth250', $langs->trans("GroupBy")); // Fill the array $arrayofgroupby with possible fields
|
||||
print $formother->selectGroupByField($object, $search_groupby, $arrayofgroupby, 'minwidth250 maxwidth300', $langs->trans("GroupBy")); // Fill the array $arrayofgroupby with possible fields
|
||||
print '</div>';
|
||||
|
||||
|
||||
|
||||
@ -1026,7 +1026,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
*
|
||||
* @param string $table Name of table
|
||||
* @param string $field Optionnel : Name of field if we want description of field
|
||||
* @return SQLite3Result Resource
|
||||
* @return bool|SQLite3Result Resource
|
||||
*/
|
||||
public function DDLDescTable($table, $field = "")
|
||||
{
|
||||
|
||||
@ -1628,7 +1628,7 @@ function dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $di
|
||||
close: function (event, ui) {
|
||||
returnedid = jQuery("#varforreturndialogid'.$name.'").text();
|
||||
returnedlabel = jQuery("#varforreturndialoglabel'.$name.'").text();
|
||||
console.log("popup has been closed. returnedid="+returnedid+" returnedlabel="+returnedlabel);
|
||||
console.log("popup has been closed. returnedid (js var defined into parent page)="+returnedid+" returnedlabel="+returnedlabel);
|
||||
if (returnedid != "" && returnedid != "div for returned id") {
|
||||
jQuery("#'.(empty($backtopagejsfieldsid)?"none":$backtopagejsfieldsid).'").val(returnedid);
|
||||
}
|
||||
@ -1772,7 +1772,7 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
|
||||
$out .= '<div class="tab tab'.($isactive?'active':'unactive').'" style="margin: 0 !important">';
|
||||
if (!empty($links[$i][0])) {
|
||||
$titletoshow = preg_replace('/<.*$/', '', $links[$i][1]);
|
||||
$out .= '<a'.(!empty($links[$i][2]) ? ' id="'.$links[$i][2].'"' : '').' class="tab inline-block'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'" title="'.dol_escape_htmltag($titletoshow).'">';
|
||||
$out .= '<a'.(!empty($links[$i][2]) ? ' id="'.$links[$i][2].'"' : '').' class="tab inline-block valignmiddle'.($morecss ? ' '.$morecss : '').'" href="'.$links[$i][0].'" title="'.dol_escape_htmltag($titletoshow).'">';
|
||||
}
|
||||
$out .= $links[$i][1];
|
||||
if (!empty($links[$i][0])) {
|
||||
@ -1820,7 +1820,7 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
|
||||
if (empty($tabsname)) {
|
||||
$tabsname = str_replace("@", "", $picto);
|
||||
}
|
||||
$out .= '<div id="moretabs'.$tabsname.'" class="inline-block tabsElem">';
|
||||
$out .= '<div id="moretabs'.$tabsname.'" class="inline-block tabsElem valignmiddle">';
|
||||
$out .= '<div class="tab"><a href="#" class="tab moretab inline-block tabunactive"><span class="hideonsmartphone">'.$langs->trans("More").'</span>... ('.$nbintab.')</a></div>'; // Do not use "reposition" class in the "More".
|
||||
$out .= '<div id="moretabsList'.$tabsname.'" style="width: '.$widthofpopup.'px; position: absolute; '.$left.': -999em; text-align: '.$left.'; margin:0px; padding:2px; z-index:10;">';
|
||||
$out .= $outmore;
|
||||
|
||||
@ -63,6 +63,14 @@ class CommActionRapport
|
||||
|
||||
public $marge_basse;
|
||||
|
||||
public $format;
|
||||
|
||||
public $type;
|
||||
|
||||
public $page_hauteur;
|
||||
|
||||
public $page_largeur;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
||||
@ -89,7 +89,6 @@ class doc_generic_asset_odt extends ModelePDFAsset
|
||||
$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_modereg = 0; // Display payment mode
|
||||
$this->option_condreg = 0; // Display payment terms
|
||||
$this->option_codeproduitservice = 0; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
|
||||
@ -74,7 +74,6 @@ class pdf_ban extends ModeleBankAccountDoc
|
||||
|
||||
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_codeproduitservice = 1; // Display product-service code
|
||||
|
||||
// Retrieves transmitter
|
||||
$this->emetteur = $mysoc;
|
||||
|
||||
@ -79,7 +79,6 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
||||
|
||||
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_codeproduitservice = 1; //Display product-service code
|
||||
|
||||
// Retrieves transmitter
|
||||
$this->emetteur = $mysoc;
|
||||
|
||||
@ -90,7 +90,6 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
||||
$this->option_tva = 0; // Manage the vat option COMMANDE_TVAOPTION
|
||||
$this->option_modereg = 0; // Display payment mode
|
||||
$this->option_condreg = 0; // Display payment terms
|
||||
$this->option_codeproduitservice = 0; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
|
||||
@ -158,7 +158,6 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_modereg = 1; // Display payment mode
|
||||
$this->option_condreg = 1; // Display payment terms
|
||||
$this->option_codeproduitservice = 1; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
|
||||
@ -163,7 +163,6 @@ class pdf_eratosthene extends ModelePDFCommandes
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_modereg = 1; // Display payment mode
|
||||
$this->option_condreg = 1; // Display payment terms
|
||||
$this->option_codeproduitservice = 1; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
|
||||
@ -88,7 +88,6 @@ class doc_generic_contract_odt extends ModelePDFContract
|
||||
$this->option_tva = 0; // Manage the vat CONTRACT_TVAOPTION
|
||||
$this->option_modereg = 0; // Display payment mode
|
||||
$this->option_condreg = 0; // Display payment terms
|
||||
$this->option_codeproduitservice = 0; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
|
||||
@ -154,7 +154,6 @@ class pdf_strato extends ModelePDFContract
|
||||
$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_modereg = 0; // Display payment mode
|
||||
$this->option_condreg = 0; // Display payment terms
|
||||
$this->option_codeproduitservice = 0; // Display product-service code
|
||||
$this->option_multilang = 0; // Available in several languages
|
||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||
|
||||
|
||||
@ -147,7 +147,6 @@ class pdf_storm extends ModelePDFDeliveryOrder
|
||||
|
||||
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_codeproduitservice = 1; // Display product-service code
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
|
||||
@ -146,7 +146,6 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
|
||||
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_codeproduitservice = 1; // Display product-service code
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
|
||||
@ -90,7 +90,6 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
||||
$this->option_tva = 0; // Manage the vat option EXPEDITION_TVAOPTION
|
||||
$this->option_modereg = 0; // Display payment mode
|
||||
$this->option_condreg = 0; // Display payment terms
|
||||
$this->option_codeproduitservice = 0; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
|
||||
@ -120,7 +120,7 @@ class pdf_espadon extends ModelePdfExpedition
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct($db = 0)
|
||||
public function __construct(DoliDB $db)
|
||||
{
|
||||
global $conf, $langs, $mysoc;
|
||||
|
||||
@ -642,7 +642,7 @@ class pdf_espadon extends ModelePdfExpedition
|
||||
|
||||
|
||||
if ($this->getColumnStatus('weight')) {
|
||||
$this->printStdColumnContent($pdf, $curY, 'weight', $weighttxt.(($weighttxt && $voltxt) ? '<br>' : '').$voltxt, array('html'=>1));
|
||||
$this->printStdColumnContent($pdf, $curY, 'weight', $weighttxt.(($weighttxt && $voltxt) ? '<br>' : '').$voltxt);
|
||||
$nexY = max($pdf->GetY(), $nexY);
|
||||
}
|
||||
|
||||
|
||||
@ -121,7 +121,7 @@ class pdf_merou extends ModelePdfExpedition
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct($db = 0)
|
||||
public function __construct(DoliDB $db)
|
||||
{
|
||||
global $conf, $langs, $mysoc;
|
||||
|
||||
@ -584,7 +584,7 @@ class pdf_merou extends ModelePdfExpedition
|
||||
$origin_id = $object->origin_id;
|
||||
|
||||
// Add list of linked elements
|
||||
$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size - 1, $hookmanager);
|
||||
$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size - 1);
|
||||
|
||||
//$this->Code39($Xoff+43, $Yoff+1, $object->commande->ref,$ext = true, $cks = false, $w = 0.4, $h = 4, $wide = true);
|
||||
//Definition Location of the Company block
|
||||
|
||||
@ -121,7 +121,7 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct($db = 0)
|
||||
public function __construct(DoliDB $db)
|
||||
{
|
||||
global $conf, $langs, $mysoc;
|
||||
|
||||
|
||||
@ -122,6 +122,14 @@ class pdf_standard extends ModeleExpenseReport
|
||||
*/
|
||||
public $emetteur;
|
||||
|
||||
public $posxpiece;
|
||||
public $posxcomment;
|
||||
public $posxtva;
|
||||
public $posxup;
|
||||
public $posxqty;
|
||||
public $postotalht;
|
||||
public $postotalttc;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -155,7 +163,6 @@ class pdf_standard extends ModeleExpenseReport
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_modereg = 1; // Display payment mode
|
||||
$this->option_condreg = 1; // Display payment terms
|
||||
$this->option_codeproduitservice = 1; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
|
||||
@ -89,7 +89,6 @@ class doc_generic_invoice_odt extends ModelePDFFactures
|
||||
$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_modereg = 0; // Display payment mode
|
||||
$this->option_condreg = 0; // Display payment terms
|
||||
$this->option_codeproduitservice = 0; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
|
||||
@ -164,7 +164,6 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_modereg = 1; // Display payment mode
|
||||
$this->option_condreg = 1; // Display payment terms
|
||||
$this->option_codeproduitservice = 1; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 1; // Displays if there has been a discount
|
||||
$this->option_credit_note = 1; // Support credit notes
|
||||
@ -874,12 +873,12 @@ class pdf_crabe extends ModelePDFFactures
|
||||
/**
|
||||
* Show payments table
|
||||
*
|
||||
* @param TCPDF $pdf Object PDF
|
||||
* @param Facture $object Object invoice
|
||||
* @param int $posy Position y in PDF
|
||||
* @param Translate $outputlangs Object langs for output
|
||||
* @param int $heightforfooter height for footer
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param TCPDF $pdf Object PDF
|
||||
* @param Facture $object Object invoice
|
||||
* @param int $posy Position y in PDF
|
||||
* @param Translate $outputlangs Object langs for output
|
||||
* @param int $heightforfooter Height for footer
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs, $heightforfooter = 0)
|
||||
{
|
||||
|
||||
@ -165,7 +165,6 @@ class pdf_sponge extends ModelePDFFactures
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_modereg = 1; // Display payment mode
|
||||
$this->option_condreg = 1; // Display payment terms
|
||||
$this->option_codeproduitservice = 1; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 1; // Displays if there has been a discount
|
||||
$this->option_credit_note = 1; // Support credit notes
|
||||
|
||||
@ -146,7 +146,6 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_modereg = 0; // Display payment mode
|
||||
$this->option_condreg = 0; // Display payment terms
|
||||
$this->option_codeproduitservice = 0; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
||||
|
||||
|
||||
@ -85,7 +85,6 @@ class doc_generic_member_odt extends ModelePDFMember
|
||||
$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_modereg = 0; // Display payment mode
|
||||
$this->option_condreg = 0; // Display payment terms
|
||||
$this->option_codeproduitservice = 0; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
|
||||
@ -110,6 +110,19 @@ class pdf_standard extends ModelePDFMovement
|
||||
public $emetteur;
|
||||
|
||||
|
||||
public $wref;
|
||||
public $posxidref;
|
||||
public $posxdatemouv;
|
||||
public $posxdesc;
|
||||
public $posxlabel;
|
||||
public $posxtva;
|
||||
public $posxqty;
|
||||
public $posxup;
|
||||
public $posxunit;
|
||||
public $posxdiscount;
|
||||
public $postotalht;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@ -174,11 +187,6 @@ class pdf_standard extends ModelePDFMovement
|
||||
$this->posxdiscount -= 20;
|
||||
$this->postotalht -= 20;
|
||||
}
|
||||
$this->tva = array();
|
||||
$this->localtax1 = array();
|
||||
$this->localtax2 = array();
|
||||
$this->atleastoneratenotnull = 0;
|
||||
$this->atleastonediscount = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -395,19 +403,6 @@ class pdf_standard extends ModelePDFMovement
|
||||
}
|
||||
|
||||
$num = $this->db->num_rows($resql);
|
||||
|
||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||
|
||||
$i = 0;
|
||||
$help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks';
|
||||
if ($msid) {
|
||||
$texte = $langs->trans('StockMovementForId', $msid);
|
||||
} else {
|
||||
$texte = $langs->trans("ListOfStockMovements");
|
||||
if ($id) {
|
||||
$texte .= ' ('.$langs->trans("ForThisWarehouse").')';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Definition of $dir and $file
|
||||
|
||||
@ -35,6 +35,8 @@ abstract class ModelePDFMovement extends CommonDocGenerator
|
||||
*/
|
||||
public $error = '';
|
||||
|
||||
public $option_codestockservice;
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
|
||||
@ -89,7 +89,6 @@ class doc_generic_mo_odt extends ModelePDFMo
|
||||
$this->option_tva = 0; // Manage the vat option
|
||||
$this->option_modereg = 0; // Display payment mode
|
||||
$this->option_condreg = 0; // Display payment terms
|
||||
$this->option_codeproduitservice = 0; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
|
||||
@ -150,7 +150,6 @@ class pdf_vinci extends ModelePDFMo
|
||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
||||
|
||||
$this->option_logo = 1; // Display logo
|
||||
$this->option_codeproduitservice = 1; // Display product-service code
|
||||
$this->option_multilang = 1; //Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
|
||||
@ -87,7 +87,6 @@ class doc_generic_product_odt extends ModelePDFProduct
|
||||
$this->option_tva = 0; // Manage the vat option PRODUCT_TVAOPTION
|
||||
$this->option_modereg = 0; // Display payment mode
|
||||
$this->option_condreg = 0; // Display payment terms
|
||||
$this->option_codeproduitservice = 0; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
|
||||
@ -138,7 +138,6 @@ class pdf_standard extends ModelePDFProduct
|
||||
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
||||
|
||||
$this->option_logo = 1; // Display logo
|
||||
$this->option_codeproduitservice = 0; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_freetext = 0; // Support add of a personalised text
|
||||
|
||||
|
||||
@ -124,7 +124,6 @@ class doc_generic_project_odt extends ModelePDFProjects
|
||||
$this->option_tva = 0; // Manage the vat option COMMANDE_TVAOPTION
|
||||
$this->option_modereg = 0; // Display payment mode
|
||||
$this->option_condreg = 0; // Display payment terms
|
||||
$this->option_codeproduitservice = 0; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
|
||||
@ -146,7 +146,6 @@ class pdf_baleine extends ModelePDFProjects
|
||||
|
||||
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_codeproduitservice = 1; // Display product-service code
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
|
||||
@ -174,7 +174,6 @@ class pdf_beluga extends ModelePDFProjects
|
||||
|
||||
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_codeproduitservice = 1; // Display product-service code
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
|
||||
@ -145,7 +145,6 @@ class pdf_timespent extends ModelePDFProjects
|
||||
|
||||
$this->option_logo = 1; // Display logo FAC_PDF_LOGO
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_codeproduitservice = 1; // Display product-service code
|
||||
|
||||
// Get source company
|
||||
$this->emetteur = $mysoc;
|
||||
|
||||
@ -125,7 +125,6 @@ class doc_generic_task_odt extends ModelePDFTask
|
||||
$this->option_tva = 0; // Manage the vat option COMMANDE_TVAOPTION
|
||||
$this->option_modereg = 0; // Display payment mode
|
||||
$this->option_condreg = 0; // Display payment terms
|
||||
$this->option_codeproduitservice = 0; // Display product-service code
|
||||
$this->option_multilang = 0; // Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
|
||||
@ -87,7 +87,6 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
||||
$this->option_tva = 0; // Manage the vat option PROPALE_TVAOPTION
|
||||
$this->option_modereg = 0; // Display payment mode
|
||||
$this->option_condreg = 0; // Display payment terms
|
||||
$this->option_codeproduitservice = 0; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
|
||||
@ -154,7 +154,6 @@ class pdf_azur extends ModelePDFPropales
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_modereg = 1; // Display payment mode
|
||||
$this->option_condreg = 1; // Display payment terms
|
||||
$this->option_codeproduitservice = 1; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
@ -1458,9 +1457,10 @@ class pdf_azur extends ModelePDFPropales
|
||||
* @param Propal $object Object to show
|
||||
* @param int $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param Translate $outputlangsbis Object lang for output bis
|
||||
* @return void
|
||||
*/
|
||||
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
|
||||
@ -157,7 +157,6 @@ class pdf_cyan extends ModelePDFPropales
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_modereg = 1; // Display payment mode
|
||||
$this->option_condreg = 1; // Display payment terms
|
||||
$this->option_codeproduitservice = 1; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
|
||||
@ -83,7 +83,6 @@ class doc_generic_reception_odt extends ModelePdfReception
|
||||
$this->option_tva = 0; // Manage the vat option RECEPTION_TVAOPTION
|
||||
$this->option_modereg = 0; // Display payment mode
|
||||
$this->option_condreg = 0; // Display payment terms
|
||||
$this->option_codeproduitservice = 0; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
|
||||
@ -44,7 +44,7 @@ class pdf_squille extends ModelePdfReception
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct($db = 0)
|
||||
public function __construct(DoliDB $db)
|
||||
{
|
||||
global $conf, $langs, $mysoc;
|
||||
|
||||
|
||||
@ -86,7 +86,6 @@ class doc_generic_stock_odt extends ModelePDFStock
|
||||
$this->option_tva = 0; // Manage the vat option STOCK_TVAOPTION
|
||||
$this->option_modereg = 0; // Display payment mode
|
||||
$this->option_condreg = 0; // Display payment terms
|
||||
$this->option_codeproduitservice = 0; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
|
||||
@ -111,6 +111,18 @@ class pdf_standard extends ModelePDFStock
|
||||
*/
|
||||
public $emetteur;
|
||||
|
||||
public $wref;
|
||||
public $posxdesc;
|
||||
public $posxlabel;
|
||||
public $posxtva;
|
||||
public $posxqty;
|
||||
public $posxup;
|
||||
public $posxunit;
|
||||
public $posxdiscount;
|
||||
public $postotalht;
|
||||
|
||||
public $tabTitleHeight;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -174,12 +186,6 @@ class pdf_standard extends ModelePDFStock
|
||||
$this->posxdiscount -= 20;
|
||||
$this->postotalht -= 20;
|
||||
}
|
||||
$this->tva = array();
|
||||
$this->tva_array = array();
|
||||
$this->localtax1 = array();
|
||||
$this->localtax2 = array();
|
||||
$this->atleastoneratenotnull = 0;
|
||||
$this->atleastonediscount = 0;
|
||||
|
||||
$this->tabTitleHeight = 11;
|
||||
}
|
||||
|
||||
@ -150,7 +150,6 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_modereg = 1; // Display payment mode
|
||||
$this->option_condreg = 1; // Display payment terms
|
||||
$this->option_codeproduitservice = 1; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
|
||||
// Define column position
|
||||
@ -967,13 +966,14 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
/**
|
||||
* Show payments table
|
||||
*
|
||||
* @param TCPDF $pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $posy Position y in PDF
|
||||
* @param Translate $outputlangs Object langs for output
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param TCPDF $pdf Object PDF
|
||||
* @param Object $object Object to show
|
||||
* @param int $posy Position y in PDF
|
||||
* @param Translate $outputlangs Object langs for output
|
||||
* @param int $heightforfooter Height for footer
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
|
||||
protected function _tableau_versements(&$pdf, $object, $posy, $outputlangs, $heightforfooter = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
@ -90,8 +90,6 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
|
||||
$this->option_tva = 0; // Manage the vat option COMMANDE_TVAOPTION
|
||||
$this->option_modereg = 0; // Display payment mode
|
||||
$this->option_condreg = 0; // Display payment terms
|
||||
$this->option_codeproduitservice = 0; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
$this->option_freetext = 1; // Support add of a personalised text
|
||||
|
||||
@ -152,7 +152,6 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_modereg = 1; // Display payment mode
|
||||
$this->option_condreg = 1; // Display payment terms
|
||||
$this->option_codeproduitservice = 1; // Display product-service code
|
||||
$this->option_multilang = 1; //Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
|
||||
@ -152,7 +152,6 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_modereg = 1; // Display payment mode
|
||||
$this->option_condreg = 1; // Display payment terms
|
||||
$this->option_codeproduitservice = 1; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
|
||||
@ -117,6 +117,14 @@ class pdf_standard extends ModelePDFSuppliersPayments
|
||||
*/
|
||||
public $emetteur;
|
||||
|
||||
public $posxdate;
|
||||
public $posxreffacturefourn;
|
||||
public $posxreffacture;
|
||||
public $posxtype;
|
||||
public $posxtotalht;
|
||||
public $posxtva;
|
||||
public $posxtotalttc;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
||||
@ -88,7 +88,6 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
|
||||
$this->option_tva = 0; // Manage the vat option PROPALE_TVAOPTION
|
||||
$this->option_modereg = 0; // Display payment mode
|
||||
$this->option_condreg = 0; // Display payment terms
|
||||
$this->option_codeproduitservice = 0; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
|
||||
@ -149,7 +149,6 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
||||
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION
|
||||
$this->option_modereg = 1; // Display payment mode
|
||||
$this->option_condreg = 1; // Display payment terms
|
||||
$this->option_codeproduitservice = 1; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 1; // Displays if there has been a discount
|
||||
$this->option_credit_note = 1; // Support credit notes
|
||||
|
||||
@ -85,7 +85,6 @@ class doc_generic_user_odt extends ModelePDFUser
|
||||
$this->option_tva = 0; // Manage the vat option USER_TVAOPTION
|
||||
$this->option_modereg = 0; // Display payment mode
|
||||
$this->option_condreg = 0; // Display payment terms
|
||||
$this->option_codeproduitservice = 0; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
|
||||
@ -88,7 +88,6 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
|
||||
$this->option_tva = 0; // Manage the vat option USERGROUP_TVAOPTION
|
||||
$this->option_modereg = 0; // Display payment mode
|
||||
$this->option_condreg = 0; // Display payment terms
|
||||
$this->option_codeproduitservice = 0; // Display product-service code
|
||||
$this->option_multilang = 1; // Available in several languages
|
||||
$this->option_escompte = 0; // Displays if there has been a discount
|
||||
$this->option_credit_note = 0; // Support credit notes
|
||||
|
||||
@ -169,7 +169,7 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
||||
}
|
||||
|
||||
if ($sendto) {
|
||||
$this->composeAndSendCustomerMessage($sendto, $subject_customer, $body_customer, $see_ticket_customer, $object, $langs, $conf);
|
||||
$this->composeAndSendCustomerMessage($sendto, $subject_customer, $body_customer, $see_ticket_customer, $object, $langs);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -528,6 +528,8 @@ class Delivery extends CommonObject
|
||||
public function create_from_sending($user, $sending_id)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$expedition = new Expedition($this->db);
|
||||
$result = $expedition->fetch($sending_id);
|
||||
|
||||
@ -772,9 +774,9 @@ class Delivery extends CommonObject
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Load lines
|
||||
* Load lines insto $this->lines.
|
||||
*
|
||||
* @return void
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function fetch_lines()
|
||||
{
|
||||
@ -840,9 +842,11 @@ class Delivery extends CommonObject
|
||||
$i++;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
}
|
||||
|
||||
return $this->lines;
|
||||
return 1;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -973,7 +977,7 @@ class Delivery extends CommonObject
|
||||
if ($resultSourceLine) {
|
||||
$num_lines = $this->db->num_rows($resultSourceLine);
|
||||
$i = 0;
|
||||
$resultArray = array();
|
||||
$array = array();
|
||||
while ($i < $num_lines) {
|
||||
$objSourceLine = $this->db->fetch_object($resultSourceLine);
|
||||
|
||||
@ -1133,14 +1137,6 @@ class DeliveryLine extends CommonObjectLine
|
||||
*/
|
||||
public $table_element = 'deliverydet';
|
||||
|
||||
// From llx_expeditiondet
|
||||
public $qty;
|
||||
public $qty_asked;
|
||||
public $qty_shipped;
|
||||
public $price;
|
||||
public $fk_product;
|
||||
public $origin_id;
|
||||
|
||||
/**
|
||||
* @var string delivery note lines label
|
||||
*/
|
||||
@ -1162,11 +1158,25 @@ class DeliveryLine extends CommonObjectLine
|
||||
*/
|
||||
public $libelle;
|
||||
|
||||
public $origin_line_id;
|
||||
// From llx_expeditiondet
|
||||
public $qty;
|
||||
public $qty_asked;
|
||||
public $qty_shipped;
|
||||
|
||||
public $fk_product;
|
||||
public $product_desc;
|
||||
public $product_type;
|
||||
public $product_ref;
|
||||
public $product_label;
|
||||
|
||||
public $fk_origin_line;
|
||||
public $origin_id;
|
||||
|
||||
public $price;
|
||||
|
||||
public $origin_line_id;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
||||
@ -752,7 +752,7 @@ class Expedition extends CommonObject
|
||||
|
||||
//var_dump($this->lines[$i]);
|
||||
$mouvS = new MouvementStock($this->db);
|
||||
$mouvS->origin = dol_clone($this, 1);
|
||||
//$mouvS->origin = dol_clone($this, 1);
|
||||
$mouvS->setOrigin($this->element, $this->id);
|
||||
|
||||
if (empty($obj->edbrowid)) {
|
||||
|
||||
@ -22,12 +22,12 @@
|
||||
* \brief File of class to manage expense ik
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/coreobject.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
||||
|
||||
/**
|
||||
* Class to manage inventories
|
||||
*/
|
||||
class ExpenseReportIk extends CoreObject
|
||||
class ExpenseReportIk extends CommonObject
|
||||
{
|
||||
/**
|
||||
* @var string ID to identify managed object
|
||||
@ -68,6 +68,7 @@ class ExpenseReportIk extends CoreObject
|
||||
*/
|
||||
public $ikoffset;
|
||||
|
||||
|
||||
/**
|
||||
* Attribute object linked with database
|
||||
* @var array
|
||||
@ -80,17 +81,75 @@ class ExpenseReportIk extends CoreObject
|
||||
,'ikoffset'=>array('type'=>'double')
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct(DoliDB &$db)
|
||||
public function __construct(DoliDB $db)
|
||||
{
|
||||
parent::__construct($db);
|
||||
parent::init();
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
$this->errors = array();
|
||||
|
||||
/**
|
||||
* Create object into database
|
||||
*
|
||||
* @param User $user User that creates
|
||||
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||
* @return int <0 if KO, Id of created object if OK
|
||||
*/
|
||||
public function create(User $user, $notrigger = false)
|
||||
{
|
||||
$resultcreate = $this->createCommon($user, $notrigger);
|
||||
|
||||
//$resultvalidate = $this->validate($user, $notrigger);
|
||||
|
||||
return $resultcreate;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load object in memory from the database
|
||||
*
|
||||
* @param int $id Id object
|
||||
* @param string $ref Ref
|
||||
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||
*/
|
||||
public function fetch($id, $ref = null)
|
||||
{
|
||||
$result = $this->fetchCommon($id, $ref);
|
||||
if ($result > 0 && !empty($this->table_element_line)) {
|
||||
$this->fetchLines();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update object into database
|
||||
*
|
||||
* @param User $user User that modifies
|
||||
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function update(User $user, $notrigger = false)
|
||||
{
|
||||
return $this->updateCommon($user, $notrigger);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete object in database
|
||||
*
|
||||
* @param User $user User that deletes
|
||||
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function delete(User $user, $notrigger = false)
|
||||
{
|
||||
return $this->deleteCommon($user, $notrigger);
|
||||
//return $this->deleteCommon($user, $notrigger, 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -22,12 +22,12 @@
|
||||
* \brief File of class to manage expense ik
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/coreobject.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
||||
|
||||
/**
|
||||
* Class to manage inventories
|
||||
*/
|
||||
class ExpenseReportRule extends CoreObject
|
||||
class ExpenseReportRule extends CommonObject
|
||||
{
|
||||
/**
|
||||
* @var string ID to identify managed object
|
||||
@ -125,21 +125,78 @@ class ExpenseReportRule extends CoreObject
|
||||
,'entity'=>array('type'=>'integer')
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct(DoliDB &$db)
|
||||
public function __construct(DoliDB $db)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
parent::__construct($db);
|
||||
parent::init();
|
||||
|
||||
$this->errors = array();
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create object into database
|
||||
*
|
||||
* @param User $user User that creates
|
||||
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||
* @return int <0 if KO, Id of created object if OK
|
||||
*/
|
||||
public function create(User $user, $notrigger = false)
|
||||
{
|
||||
$resultcreate = $this->createCommon($user, $notrigger);
|
||||
|
||||
//$resultvalidate = $this->validate($user, $notrigger);
|
||||
|
||||
return $resultcreate;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load object in memory from the database
|
||||
*
|
||||
* @param int $id Id object
|
||||
* @param string $ref Ref
|
||||
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||
*/
|
||||
public function fetch($id, $ref = null)
|
||||
{
|
||||
$result = $this->fetchCommon($id, $ref);
|
||||
if ($result > 0 && !empty($this->table_element_line)) {
|
||||
$this->fetchLines();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update object into database
|
||||
*
|
||||
* @param User $user User that modifies
|
||||
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function update(User $user, $notrigger = false)
|
||||
{
|
||||
return $this->updateCommon($user, $notrigger);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete object in database
|
||||
*
|
||||
* @param User $user User that deletes
|
||||
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function delete(User $user, $notrigger = false)
|
||||
{
|
||||
return $this->deleteCommon($user, $notrigger);
|
||||
//return $this->deleteCommon($user, $notrigger, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return all rules or filtered by something
|
||||
*
|
||||
|
||||
@ -580,14 +580,14 @@ if ($resql) {
|
||||
if (!empty($arrayfields['d.date_valid']['checked'])) {
|
||||
print '<td class="liste_titre" align="center">';
|
||||
//print '<input class="flat" type="text" size="1" maxlength="2" name="month_end" value="'.$month_end.'">';
|
||||
//$formother->select_year($year_end,'year_end',1, $min_year, $max_year);
|
||||
//print $formother->selectyear($year_end,'year_end',1, $min_year, $max_year);
|
||||
print '</td>';
|
||||
}
|
||||
// Date approve
|
||||
if (!empty($arrayfields['d.date_approve']['checked'])) {
|
||||
print '<td class="liste_titre" align="center">';
|
||||
//print '<input class="flat" type="text" size="1" maxlength="2" name="month_end" value="'.$month_end.'">';
|
||||
//$formother->select_year($year_end,'year_end',1, $min_year, $max_year);
|
||||
//print $formother->selectyear($year_end,'year_end',1, $min_year, $max_year);
|
||||
print '</td>';
|
||||
}
|
||||
// Amount with no tax
|
||||
|
||||
@ -127,6 +127,13 @@ class FactureFournisseurRec extends CommonInvoice
|
||||
|
||||
public $model_pdf;
|
||||
|
||||
/**
|
||||
* Invoice lines
|
||||
* @var FactureFournisseurLigneRec[]
|
||||
*/
|
||||
public $lines = array();
|
||||
|
||||
|
||||
/* Override fields in CommonObject
|
||||
public $entity;
|
||||
public $date_creation;
|
||||
|
||||
@ -711,7 +711,7 @@ $formorder = new FormOrder($db);
|
||||
$formother = new FormOther($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
|
||||
$title = $langs->trans("ListOfSupplierOrders");
|
||||
$title = $langs->trans("SuppliersOrders");
|
||||
if ($socid > 0) {
|
||||
$fourn = new Fournisseur($db);
|
||||
$fourn->fetch($socid);
|
||||
|
||||
@ -105,7 +105,7 @@ $syear = GETPOST("reyear") ?GETPOST("reyear") : date("Y", time());
|
||||
|
||||
print $formother->select_month($cmonth, 'remonth');
|
||||
|
||||
print $formother->select_year($syear, 'reyear');
|
||||
print $formother->selectyear($syear, 'reyear');
|
||||
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Create").'">';
|
||||
print '</form>';
|
||||
|
||||
@ -485,7 +485,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// No
|
||||
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER_IN_LIST)) {
|
||||
print '<td>'.(($offset * $limit) + $i).'</td>';
|
||||
print '<td class="nowraponall">'.(($offset * $limit) + $i).'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@ -493,7 +493,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Ref
|
||||
if (!empty($arrayfields['p.ref']['checked'])) {
|
||||
print '<td class="nowrap">'.$paymentfournstatic->getNomUrl(1).'</td>';
|
||||
print '<td class="nowraponall">'.$paymentfournstatic->getNomUrl(1).'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@ -510,7 +510,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Thirdparty
|
||||
if (!empty($arrayfields['s.nom']['checked'])) {
|
||||
print '<td>';
|
||||
print '<td class="tdoverflowmax125">';
|
||||
if ($objp->socid > 0) {
|
||||
print $companystatic->getNomUrl(1, '', 24);
|
||||
}
|
||||
@ -539,7 +539,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Bank account
|
||||
if (!empty($arrayfields['ba.label']['checked'])) {
|
||||
print '<td>';
|
||||
print '<td class="tdoverflowmax125">';
|
||||
if ($objp->bid) {
|
||||
$accountstatic->id = $objp->bid;
|
||||
$accountstatic->ref = $objp->bref;
|
||||
|
||||
@ -625,7 +625,7 @@ if ($resql) {
|
||||
if (!empty($arrayfields['cp.date_debut']['checked'])) {
|
||||
print '<td class="liste_titre center nowraponall">';
|
||||
print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month_start" value="'.dol_escape_htmltag($search_month_start).'">';
|
||||
$formother->select_year($search_year_start, 'search_year_start', 1, $min_year, $max_year);
|
||||
print $formother->selectyear($search_year_start, 'search_year_start', 1, $min_year, $max_year);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -633,7 +633,7 @@ if ($resql) {
|
||||
if (!empty($arrayfields['cp.date_fin']['checked'])) {
|
||||
print '<td class="liste_titre center nowraponall">';
|
||||
print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month_end" value="'.dol_escape_htmltag($search_month_end).'">';
|
||||
$formother->select_year($search_year_end, 'search_year_end', 1, $min_year, $max_year);
|
||||
print $formother->selectyear($search_year_end, 'search_year_end', 1, $min_year, $max_year);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -654,7 +654,7 @@ if ($resql) {
|
||||
if (!empty($arrayfields['cp.date_create']['checked'])) {
|
||||
print '<td class="liste_titre center width200">';
|
||||
print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month_create" value="'.dol_escape_htmltag($search_month_create).'">';
|
||||
$formother->select_year($search_year_create, 'search_year_create', 1, $min_year, 0);
|
||||
print $formother->selectyear($search_year_create, 'search_year_create', 1, $min_year, 0);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -662,7 +662,7 @@ if ($resql) {
|
||||
if (!empty($arrayfields['cp.tms']['checked'])) {
|
||||
print '<td class="liste_titre center width200">';
|
||||
print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month_update" value="'.dol_escape_htmltag($search_month_update).'">';
|
||||
$formother->select_year($search_year_update, 'search_year_update', 1, $min_year, 0);
|
||||
print $formother->selectyear($search_year_update, 'search_year_update', 1, $min_year, 0);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
|
||||
@ -1106,14 +1106,14 @@ if ($step == 4 && $datatoimport) {
|
||||
if ($j == $i) {
|
||||
print ' selected';
|
||||
}
|
||||
print " data-html='".dol_escape_htmltag($label)."'";
|
||||
print ' data-html="'.dol_escape_htmltag($label).'"';
|
||||
print '>';
|
||||
print $label;
|
||||
print '</options>';
|
||||
$j++;
|
||||
}
|
||||
print '</select>';
|
||||
//print ajax_combobox('selectorderimport_'.($i+1));
|
||||
print ajax_combobox('selectorderimport_'.($i+1));
|
||||
print "</td>";
|
||||
|
||||
print '<td class="nowraponall" style="font-weight:normal; text-align:right">';
|
||||
|
||||
@ -143,7 +143,7 @@ if (!empty($force_install_message)) {
|
||||
<td class="label"><label for="main_dir"><b><?php print $langs->trans("WebPagesDirectory"); ?></b></label></td>
|
||||
<?php
|
||||
if (empty($dolibarr_main_document_root)) {
|
||||
$dolibarr_main_document_root = GETPOSTISSET('main_dir', 'alpha') ? GETPOST('main_dir') : detect_dolibarr_main_document_root();
|
||||
$dolibarr_main_document_root = GETPOSTISSET('main_dir') ? GETPOST('main_dir') : detect_dolibarr_main_document_root();
|
||||
}
|
||||
?>
|
||||
<td class="label">
|
||||
@ -178,7 +178,7 @@ if (!empty($force_install_noedit)) {
|
||||
$dolibarr_main_data_root = @$force_install_main_data_root;
|
||||
}
|
||||
if (empty($dolibarr_main_data_root)) {
|
||||
$dolibarr_main_data_root = GETPOSTISSET('main_data_dir', 'alpha') ? GETPOST('main_data_dir') : detect_dolibarr_main_data_root($dolibarr_main_document_root);
|
||||
$dolibarr_main_data_root = GETPOSTISSET('main_data_dir') ? GETPOST('main_data_dir') : detect_dolibarr_main_data_root($dolibarr_main_document_root);
|
||||
}
|
||||
?>
|
||||
<td class="label">
|
||||
@ -207,7 +207,7 @@ if (!empty($force_install_noedit)) {
|
||||
<!-- Root URL $dolibarr_main_url_root -->
|
||||
<?php
|
||||
if (empty($dolibarr_main_url_root)) {
|
||||
$dolibarr_main_url_root = GETPOSTISSET('main_url', 'alpha') ? GETPOST('main_url') : detect_dolibarr_main_url_root();
|
||||
$dolibarr_main_url_root = GETPOSTISSET('main_url') ? GETPOST('main_url') : detect_dolibarr_main_url_root();
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
|
||||
@ -228,7 +228,7 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) {
|
||||
$success = 1;
|
||||
} else {
|
||||
dolibarr_install_syslog('step5: FailedToCreateAdminLogin '.$newuser->error, LOG_ERR);
|
||||
setEventMessage($langs->trans("FailedToCreateAdminLogin").' '.$newuser->error, null, 'errors');
|
||||
setEventMessages($langs->trans("FailedToCreateAdminLogin").' '.$newuser->error, null, 'errors');
|
||||
//header("Location: step4.php?error=3&selectlang=$setuplang".(isset($login) ? '&login='.$login : ''));
|
||||
print '<br><div class="error">'.$langs->trans("FailedToCreateAdminLogin").': '.$newuser->error.'</div><br><br>';
|
||||
print $langs->trans("ErrorGoBackAndCorrectParameters").'<br><br>';
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user