Merge pull request #2 from Dolibarr/develop

pull from develop
This commit is contained in:
Tobias Sekan 2020-02-27 09:00:55 +01:00 committed by GitHub
commit 4f0663e3d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 411 additions and 134 deletions

View File

@ -3,7 +3,7 @@ name: "Close stale issues (bugs and feature requests)"
on:
schedule:
- cron: "0 0 * * *"
- cron: "0 20 * * *"
jobs:
stale:

View File

@ -11,4 +11,4 @@ objectclass: dcObject
objectClass: organization
objectClass: top
dc: my-domain
o: Mon organisation
o: my organisation

View File

@ -12,4 +12,4 @@ objectclass: dcObject
objectClass: organization
objectClass: top
dc: my-domain
o: Mon organisation
o: my organisation

View File

@ -1,7 +1,7 @@
* Page with licence compatibility
* Page with license compatibility
https://www.gnu.org/licenses/quick-guide-gplv3.fr.html
* FAQ on GPL licence
* FAQ on GPL license
https://www.fsf.org/licensing/licenses/gpl-faq.html
* Questions/Answers on Fork for using Dolibarr as a SaaS

View File

@ -1,2 +1,2 @@
To test a SEPA file:
http://www.mesfluxdepaiement.fr/testez-vos-fichiers-sepa
To test a SEPA file:
https://www.mesfluxdepaiement.fr/testez-vos-fichiers-sepa

View File

@ -3,11 +3,12 @@ README (English)
This directory contains tools to generate translation files for a new
languages or to update translation files for existing languages.
See Dolibarr Wiki page:
http://wiki.dolibarr.org/index.php/Translator_documentation
https://wiki.dolibarr.org/index.php/Translator_documentation
For more information on how to use them.
for Linux OS:
To install transifex client:
sudo pip install --upgrade transifex-client
To update transifex client:
sudo pip install --upgrade transifex-client
sudo pip install --upgrade transifex-client

12
doc/user/README-DE.md Normal file
View File

@ -0,0 +1,12 @@
README (german)
LiesMich (deutsch)
--------------------------------
Benutzeranleitung
--------------------------------
Alle Dolibarr-Informationen sind online verfuegbar ueber die Webseiten:
https://www.dolibarr.de
oder
https://www.dolibarr.org
https://wiki.dolibarr.org

View File

@ -47,6 +47,8 @@ $search_accountparent = GETPOST('search_accountparent', 'alpha');
$search_pcgtype = GETPOST('search_pcgtype', 'alpha');
$search_pcgsubtype = GETPOST('search_pcgsubtype', 'alpha');
$chartofaccounts = GETPOST('chartofaccounts', 'int');
// Security check
if ($user->socid > 0) accessforbidden();
if (!$user->rights->accounting->chartofaccount) accessforbidden();
@ -104,11 +106,9 @@ if (empty($reshook))
$search_pcgsubtype = "";
$search_array_options = array();
}
if (GETPOST('change_chart', 'alpha') && (GETPOST('valid_change_chart', 'int') || empty($conf->use_javascript_ajax)))
if ((GETPOST('valid_change_chart', 'alpha') && GETPOST('chartofaccounts', 'int') > 0) // explicit click on button 'Change and load' with js on
|| (GETPOST('chartofaccounts', 'int') > 0 && GETPOST('chartofaccounts', 'int') != $conf->global->CHARTOFACCOUNTS)) // a submit of form is done and chartofaccounts combo has been modified
{
$chartofaccounts = GETPOST('chartofaccounts', 'int');
if ($chartofaccounts > 0)
{
// Get language code for this $chartofaccounts
@ -279,21 +279,13 @@ if ($resql)
if (!empty($conf->use_javascript_ajax))
{
print '<!-- Add javascript to update a flag when we select "Change plan" -->
print '<!-- Add javascript to reload page when we click "Change plan" -->
<script type="text/javascript">
$(document).ready(function () {
$("#searchFormList").on("submit", function (e) {
//event.preventDefault();
//var form = this;
console.log("chartofaccounts focus = "+$("#chartofaccounts").is(":focus"));
console.log("change_chart focus = "+$("#change_chart").is(":focus"));
if ($("#change_chart").is(":focus"))
{
console.log("We set valid_change_chart to 1");
$("#valid_change_chart").val(1);
}
//form.submit();
return true;
$("#change_chart").on("click", function (e) {
console.log("chartofaccounts seleted = "+$("#chartofaccounts").val());
// reload page
window.location.href = "'.$_SERVER["PHP_SELF"].'?valid_change_chart=1&chartofaccounts="+$("#chartofaccounts").val();
});
});
</script>';
@ -340,8 +332,7 @@ if ($resql)
else dol_print_error($db);
print "</select>";
print ajax_combobox("chartofaccounts");
print '<input type="submit" class="button" name="change_chart" id="change_chart" value="'.dol_escape_htmltag($langs->trans("ChangeAndLoad")).'">';
print '<input type="hidden" name="valid_change_chart" id="valid_change_chart" value="0">';
print '<input type="'.(empty($conf->use_javascript_ajax)?'submit':'button').'" class="button" name="change_chart" id="change_chart" value="'.dol_escape_htmltag($langs->trans("ChangeAndLoad")).'">';
print '<br>';
print '<br>';

View File

@ -573,6 +573,18 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
'recordevent'=>'RecordEvent');
if ($conf->projet->enabled) $arrayoftypes['project'] = 'CreateLeadAndThirdParty';
if ($conf->ticket->enabled) $arrayoftypes['ticket'] = 'CreateTicketAndThirdParty';
// support hook for add action
$parameters = array( 'arrayoftypes' => $arrayoftypes ) ;
$res = $hookmanager->executeHooks('addMoreActionsEmailCollector', $parameters, $object, $action);
if($res)
$arrayoftypes = $hookmanager->resArray;
else
foreach($hookmanager->resArray as $k=>$desc)
$arrayoftypes[$k]=$desc;
print $form->selectarray('operationtype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', 'maxwidth300');
print '</td><td>';
print '<input type="text" name="operationparam">';

View File

@ -58,6 +58,13 @@ if (GETPOST('cancel', 'alpha'))
$action='';
}
// Convert action set_XXX and del_XXX to set var (this is used when no javascript on for ajax_constantonoff)
$regs = array();
if (preg_match('/^(set|del)_([A-Z_]+)$/', $action, $regs)) {
if ($regs[1] == 'set') dolibarr_set_const($db, $regs[2], 1, 'chaine', 0, '', $conf->entity);
else dolibarr_del_const($db, $regs[2], $conf->entity);
}
if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACKGROUND))
{
dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV+1, 'chaine', 0, '', $conf->entity);
@ -81,15 +88,15 @@ if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACK
if ($action == 'update')
{
dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["MAIN_LANG_DEFAULT"], 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_LANG_DEFAULT", GETPOST("MAIN_LANG_DEFAULT", 'aZ09'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV+1, 'chaine', 0, '', $conf->entity);
//dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["MAIN_MULTILANGS"], 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"], 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_THEME", GETPOST("main_theme", 'aZ09'), 'chaine', 0, '', $conf->entity);
$val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE');
/*$val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE');
if (! $val) dolibarr_del_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', $conf->entity);
else dolibarr_set_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', GETPOST('THEME_TOPMENU_DISABLE_IMAGE'), 'chaine', 0, '', $conf->entity);
else dolibarr_set_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', GETPOST('THEME_TOPMENU_DISABLE_IMAGE'), 'chaine', 0, '', $conf->entity);*/
$val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'), array()))));
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKBODY', $conf->entity);
@ -141,25 +148,27 @@ if ($action == 'update')
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_USE_CHECKED', $conf->entity);
else dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", $val, 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"], 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"], 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["MAIN_DISABLE_JAVASCRIPT"], 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"], 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"], 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", $_POST["MAIN_DEFAULT_WORKING_DAYS"], 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"], 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"], 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"], 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", GETPOST("main_size_liste_limit", 'int'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", GETPOST("main_size_shortliste_limit", 'int'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"], 'chaine', 0, '', 0); // Param for all entities
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"], 'chaine', 0, '', 0); // Param for all entities
dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"], 'chaine', 0, '', $conf->entity);
//dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", GETPOST("MAIN_DISABLE_JAVASCRIPT", 'aZ09'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", GETPOST("MAIN_BUTTON_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_START_WEEK", GETPOST("MAIN_START_WEEK", 'int'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'int'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'int'), 'chaine', 0, '', $conf->entity);
//dolibarr_set_const($db, "MAIN_SHOW_LOGO", GETPOST("MAIN_SHOW_LOGO", 'aZ09'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", GETPOST('MAIN_HELPCENTER_DISABLELINK', 'aZ09'), 'chaine', 0, '', 0); // Param for all entities
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr(GETPOST("main_motd", 'none')), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr(GETPOST("main_home", 'none')), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", GETPOST("MAIN_HELP_DISABLELINK", 'aZ09'), 'chaine', 0, '', 0); // Param for all entities
dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", GETPOST('MAIN_BUGTRACK_ENABLELINK', 'aZ09'), 'chaine', 0, '', $conf->entity);
$varforimage='imagebackground'; $dirforimage=$conf->mycompany->dir_output.'/logos/';
if ($_FILES[$varforimage]["tmp_name"])
{
$reg = array();
if (preg_match('/([^\\/:]+)$/i', $_FILES[$varforimage]["name"], $reg))
{
$original_file=$reg[1];
@ -248,7 +257,7 @@ print '</tr>';
// Multilingual GUI
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("EnableMultilangInterface").'</td><td>';
print ajax_constantonoff('MAIN_MULTILANGS');
print ajax_constantonoff("MAIN_MULTILANGS", array(), $conf->entity, 0, 0, 1, 0);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
@ -267,7 +276,7 @@ print '</tr>';
// Disable javascript and ajax
print '<tr class="oddeven"><td>'.$langs->trans("DisableJavascript").'</td><td>';
print $form->selectyesno('MAIN_DISABLE_JAVASCRIPT', isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0, 1);
print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT", array(), $conf->entity, 0, 0, 1, 0);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';

View File

@ -278,6 +278,7 @@ dol_htmloutput_errors($mesg);
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="mode" value="label">';
print '<input type="hidden" name="action" value="builddoc">';
print '<input type="hidden" name="token" value="'.newtoken().'">';
print '<div class="tagtable">';

View File

@ -112,6 +112,10 @@ $permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc
$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php
$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
if (!empty($conf->expedition->enabled) && $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER = 1){
if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $object->warehouse_id = $conf->global->MAIN_DEFAULT_WAREHOUSE;
if (empty($object->warehouse_id) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) $object->warehouse_id = $user->fk_warehouse;
}
/*
* Actions

View File

@ -455,7 +455,7 @@ if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->
$sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_tva, ff.total_ttc, ff.tms, ff.paye";
$sql .= ", s.nom as name";
$sql .= ", s.rowid as socid";
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur";
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.email";
$sql .= ", SUM(pf.amount) as am";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn";
@ -503,10 +503,14 @@ if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->
$thirdpartystatic->id = $obj->socid;
$thirdpartystatic->name = $obj->name;
$thirdpartystatic->email = $obj->email;
$thirdpartystatic->country_id = 0;
$thirdpartystatic->country_code = '';
$thirdpartystatic->client = 0;
$thirdpartystatic->fournisseur = 1;
//$thirdpartystatic->code_client = $obj->code_client;
$thirdpartystatic->code_client = '';
$thirdpartystatic->code_fournisseur = $obj->code_fournisseur;
//$thirdpartystatic->code_compta = $obj->code_compta;
$thirdpartystatic->code_compta = '';
$thirdpartystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
print '<tr class="oddeven nowraponall"><td>';

View File

@ -279,7 +279,7 @@ if ($action == 'create')
if (! empty($conf->banque->enabled))
{
print '<tr><td class="fieldrequired">'.$langs->trans("BankAccount").'</td><td>';
$form->select_comptes($_POST["accountid"], "accountid", 0, "courant=1", 1); // Affiche liste des comptes courant
$form->select_comptes(GETPOST("accountid", 'int'), "accountid", 0, "courant=1", 2); // List of bank account available
print '</td></tr>';
}

View File

@ -741,7 +741,7 @@ while ($i < min($num, $limit))
// Date
if (!empty($arrayfields['c.date_contrat']['checked']))
{
print '<td class="center">'.dol_print_date($db->jdate($obj->date_contrat), 'day', 'tzuser').'</td>';
print '<td class="center">'.dol_print_date($db->jdate($obj->date_contrat), 'day', 'tzserver').'</td>';
}
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';

View File

@ -127,15 +127,17 @@ class box_task extends ModeleBoxes
$boxcontent .= '<button type="submit" class="button">'.$langs->trans("Refresh").'</button>';
$boxcontent .= '</form>'."\n";
$boxcontent .= '</div>'."\n";
$boxcontent .= '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
jQuery("#idsubimg'.$this->boxcode.'").click(function() {
jQuery(".showiffilter'.$this->boxcode.'").toggle();
if (! empty($conf->use_javascript_ajax)) {
$boxcontent .= '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
jQuery("#idsubimg'.$this->boxcode.'").click(function() {
jQuery(".showiffilter'.$this->boxcode.'").toggle();
});
});
});
</script>';
// set cookie by js
$boxcontent .= '<script>date = new Date(); date.setTime(date.getTime()+(30*86400000)); document.cookie = "'.$cookie_name.'='.$filterValue.'; expires= " + date.toGMTString() + "; path=/ "; </script>';
</script>';
// set cookie by js
$boxcontent .= '<script>date = new Date(); date.setTime(date.getTime()+(30*86400000)); document.cookie = "'.$cookie_name.'='.$filterValue.'; expires= " + date.toGMTString() + "; path=/ "; </script>';
}
$this->info_box_contents[0][] = array(
'tr'=>'class="nohover showiffilter'.$this->boxcode.' hideobject"',
'td' => 'class="nohover"',

View File

@ -604,14 +604,14 @@ class DiscountAbsolute
$sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount';
$sql .= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc, '.MAIN_DB_PREFIX.'facture as f';
$sql .= ' WHERE rc.fk_facture_source=f.rowid AND rc.fk_facture = '.$invoice->id;
$sql .= ' AND (f.type = 2 OR f.type = 0)'; // Find discount coming from credit note or excess received
$sql .= ' AND f.type IN (' . Facture::TYPE_STANDARD . ', ' . Facture::TYPE_CREDIT_NOTE . ', ' . Facture::TYPE_SITUATION . ')'; // Find discount coming from credit note or excess received
}
elseif ($invoice->element == 'invoice_supplier')
{
$sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount';
$sql .= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc, '.MAIN_DB_PREFIX.'facture_fourn as f';
$sql .= ' WHERE rc.fk_invoice_supplier_source=f.rowid AND rc.fk_invoice_supplier = '.$invoice->id;
$sql .= ' AND (f.type = 2 OR f.type = 0)'; // Find discount coming from credit note or excess paid
$sql .= ' f.type IN (' . Facture::TYPE_STANDARD . ', ' . Facture::TYPE_CREDIT_NOTE . ')'; // Find discount coming from credit note or excess paid
}
else
{

View File

@ -742,7 +742,7 @@ class FormOther
if (!is_array($arrayofcolors) || count($arrayofcolors) < 1)
{
$langs->load("other");
if (empty($conf->dol_use_jmobile))
if (empty($conf->dol_use_jmobile) && !empty($conf->use_javascript_ajax))
{
$out .= '<link rel="stylesheet" media="screen" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/jpicker/css/jPicker-1.1.6.css" />';
$out .= '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jpicker/jpicker-1.1.6.js"></script>';
@ -788,7 +788,7 @@ class FormOther
}
else // In most cases, this is not used. We used instead function with no specific list of colors
{
if (empty($conf->dol_use_jmobile))
if (empty($conf->dol_use_jmobile) && !empty($conf->use_javascript_ajax))
{
$out .= '<link rel="stylesheet" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/colorpicker/jquery.colorpicker.css" type="text/css" media="screen" />';
$out .= '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/colorpicker/jquery.colorpicker.js" type="text/javascript"></script>';

View File

@ -1793,6 +1793,39 @@ class EmailCollector extends CommonObject
}
$tickettocreate->ref = $defaultref;
}
// Create event specific on hook
// this code action is hook..... for support this call
elseif (substr($operation['type'], 0, 4) == 'hook'){
global $hookmanager;
if(!is_object($hookmanager))
$hookmanager->initHooks(array('emailcollectorcard'));
$parameters = array(
'connection'=> $connection,
'imapemail'=>$imapemail,
'overview'=>$overview,
'from' => $from ,
'fromtext' => $fromtext,
'actionparam'=> $operation['actionparam'],
'thirdpartyid' => $thirdpartyid ,
'objectid'=>@$objectid,
'objectemail'=>@$objectemail,
'messagetext'=>$messagetext,
'subject'=>$subject,
'header'=>$header,
) ;
$res = $hookmanager->executeHooks('doCollectOneCollector', $parameters, $this, $operation['type']);
if($res < 0 )
$this->error = $hookmanager->resPrint;
}
if ($errorforthisaction)
{

View File

@ -657,7 +657,7 @@ if (empty($reshook))
$_GET['socid'] = $_POST['socid'];
$error++;
}
if (!($_POST['fac_replacement'] > 0)) {
if (! (GETPOST('fac_replacement', 'int') > 0)) {
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ReplaceInvoice")), null, 'errors');
}
@ -870,7 +870,7 @@ if (empty($reshook))
if (!$error && $_POST['origin'] && $_POST['originid'])
{
// Parse element/subelement (ex: project_task)
$element = $subelement = GETPOST('origin');
$element = $subelement = GETPOST('origin', 'alpha');
/*if (preg_match('/^([^_]+)_([^_]+)/i',$_POST['origin'],$regs))
{
$element = $regs[1];
@ -894,8 +894,8 @@ if (empty($reshook))
{
$element = 'projet';
}
$object->origin = GETPOST('origin');
$object->origin_id = GETPOST('originid');
$object->origin = GETPOST('origin', 'alpha');
$object->origin_id = GETPOST('originid', 'int');
require_once DOL_DOCUMENT_ROOT.'/'.$element.'/class/'.$subelement.'.class.php';

View File

@ -1896,7 +1896,7 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
</div>
</div>';
if (!defined('JS_JQUERY_DISABLE_DROPDOWN')) // This may be set by some pages that use different jquery version to avoid errors
if (!defined('JS_JQUERY_DISABLE_DROPDOWN') && !empty($conf->use_javascript_ajax)) // This may be set by some pages that use different jquery version to avoid errors
{
$btnUser .= '
<!-- Code to show/hide the user drop-down -->
@ -1941,7 +1941,9 @@ function top_menu_bookmark()
$html = '';
// Define $bookmarks
if (!empty($conf->bookmark->enabled) && $user->rights->bookmark->lire)
if (empty($conf->bookmark->enabled) || empty($user->rights->bookmark->lire)) return $html;
if (!defined('JS_JQUERY_DISABLE_DROPDOWN') && !empty($conf->use_javascript_ajax)) // This may be set by some pages that use different jquery version to avoid errors
{
include_once DOL_DOCUMENT_ROOT.'/bookmarks/bookmarks.lib.php';
$langs->load("bookmarks");

View File

@ -254,6 +254,9 @@ class FormProduct
$out.= $comboenhancement;
}
if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $selected = $conf->global->MAIN_DEFAULT_WAREHOUSE;
if (empty($selected) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) $selected = $user->fk_warehouse;
$out.='<select class="flat'.($morecss?' '.$morecss:'').'"'.($disabled?' disabled':'').' id="'.$htmlname.'" name="'.($htmlname.($disabled?'_disabled':'')).'">';
if ($empty) $out.='<option value="-1">'.($empty_label?$empty_label:'&nbsp;').'</option>';
foreach($this->cache_warehouses as $id => $arraytypes)

View File

@ -87,15 +87,18 @@ $fieldstosearchall = array(
// Definition of fields for list
$arrayfields = array(
'stockqty'=>array('type'=>'float', 'label'=>'PhysicalStock', 'enabled'=>1, 'visible'=>-2, 'position'=>70),
'estimatedvalue'=>array('type'=>'float', 'label'=>'EstimatedStockValue', 'enabled'=>1, 'visible'=>-2, 'position'=>71),
'sellvalue'=>array('type'=>'float', 'label'=>'EstimatedStockValueSell', 'enabled'=>1, 'visible'=>-2, 'position'=>72),
'e.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
'e.lieu'=>array('label'=>$langs->trans("LocationSummary"), 'checked'=>1),
'e.description'=>array('label'=>$langs->trans("Description"), 'checked'=>0),
'e.address'=>array('label'=>$langs->trans("Address"), 'checked'=>0),
'e.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0),
'e.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0),
'stockqty'=>array('type'=>'float', 'label'=>$langs->trans("PhysicalStock"), 'enabled'=>1, 'visible'=>-2, 'position'=>70),
'estimatedvalue'=>array('type'=>'float', 'label'=>$langs->trans("EstimatedStockValue"), 'enabled'=>1, 'visible'=>-2, 'position'=>71),
'sellvalue'=>array('type'=>'float', 'label'=>$langs->trans("EstimatedStockValueSell"), 'enabled'=>1, 'visible'=>-2, 'position'=>72),
'e.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>100),
);
foreach ($object->fields as $key => $val)
{
// If $val['visible']==0, then we never show the field
if (!empty($val['visible'])) $arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>($val['enabled'] && ($val['visible'] != 3)), 'position'=>$val['position']);
}
// Extra fields
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0)
{
@ -337,17 +340,46 @@ print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" :
// --------------------------------------------------------------------
print '<tr class="liste_titre_filter">';
print '<td class="liste_titre left">';
print '<input class="flat" type="text" name="search_ref" size="6" value="'.dol_escape_htmltag($search_ref).'">';
print '</td>';
print '<td class="liste_titre left">';
print '<input class="flat" type="text" name="search_label" size="10" value="'.dol_escape_htmltag($search_label).'">';
print '</td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
if (!empty($arrayfields['e.ref']['checked']))
{
print '<td class="liste_titre left">';
print '<input class="flat" type="text" name="search_ref" size="6" value="'.dol_escape_htmltag($search_ref).'">';
print '</td>';
}
if (!empty($arrayfields['e.lieu']['checked']))
{
print '<td class="liste_titre left">';
print '<input class="flat" type="text" name="search_label" size="10" value="'.dol_escape_htmltag($search_label).'">';
print '</td>';
}
if (!empty($arrayfields['e.description']['checked']))
{
print '<td class="liste_titre"></td>';
}
if (!empty($arrayfields['e.address']['checked']))
{
print '<td class="liste_titre"></td>';
}
if (!empty($arrayfields['e.zip']['checked']))
{
print '<td class="liste_titre"></td>';
}
if (!empty($arrayfields['e.town']['checked']))
{
print '<td class="liste_titre"></td>';
}
if (!empty($arrayfields['stockqty']['checked']))
{
print '<td class="liste_titre"></td>';
}
if (!empty($arrayfields['estimatedvalue']['checked']))
{
print '<td class="liste_titre"></td>';
}
if (!empty($arrayfields['sellvalue']['checked']))
{
print '<td class="liste_titre"></td>';
}
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
@ -357,9 +389,12 @@ $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $obje
print $hookmanager->resPrint;
// Status
print '<td class="liste_titre right">';
print $form->selectarray('search_status', $warehouse->statuts, $search_status, 1, 0, 0, '', 1);
print '</td>';
if (!empty($arrayfields['e.statut']['checked']))
{
print '<td class="liste_titre right">';
print $form->selectarray('search_status', $warehouse->statuts, $search_status, 1, 0, 0, '', 1);
print '</td>';
}
// Action column
print '<td class="liste_titre maxwidthsearch">';
@ -371,18 +406,57 @@ print '</tr>'."\n";
// Fields title label
// --------------------------------------------------------------------
print '<tr class="liste_titre">';
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "e.ref", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("LocationSummary", $_SERVER["PHP_SELF"], "e.lieu", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("PhysicalStock", $_SERVER["PHP_SELF"], "stockqty", '', $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("EstimatedStockValue", $_SERVER["PHP_SELF"], "estimatedvalue", '', $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("EstimatedStockValueSell", $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'right ');
if (!empty($arrayfields['e.ref']['checked']))
{
print_liste_field_titre($arrayfields['e.ref']['label'], $_SERVER["PHP_SELF"], "e.ref", "", $param, "", $sortfield, $sortorder);
}
if (!empty($arrayfields['e.lieu']['checked']))
{
print_liste_field_titre($arrayfields['e.lieu']['label'], $_SERVER["PHP_SELF"], "e.lieu", "", $param, "", $sortfield, $sortorder);
}
if (!empty($arrayfields['e.description']['checked']))
{
print_liste_field_titre($arrayfields['e.description']['label'], $_SERVER["PHP_SELF"], "e.description", "", $param, "", $sortfield, $sortorder);
}
if (!empty($arrayfields['e.address']['checked']))
{
print_liste_field_titre($arrayfields['e.address']['label'], $_SERVER["PHP_SELF"], "e.address", "", $param, "", $sortfield, $sortorder);
}
if (!empty($arrayfields['e.zip']['checked']))
{
print_liste_field_titre($arrayfields['e.zip']['label'], $_SERVER["PHP_SELF"], "e.zip", "", $param, "", $sortfield, $sortorder);
}
if (!empty($arrayfields['e.town']['checked']))
{
print_liste_field_titre($arrayfields['e.town']['label'], $_SERVER["PHP_SELF"], "e.town", "", $param, "", $sortfield, $sortorder);
}
if (!empty($arrayfields['stockqty']['checked']))
{
print_liste_field_titre($arrayfields['stockqty']['label'], $_SERVER["PHP_SELF"], "stockqty", '', $param, '', $sortfield, $sortorder, 'right ');
}
if (!empty($arrayfields['estimatedvalue']['checked']))
{
print_liste_field_titre($arrayfields['estimatedvalue']['label'], $_SERVER["PHP_SELF"], "estimatedvalue", '', $param, '', $sortfield, $sortorder, 'right ');
}
if (!empty($arrayfields['sellvalue']['checked']))
{
print_liste_field_titre($arrayfields['sellvalue']['label'], $_SERVER["PHP_SELF"], "sellvalue", '', $param, '', $sortfield, $sortorder, 'right ');
}
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "e.statut", '', $param, '', $sortfield, $sortorder, 'right ');
if (!empty($arrayfields['e.statut']['checked']))
{
print_liste_field_titre($arrayfields['e.statut']['label'], $_SERVER["PHP_SELF"], "e.statut", '', $param, '', $sortfield, $sortorder, 'right ');
}
// Action column
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
print '</tr>'."\n";
@ -410,33 +484,84 @@ if ($num)
// Show here line of result
print '<tr class="oddeven">';
print '<td>'.$warehouse->getNomUrl(1).'</td>';
if (!$i) $totalarray['nbfield']++;
//print_r($arrayfields[]);
// Label (ref)
if (!empty($arrayfields['e.ref']['checked']))
{
print '<td>'.$warehouse->getNomUrl(1).'</td>';
}
// Location
print '<td>'.$obj->lieu.'</td>';
if (!$i) $totalarray['nbfield']++;
if (!empty($arrayfields['e.lieu']['checked']))
{
print '<td>'.$obj->lieu.'</td>';
}
// Description
if (!empty($arrayfields['e.description']['checked']))
{
print '<td>'.$obj->description.'</td>';
}
// Address
if (!empty($arrayfields['e.address']['checked']))
{
print '<td>'.$obj->address.'</td>';
}
// Zip
if (!empty($arrayfields['e.zip']['checked']))
{
print '<td>'.$obj->zip.'</td>';
}
if (!empty($arrayfields['e.town']['checked']))
{
print '<td>'.$obj->town.'</td>';
}
// Stock qty
print '<td class="right">'.price2num($obj->stockqty, 5).'</td>';
if (!$i) $totalarray['nbfield']++;
if (!empty($arrayfields['stockqty']['checked']))
{
print '<td class="right">'.price2num($obj->stockqty, 5).'</td>';
}
// PMP value
print '<td class="right">';
if (price2num($obj->estimatedvalue, 'MT')) print price(price2num($obj->estimatedvalue, 'MT'), 1);
else print '';
print '</td>';
if (!$i) $totalarray['nbfield']++;
if (!empty($arrayfields['estimatedvalue']['checked']))
{
print '<td class="right">';
if (price2num($obj->estimatedvalue, 'MT'))
{
print price(price2num($obj->estimatedvalue, 'MT'), 1);
}
else
{
print '';
}
print '</td>';
}
// Selling value
print '<td class="right">';
if (empty($conf->global->PRODUIT_MULTIPRICES)) print price(price2num($obj->sellvalue, 'MT'), 1);
else
if (!empty($arrayfields['sellvalue']['checked']))
{
$htmltext = $langs->trans("OptionMULTIPRICESIsOn");
print $form->textwithtooltip($langs->trans("Variable"), $htmltext);
print '<td class="right">';
if (empty($conf->global->PRODUIT_MULTIPRICES))
{
print price(price2num($obj->sellvalue, 'MT'), 1);
}
else
{
$htmltext = $langs->trans("OptionMULTIPRICESIsOn");
print $form->textwithtooltip($langs->trans("Variable"), $htmltext);
}
print '</td>';
}
print '</td>';
if (!$i) $totalarray['nbfield']++;
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
@ -446,8 +571,10 @@ if ($num)
print $hookmanager->resPrint;
// Status
print '<td class="right">'.$warehouse->LibStatut($obj->statut, 5).'</td>';
if (!$i) $totalarray['nbfield']++;
if (!empty($arrayfields['e.statut']['checked']))
{
print '<td class="right">'.$warehouse->LibStatut($obj->statut, 5).'</td>';
}
// Action column
print '<td class="nowrap center">';
@ -469,18 +596,81 @@ if ($num)
if ($totalnboflines - $offset <= $limit)
{
print '<tr class="liste_total">';
print '<td colspan="2" class="right">'.$langs->trans("Total").'</td>';
print '<td class="right">'.price2num($totalStock, 5).'</td>';
print '<td class="right">'.price(price2num($total, 'MT'), 1, $langs, 0, 0, -1, $conf->currency).'</td>';
print '<td class="right">';
if (empty($conf->global->PRODUIT_MULTIPRICES)) print price(price2num($totalsell, 'MT'), 1, $langs, 0, 0, -1, $conf->currency);
else
$emptyColumn = -1;
if (!empty($arrayfields['e.ref']['checked']))
{
$htmltext = $langs->trans("OptionMULTIPRICESIsOn");
print $form->textwithtooltip($langs->trans("Variable"), $htmltext);
$emptyColumn++;
}
print '</td>';
print '<td></td>';
if (!empty($arrayfields['e.lieu']['checked']))
{
$emptyColumn++;
}
if (!empty($arrayfields['e.description']['checked']))
{
$emptyColumn++;
}
if (!empty($arrayfields['e.address']['checked']))
{
$emptyColumn++;
}
if (!empty($arrayfields['e.zip']['checked']))
{
$emptyColumn++;
}
if (!empty($arrayfields['e.town']['checked']))
{
$emptyColumn++;
}
for ($i=0; $i < $emptyColumn; $i++)
{
print '<td></td>';
}
print '<td class="right">'.$langs->trans("Total").'</td>';
if (!empty($arrayfields['stockqty']['checked']))
{
print '<td class="right">'.price2num($totalStock, 5).'</td>';
}
if (!empty($arrayfields['estimatedvalue']['checked']))
{
print '<td class="right">'.price(price2num($total, 'MT'), 1, $langs, 0, 0, -1, $conf->currency).'</td>';
}
if (!empty($arrayfields['sellvalue']['checked']))
{
print '<td class="right">';
if (empty($conf->global->PRODUIT_MULTIPRICES)) print price(price2num($totalsell, 'MT'), 1, $langs, 0, 0, -1, $conf->currency);
else
{
$htmltext = $langs->trans("OptionMULTIPRICESIsOn");
print $form->textwithtooltip($langs->trans("Variable"), $htmltext);
}
print '</td>';
}
if (empty($extrafieldsobjectkey) && is_object($object)) $extrafieldsobjectkey = $object->table_element;
if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label']))
{
if (empty($extrafieldsobjectprefix)) $extrafieldsobjectprefix = 'ef.';
foreach ($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val)
{
if (!empty($arrayfields[$extrafieldsobjectprefix.$key]['checked']))
{
print '<td></td>';
}
}
}
if (!empty($arrayfields['e.statut']['checked']))
{
print '<td></td>';
}
print '<td></td>';
print "</tr>\n";
}

View File

@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php';
// Load translation files required by the page
$langs->loadLangs(array('stock', 'other', 'productbatch'));
$langs->loadLangs(array('stocks', 'other', 'productbatch'));
// Get parameters
$id = GETPOST('id', 'int');

View File

@ -167,6 +167,13 @@ if ($action == 'valid' && $user->rights->facture->creer)
$invoice->fk_facture_source = $fk_source;
$invoice->update($user);
}
$sav_FACTURE_ADDON='';
if (! empty($conf->global->TAKEPOS_ADDON))
{
$sav_FACTURE_ADDON = $conf->global->FACTURE_ADDON;
$conf->global->FACTURE_ADDON = $conf->global->TAKEPOS_ADDON;
}
$constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"];
if ($invoice->statut != Facture::STATUS_DRAFT)
@ -204,6 +211,12 @@ if ($action == 'valid' && $user->rights->facture->creer)
$res = $invoice->validate($user);
}
// Restore save values
if (! empty($sav_FACTURE_ADDON))
{
$conf->global->FACTURE_ADDON = $sav_FACTURE_ADDON;
}
$remaintopay = $invoice->getRemainToPay();
// Add the payment

View File

@ -1537,7 +1537,7 @@ td.nobordernopadding.widthpictotitle.opacityhigh.valignmiddle.col-picto {
}
.pictotitle {
margin-<?php echo $right; ?>: 8px;
margin-bottom: 4px;
/* margin-bottom: 4px; */
}
@media only screen and (max-width: 767px)
{
@ -1638,9 +1638,9 @@ div.statusrefbis {
vertical-align: text-bottom;
}
img.photoref, div.photoref {
border: 1px solid #DDD;
-webkit-box-shadow: 0px 0px 6px #DDD;
box-shadow: 0px 0px 6px #DDD;
/* border: 1px solid #DDD; */
-webkit-box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2), 0px 0px 2px rgba(0, 0, 0, 0.1);
box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2), 0px 0px 2px rgba(0, 0, 0, 0.1);
padding: 4px;
height: 80px;
width: 80px;