diff --git a/ChangeLog b/ChangeLog index 9fa65871f05..5bab0419c54 100644 --- a/ChangeLog +++ b/ChangeLog @@ -133,7 +133,7 @@ NEW: printFieldListFrom hook call on several lists NEW: Use lang selector when using a field key 'lang' in modulebuilder NEW: we need to be able to put more filters on deleteByParentField() function NEW: make it easier to set the `keyword`, `keywords` and `description` attributes of an ecm file object - +NEW: Experimental feature to manage user sessions in database Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: @@ -146,6 +146,7 @@ Following changes may create regressions for some external modules, but were nec method executeCLI() available into core/class/utils.class.php * Class file expeditionbatch.class.php renamed to expeditionlinebatch.class.php * ExpeditionLineBatch::fetchAll is not static anymore and first parameter $db is removed +* ExtraFields->showOutputField parameter 4 'extrafieldsobjectkey' is now required diff --git a/htdocs/admin/system/xdebug.php b/htdocs/admin/system/xdebug.php index fd10aad05e8..8c3a70ff6ec 100644 --- a/htdocs/admin/system/xdebug.php +++ b/htdocs/admin/system/xdebug.php @@ -73,10 +73,10 @@ if (function_exists('socket_create')) { print 'xdebug.profiler_append = '.ini_get('xdebug.profiler_append')."
\n"; print "
\n"; - echo "To run a debug session, add parameter
"; - echo "* XDEBUG_SESSION_START=aname on your URL. To stop, remove cookie XDEBUG_SESSION_START.
\n"; - echo "To run a profiler session (when xdebug.profiler_enable_trigger=1), add parameter
\n"; - echo "* XDEBUG_PROFILE=aname on each URL.
"; + print "To run a debug session, add parameter
"; + print "* XDEBUG_SESSION_START=aname on your URL. To stop, remove cookie XDEBUG_SESSION_START.
\n"; + print "To run a profiler session (when xdebug.profiler_enable_trigger=1), add parameter
\n"; + print "* XDEBUG_PROFILE=aname on each URL.
"; print "
"; print "Test debugger server (Eclipse for example):
\n"; @@ -89,12 +89,12 @@ if (function_exists('socket_create')) { //$client = socket_accept($sock); $client = socket_connect($socket, $address, $port); if ($client) { - echo "Connection established: ".$client." - address=".$address." port=".$port."
\n"; - echo "There is a Remote debug server at this address.
\n"; - echo "
\n"; - echo "To be sure this debugger accepts input from your PHP server and xdebug, be sure to have\n"; - echo "your php.ini file with this :
\n"; - echo '\n"; print "

\n"; - echo 'Then check in your debug server (Eclipse), you have setup:
+ print 'Then check in your debug server (Eclipse), you have setup:
XDebug with same port than in php.ini
Allow Remote debug=yes or prompt
'."\n"; print "
\n"; } else { print socket_strerror(socket_last_error()); - echo "Failed to connect to address=".$address." port=".$port."
\n"; - echo "There is no Remote debug server at this address.\n"; + print " - Failed to connect to address=".$address." port=".$port."
\n"; + print "There is no Remote debug server at this address.\n"; } socket_close($socket); } else { diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 36d9af8f9b4..0a182e6dcbe 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -297,7 +297,7 @@ if (!in_array($nowyear, $arrayyears)) { $arrayyears[$nowyear] = $nowyear; } arsort($arrayyears); -print $form->selectarray('year', $arrayyears, $year, 0); +print $form->selectarray('year', $arrayyears, $year, 0, 0, 0, '', 0, 0, 0, '', 'width75'); print ''; print ''; print ''; diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 8a3a6a142aa..3d2dee9a286 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -347,7 +347,7 @@ if (!in_array($nowyear, $arrayyears)) { $arrayyears[$nowyear] = $nowyear; } arsort($arrayyears); -print $form->selectarray('year', $arrayyears, $year, 0); +print $form->selectarray('year', $arrayyears, $year, 0, 0, 0, '', 0, 0, 0, '', 'width75'); print ''; print ''; print ''; diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index 8e4860bd2f2..7da90915b18 100644 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -260,7 +260,7 @@ if (!in_array($year, $arrayyears)) { $arrayyears[$year] = $year; } arsort($arrayyears); -print $form->selectarray('year', $arrayyears, $year, 0); +print $form->selectarray('year', $arrayyears, $year, 0, 0, 0, '', 0, 0, 0, '', 'width75'); print ''; print ''; print ''; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 20f289ae141..c50f7a4e8e8 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -92,6 +92,8 @@ $search_montant_ttc = GETPOST('search_montant_ttc', 'alpha'); $origin = GETPOST('origin', 'alpha'); $originid = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility $fac_rec = GETPOST('fac_rec', 'int'); +$facid = GETPOST('facid', 'int'); +$ref_client = GETPOST('ref_client', 'int'); // PDF $hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); @@ -2771,7 +2773,7 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; // Actions to build doc - $upload_dir = $conf->facture->multidir_output[$object->entity]; + $upload_dir = $conf->facture->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]; $permissiontoadd = $usercancreate; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; @@ -3555,7 +3557,7 @@ if ($action == 'create') { print ''; - if ($conf->global->INVOICE_USE_RETAINED_WARRANTY) { + if (!empty($conf->global->INVOICE_USE_RETAINED_WARRANTY)) { $rwStyle = 'display:none;'; if (in_array(GETPOST('type', 'int'), $retainedWarrantyInvoiceAvailableType)) { $rwStyle = ''; @@ -3631,7 +3633,7 @@ if ($action == 'create') { // Incoterms if (!empty($conf->incoterm->enabled)) { print ''; - print ''; + print ''; print ''; $incoterm_id = GETPOST('incoterm_id'); $incoterm_location = GETPOST('location_incoterms'); @@ -3644,7 +3646,7 @@ if ($action == 'create') { } // Other attributes - $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="2"', 'cols' => '2', 'socid'=>$socid); + $parameters = array('objectsrc' => !empty($objectsrc) ? $objectsrc : 0, 'colspan' => ' colspan="2"', 'cols' => '2', 'socid'=>$socid); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 9619e1a9ddd..d785ccbce93 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -692,6 +692,10 @@ if ($resql) { if ($num > 0) { $i = 0; $totalarray = array(); + $totalarray['nbfield'] = 0; + $totalarray['val']['f.total_ht'] = 0; + $totalarray['val']['f.total_tva'] = 0; + $totalarray['val']['f.total_ttc'] = 0; while ($i < min($num, $limit)) { $objp = $db->fetch_object($resql); if (empty($objp)) { @@ -701,7 +705,7 @@ if ($resql) { $companystatic->id = $objp->socid; $companystatic->name = $objp->name; - $invoicerectmp->id = $objp->id ? $objp->id : $objp->facid; + $invoicerectmp->id = !empty($objp->id) ? $objp->id : $objp->facid; $invoicerectmp->frequency = $objp->frequency; $invoicerectmp->suspended = $objp->suspended; $invoicerectmp->unit_frequency = $objp->unit_frequency; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 52b2fcceee0..02ce893b96d 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -805,7 +805,7 @@ if (!$sall) { } } // Add GroupBy from hooks - $parameters = array('all' => $all, 'fieldstosearchall' => $fieldstosearchall); + $parameters = array('all' => !empty($all) ? $all : 0, 'fieldstosearchall' => $fieldstosearchall); $reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; } else { @@ -1650,7 +1650,7 @@ if ($resql) { $facturestatic->note_public = $obj->note_public; $facturestatic->note_private = $obj->note_private; - if ($conf->global->INVOICE_USE_SITUATION && $conf->global->INVOICE_USE_RETAINED_WARRANTY) { + if (!empty($conf->global->INVOICE_USE_SITUATION) && !empty($conf->global->INVOICE_USE_RETAINED_WARRANTY)) { $facturestatic->retained_warranty = $obj->retained_warranty; $facturestatic->retained_warranty_date_limit = $obj->retained_warranty_date_limit; $facturestatic->situation_final = $obj->retained_warranty_date_limit; @@ -1846,8 +1846,8 @@ if ($resql) { } // Alias if (!empty($arrayfields['s.name_alias']['checked'])) { - print ''; - print dol_escape_htmltag($obj->name_alias); + print ''; + print dol_escape_htmltag((!empty($obj->name_alias) ? $obj->name_alias : '')); print ''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index babadfe7366..98337746090 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -102,7 +102,7 @@ if ($mode == 'customer') { $stats->where .= ' AND f.fk_statut IN ('.$db->sanitize($object_status).')'; } if (is_array($custcats) && !empty($custcats)) { - $stats->from .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cat ON (f.fk_soc = cat.fk_soc)'; + $stats->from .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cat OmdN (f.fk_soc = cat.fk_soc)'; $stats->where .= ' AND cat.fk_categorie IN ('.$db->sanitize(implode(',', $custcats)).')'; } } @@ -341,7 +341,7 @@ if (!in_array($nowyear, $arrayyears)) { $arrayyears[$nowyear] = $nowyear; } arsort($arrayyears); -print $form->selectarray('year', $arrayyears, $year, 0); +print $form->selectarray('year', $arrayyears, $year, 0, 0, 0, '', 0, 0, 0, '', 'width75'); print ''; print ''; print ''; @@ -380,11 +380,11 @@ foreach ($data as $val) { print ''; print ' 0 ? '&userid='.$userid : '').'">'.$year.''; print ''.$val['nb'].''; - print ''.($val['nb_diff'] < 0 ? '' : '+').round($val['nb_diff']).'%'; + print ''.(!empty($val['nb_diff']) && $val['nb_diff'] < 0 ? '' : '+').round(!empty($val['nb_diff']) ? $val['nb_diff'] : 0).'%'; print ''.price(price2num($val['total'], 'MT'), 1).''; - print ''.($val['total_diff'] < 0 ? '' : '+').round($val['total_diff']).'%'; + print ''.( !empty($val['total_diff']) && $val['total_diff'] < 0 ? '' : '+').round(!empty($val['total_diff']) ? $val['total_diff'] : 0).'%'; print ''.price(price2num($val['avg'], 'MT'), 1).''; - print ''.($val['avg_diff'] < 0 ? '' : '+').round($val['avg_diff']).'%'; + print ''.(!empty($val['avg_diff']) && $val['avg_diff'] < 0 ? '' : '+').round(!empty($val['avg_diff']) ? $val['avg_diff'] : 0).'%'; print ''; $oldyear = $year; } diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 8207802feaa..98ebe32f970 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -26,11 +26,11 @@ */ require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; @@ -46,8 +46,14 @@ if (!empty($conf->accounting->enabled)) { $langs->loadLangs(array('compta', 'bills', 'banks', 'hrm')); $id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); -$confirm = GETPOST('confirm'); +$confirm = GETPOST('confirm', 'alpha'); +$cancel = GETPOST('cancel', 'aZ09'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); + $fk_project = (GETPOST('fk_project') ? GETPOST('fk_project', 'int') : 0); $dateech = dol_mktime(GETPOST('echhour'), GETPOST('echmin'), GETPOST('echsec'), GETPOST('echmonth'), GETPOST('echday'), GETPOST('echyear')); @@ -56,11 +62,28 @@ $label = GETPOST('label', 'alpha'); $actioncode = GETPOST('actioncode'); $fk_user = GETPOST('userid', 'int'); +// Initialize technical objects $object = new ChargeSociales($db); +$extrafields = new ExtraFields($db); +$diroutputmassaction = $conf->tax->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('taxsocialcontributioncard', 'globalcard')); + +if (empty($action) && empty($id) && empty($ref)) { + $action = 'view'; +} + +// Load object if ($id > 0) { $object->fetch($id); } +$permissiontoread = $user->rights->tax->charges->lire; +$permissiontoadd = $user->rights->tax->charges->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissiontodelete = $user->rights->tax->charges->supprimer || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); +$permissionnote = $user->rights->tax->charges->creer; // Used by the include of actions_setnotes.inc.php +$permissiondellink = $user->rights->tax->charges->creer; // Used by the include of actions_dellink.inc.php +$upload_dir = $conf->tax->multidir_output[isset($object->entity) ? $object->entity : 1]; + // Security check $socid = GETPOST('socid', 'int'); if ($user->socid) { @@ -74,6 +97,12 @@ $result = restrictedArea($user, 'tax', $object->id, 'chargesociales', 'charges') * Actions */ +$parameters = array(); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + // Classify paid if ($action == 'confirm_paid' && $user->rights->tax->charges->creer && $confirm == 'yes') { $object->fetch($id); @@ -122,7 +151,7 @@ if ($action == 'setmode' && $user->rights->tax->charges->creer) { } } -// bank account +// Bank account if ($action == 'setbankaccount' && $user->rights->tax->charges->creer) { $object->fetch($id); $result = $object->setBankAccount(GETPOST('fk_account', 'int')); @@ -151,7 +180,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') { // Add social contribution if ($action == 'add' && $user->rights->tax->charges->creer) { - $amount = price2num(GETPOST('amount'), 'MT'); + $amount = price2num(GETPOST('amount', 'alpha'), 'MT'); if (!$dateech) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Date")), null, 'errors'); @@ -189,7 +218,7 @@ if ($action == 'add' && $user->rights->tax->charges->creer) { if ($action == 'update' && !GETPOST("cancel") && $user->rights->tax->charges->creer) { - $amount = price2num(GETPOST('amount'), 'MT'); + $amount = price2num(GETPOST('amount', 'alpha'), 'MT'); if (!$dateech) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Date")), null, 'errors'); @@ -297,6 +326,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->tax->char */ $form = new Form($db); +$formfile = new FormFile($db); $formsocialcontrib = new FormSocialContrib($db); $bankaccountstatic = new Account($db); if (!empty($conf->projet->enabled)) { @@ -308,7 +338,7 @@ $help_url = 'EN:Module_Taxes_and_social_contributions|FR:Module Taxes et dividen llxHeader("", $title, $help_url); -// Mode creation +// Form to create a social contribution if ($action == 'create') { print load_fiche_titre($langs->trans("NewSocialContribution")); @@ -411,11 +441,7 @@ if ($action == 'create') { print ''; } -/* *************************************************************************** */ -/* */ -/* Card Mode */ -/* */ -/* *************************************************************************** */ +// View mode if ($id > 0) { $object = new ChargeSociales($db); $result = $object->fetch($id); @@ -594,7 +620,7 @@ if ($id > 0) { } print ''; - // Bank Account + // Bank account if (!empty($conf->banque->enabled)) { print ''; print ''; } + // Other attributes + $parameters = array(); + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print '
'; @@ -614,6 +640,11 @@ if ($id > 0) { print '
'; print ''; @@ -627,7 +658,7 @@ if ($id > 0) { /* * Payments */ - $sql = "SELECT p.rowid, p.num_paiement as num_payment, datep as dp, p.amount,"; + $sql = "SELECT p.rowid, p.num_paiement as num_payment, p.datep as dp, p.amount,"; $sql .= " c.code as type_code,c.libelle as paiement_type,"; $sql .= ' ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.currency_code as bacurrency_code, ba.fk_accountancy_journal'; $sql .= " FROM ".MAIN_DB_PREFIX."paiementcharge as p"; @@ -637,7 +668,7 @@ if ($id > 0) { $sql .= ", ".MAIN_DB_PREFIX."chargesociales as cs"; $sql .= " WHERE p.fk_charge = ".((int) $id); $sql .= " AND p.fk_charge = cs.rowid"; - $sql .= " AND cs.entity IN (".getEntity('tax').")"; + $sql .= " AND cs.entity IN (".getEntity('sc').")"; $sql .= " ORDER BY dp DESC"; //print $sql; @@ -735,22 +766,15 @@ if ($id > 0) { print dol_get_fiche_end(); if ($action == 'edit') { - print '
'; - print ''; - print '   '; - print ''; - print '
'; - } + print $form->buttonsSaveCancel(); - if ($action == 'edit') { print "\n"; } - /* - * Actions buttons - */ + // Buttons for actions + if ($action != 'edit') { print '
'."\n"; @@ -788,6 +812,64 @@ if ($id > 0) { print "
"; } + + + // Select mail models is same action as presend + if (GETPOST('modelselected')) { + $action = 'presend'; + } + + if ($action != 'presend') { + print '
'; + print ''; // ancre + + $includedocgeneration = 1; + + // Documents + if ($includedocgeneration) { + $objref = dol_sanitizeFileName($object->ref); + $relativepath = $objref.'/'.$objref.'.pdf'; + $filedir = $conf->tax->dir_output.'/'.$objref; + $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; + //$genallowed = $user->rights->tax->charges->lire; // If you can read, you can build the PDF to read content + $genallowed = 0; + $delallowed = $user->rights->tax->charges->creer; // If you can create/edit, you can remove a file on card + print $formfile->showdocuments('tax', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang); + } + + // Show links to link elements + //$linktoelem = $form->showLinkToObjectBlock($object, null, array('myobject')); + //$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + + + print '
'; + + /* + $MAXEVENT = 10; + + $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?id='.$object->id); + + // List of actions on element + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; + $formactions = new FormActions($db); + $somethingshown = $formactions->showactions($object, $object->element.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter); + */ + + print '
'; + } + + //Select mail models is same action as presend + if (GETPOST('modelselected')) { + $action = 'presend'; + } + + // Presend form + $modelmail = 'sc'; + $defaulttopic = 'InformationMessage'; + $diroutput = $conf->tax->dir_output; + $trackid = 'sc'.$object->id; + + include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; } else { /* Social contribution not found */ dol_print_error('', $object->error); diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index ef09cd5aabc..530d18d17f9 100755 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -306,7 +306,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') { } if ($action == 'update' && !GETPOST("cancel") && $user->rights->tax->charges->creer) { - $amount = price2num(GETPOST('amount')); + $amount = price2num(GETPOST('amount', 'alpha'), 'MT'); if (empty($amount)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), null, 'errors'); @@ -317,7 +317,7 @@ if ($action == 'update' && !GETPOST("cancel") && $user->rights->tax->charges->cr } else { $result = $object->fetch($id); - $object->amount = price2num($amount); + $object->amount = $amount; $result = $object->update($user); if ($result <= 0) { @@ -339,8 +339,8 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->tax->char $object->fetch($id); if ($object->id > 0) { - $object->paye = 0; $object->id = $object->ref = null; + $object->paye = 0; if (GETPOST('clone_label', 'alphanohtml')) { $object->label = GETPOST('clone_label', 'alphanohtml'); @@ -535,7 +535,7 @@ if ($action == 'create') { } // View mode -if ($id) { +if ($id > 0) { $head = vat_prepare_head($object); $totalpaye = $object->getSommePaiement(); @@ -705,7 +705,8 @@ if ($id) { $objp = $db->fetch_object($resql); print ''; - print ''.img_object($langs->trans("Payment"), "payment").' '.$objp->rowid.''; + print ''.img_object($langs->trans("Payment"), "payment").' '.$objp->rowid.''; + print ''; print ''.dol_print_date($db->jdate($objp->dp), 'day')."\n"; $labeltype = $langs->trans("PaymentType".$objp->type_code) != ("PaymentType".$objp->type_code) ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type; print "".$labeltype.' '.$objp->num_payment."\n"; @@ -768,7 +769,7 @@ if ($id) { if ($action == 'edit') { print $form->buttonsSaveCancel(); - print ""; + print "\n"; } diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example index 7bb58d6b701..6bf2873b50c 100644 --- a/htdocs/conf/conf.php.example +++ b/htdocs/conf/conf.php.example @@ -282,18 +282,21 @@ $dolibarr_nocsrfcheck='0'; // If set to 1, you will be able to define some command line in the internale Job scheduler module. // Default value: '0' // Examples: '1' +// $dolibarr_cron_allow_cli='0'; // dolibarr_mailing_limit_sendbyweb -// Can set a limit for mailing send by web. This overwrite database value. Can be used to restrict on OS level. +// Can set a limit for mailing send by web. This overwrite database value. Can be used to restrict on system level. // Default value: '25' // Examples: '-1' (sending by web is forbidden) +// // $dolibarr_mailing_limit_sendbyweb='25'; // dolibarr_mailing_limit_sendbycli -// Can set a limit for mailing send by cli. This overwrite database value. Can be used to restrict on OS level. +// Can set a limit for mailing send by cli. This overwrite database value. Can be used to restrict on system level. // Default value: '0' (no hard limit, use soft database value if exists) // Examples: '-1' (sending by cli is forbidden) +// // $dolibarr_mailing_limit_sendbycli='0'; // MAIN_ANTIVIRUS_COMMAND (as a constant) @@ -308,6 +311,17 @@ $dolibarr_cron_allow_cli='0'; // Example: '--fdpass'; // define('MAIN_ANTIVIRUS_PARAM', '--fdpass'); +// php_session_save_handler +// Try to use the Dolibarr internal session handler that uses a database instead of the PHP handler (experimental). +// If you enable this feature to 'db', you may also want to enable the following constants: +// $dolibarr_session_db_type, $dolibarr_session_db_host, $dolibarr_session_db_user, $dolibarr_session_db_pass +// $dolibarr_session_db_pass, $dolibarr_session_db_name, $dolibarr_session_db_type = $dolibarr_main_db_port +// Default value: '' +// Example: 'db'; +// +// $php_session_save_handler=''; + + //################## // Other diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index 63b4b3f7fc6..c4b79d89920 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -204,6 +204,8 @@ if ($type == 'directory') { 'contract', 'product', 'tax', + 'tax-vat', + 'salaries', 'project', 'project_task', 'fichinter', @@ -225,6 +227,7 @@ if ($type == 'directory') { // TODO change for multicompany sharing if ($module == 'company') { $upload_dir = $conf->societe->dir_output; + $excludefiles[] = '^contact$'; // The subdir 'contact' contains files of contacts. } elseif ($module == 'invoice') { $upload_dir = $conf->facture->dir_output; } elseif ($module == 'invoice_supplier') { @@ -243,6 +246,11 @@ if ($type == 'directory') { $upload_dir = $conf->product->dir_output; } elseif ($module == 'tax') { $upload_dir = $conf->tax->dir_output; + $excludefiles[] = '^vat$'; // The subdir 'vat' contains files of vats. + } elseif ($module == 'tax-vat') { + $upload_dir = $conf->tax->dir_output.'/vat'; + } elseif ($module == 'salaries') { + $upload_dir = $conf->salaries->dir_output; } elseif ($module == 'project') { $upload_dir = $conf->projet->dir_output; } elseif ($module == 'project_task') { @@ -280,10 +288,6 @@ if ($type == 'directory') { $textifempty = ($section ? $langs->trans("NoFileFound") : ($showonrightsize == 'featurenotyetavailable' ? $langs->trans("FeatureNotYetAvailable") : $langs->trans("NoFileFound"))); - if ($module == 'company') { - $excludefiles[] = '^contact$'; // The subdir 'contact' contains files of contacts with no id of thirdparty. - } - $filter = preg_quote($search_doc_ref, '/'); $filearray = dol_dir_list($upload_dir, "files", 1, $filter, $excludefiles, $sortfield, $sorting, 1); diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index d9a2c250b89..19c389ec7f8 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -125,7 +125,7 @@ $userstatic = new User($db); $form = new Form($db); $ecmdirstatic = new EcmDirectory($db); -// Load full tree of ECM module from database. We will use it to define nbofsubdir and nboffilesinsubdir +// Load full manual tree of ECM module from database. We will use it to define nbofsubdir and nboffilesinsubdir if (empty($sqltree)) { $sqltree = $ecmdirstatic->get_full_arbo(0); } @@ -169,7 +169,7 @@ if (!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_ if (empty($conf->use_javascript_ajax) || !empty($conf->global->MAIN_ECM_DISABLE_JS)) { print '