Merge remote-tracking branch 'upstream/develop' into free_email

This commit is contained in:
Frédéric FRANCE 2020-05-05 18:37:56 +02:00
commit 93cac43306
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
147 changed files with 1561 additions and 637 deletions

View File

@ -194,22 +194,6 @@ tools:
- 'test/*'
- 'htdocs/includes/*'
paths: { }
php_changetracking:
enabled: false
bug_patterns:
- '\bfix(?:es|ed)?\b'
feature_patterns:
- '\badd(?:s|ed)?\b'
- '\bimplement(?:s|ed)?\b'
filter:
excluded_paths:
- 'build/*'
- 'dev/*'
- 'doc/*'
- 'test/*'
- 'htdocs/includes/*'
paths: { }
# Coding-Style / Bug Detection
js_hint:

View File

@ -28,7 +28,7 @@ Other licenses apply for some included dependencies. See [COPYRIGHT](https://git
If you have low technical skills and you're looking to install Dolibarr ERP/CRM in just a few clicks, you can use one of the packaged versions:
- [DoliWamp for Windows](https://wiki.dolibarr.org/index.php/Dolibarr_for_Windows_(DoliWamp)
- DoliDeb for Debian or Ubuntu
- [DoliDeb for Debian](https://wiki.dolibarr.org/index.php/Dolibarr_for_Ubuntu_or_Debian
- DoliRpm for Redhat, Fedora, OpenSuse, Mandriva or Mageia
Releases can be downloaded from [official website](https://www.dolibarr.org/).

View File

@ -67,19 +67,11 @@
</rule>
<!--
<!-- Warnings on TODO -->
<!-- Disabled: We want to keep TODO as normal
<rule ref="Generic.Commenting.Todo" />
-->
<!-- Warning if action on same line than if -->
<!--
<rule ref="Generic.ControlStructures.InlineControlStructure">
<properties>
<property name="error" value="false"/>
</properties>
</rule>
-->
<!-- PHP code MUST use only UTF-8 without BOM. -->
<rule ref="Generic.Files.ByteOrderMark"/>
@ -99,19 +91,33 @@
</properties>
</rule>
<!-- Disallow several statements on same line -->
<!-- Warning if action on same line than if -->
<!-- Disabled: We want to allow this for better code compacity and readability
<rule ref="Generic.ControlStructures.InlineControlStructure">
<properties>
<property name="error" value="false"/>
</properties>
</rule>
-->
<!-- We want to allow 'if () { ...small code... }' on same line for better code compacity and readability -->
<rule ref="Generic.Formatting.DisallowMultipleStatements">
<severity>0</severity>
</rule>
<!-- Have 2 chars padding maximum and always show as errors -->
<!--
<rule ref="Generic.Formatting.MultipleStatementAlignment">
<properties> <property name="maxPadding" value="2"/> <property
name="ignoreMultiLine" value="true"/> </properties> </rule>
-->
<!-- Check assignement have the = align on each line. Have 20 chars padding maximum and always show as errors -->
<!-- Disabled: Report some false warning
<rule ref="Generic.Formatting.MultipleStatementAlignment">
<properties>
<property name="maxPadding" value="20"/>
<property name="ignoreMultiLine" value="true"/>
</properties>
</rule>
-->
<rule ref="Generic.Formatting.SpaceAfterCast" />
<rule ref="Generic.Functions.CallTimePassByReference" />
@ -127,7 +133,7 @@
<!-- Tweaks to metrics -->
<rule ref="Generic.Metrics.CyclomaticComplexity">
<properties>
<property name="complexity" value="150" />
<property name="complexity" value="250" />
<property name="absoluteComplexity" value="300" />
</properties>
</rule>
@ -181,6 +187,13 @@
</properties>
</rule>
<!-- Check for duplicate class names -->
<!-- Disabled: We need this for dependency injection.
<rule ref="Generic.Classes.DuplicateClassName" />
-->
<!-- Rules from Squiz Standard -->
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" />
@ -190,13 +203,10 @@
<property name="ignoreBlankLines" value="false"/>
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile">
<severity>0</severity>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile">
<severity>0</severity>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines">
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile" />
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile" />
<!-- Disabled: We want to have 2 empty line as separator sometimes -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" >
<severity>0</severity>
</rule>
@ -208,7 +218,6 @@
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration.SpaceAfterFunction">
<severity>0</severity>
</rule>
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
<properties>
@ -220,23 +229,16 @@
</rule>
<rule ref="Squiz.Scope.MethodScope.Missing" />
<!-- Rules from PEAR Standard -->
<rule ref="PEAR.Classes.ClassDeclaration" />
<!-- Check for duplicate class names -->
<!-- <rule ref="Generic.Classes.DuplicateClassName" /> -->
<rule ref="PEAR.Commenting.ClassComment" />
<!-- TODO Remove this and fix reported errors -->
<rule ref="PEAR.Commenting.ClassComment.Missing">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing" />
<rule ref="PEAR.Commenting.ClassComment.MissingTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingTag" />
<rule ref="PEAR.Commenting.ClassComment.MissingAuthorTag">
<severity>0</severity>
@ -245,67 +247,38 @@
<rule ref="PEAR.Commenting.ClassComment.MissingCategoryTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingLicenseTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingLinkTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingPackageTag">
<severity>0</severity>
</rule>
<!--
<rule ref="PEAR.Commenting.FileComment" />
<rule ref="PEAR.Commenting.FileComment.WrongStyle">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FileComment.MissingVersion">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FileComment.MissingTag">
<severity>0</severity>
</rule>
-->
<rule ref="PEAR.Commenting.FunctionComment" />
<rule ref="PEAR.Commenting.FunctionComment.Empty">
<severity>5</severity>
</rule>
<!--<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
<severity>0</severity>
</rule>-->
<!--<rule ref="PEAR.Commenting.FunctionComment.Missing">
<severity>0</severity>
</rule>-->
<rule ref="PEAR.Commenting.FunctionComment.Empty" />
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType" />
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName" />
<rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired" />
<rule ref="PEAR.Commenting.FunctionComment.WrongStyle">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingBeforeParamType">
<severity>0</severity>
</rule>
@ -342,6 +315,7 @@
<rule ref="PEAR.Files.IncludingFile.UseInclude">
<severity>0</severity>
</rule>
<!-- TODO Enable this test. We should use require for include in prior of include when out of if -->
<rule ref="PEAR.Files.IncludingFile.UseIncludeOnce">
<severity>0</severity>

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

View File

@ -122,6 +122,10 @@ if ($action == 'update')
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLE', $conf->entity);
else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLE', $val, 'chaine', 0, '', $conf->entity);
$val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLELINK'), array()))));
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLELINK', $conf->entity);
else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLELINK', $val, 'chaine', 0, '', $conf->entity);
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_LINEIMPAIR1'), array()))));
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEIMPAIR1', $conf->entity);
else dolibarr_set_const($db, 'THEME_ELDY_LINEIMPAIR1', $val, 'chaine', 0, '', $conf->entity);

View File

@ -34,10 +34,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Noti
$langs->loadLangs(array('admin', 'other', 'orders', 'propal', 'bills', 'errors', 'mails'));
// Security check
if (!$user->admin)
accessforbidden();
if (!$user->admin) {
accessforbidden();
}
$action = GETPOST('action', 'aZ09');
$error = 0;
/*
@ -45,27 +47,48 @@ $action = GETPOST('action', 'aZ09');
*/
// Action to update or add a constant
if ($action == 'update' || $action == 'add')
if ($action == 'settemplates')
{
$constlineid = GETPOST('rowid', 'int');
$constname = GETPOST('constname', 'alpha');
$db->begin();
$constvalue = (GETPOSTISSET('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname, 'alpha') : GETPOST('constvalue'));
$consttype = (GETPOSTISSET('consttype_'.$constname) ? GETPOST('consttype_'.$constname, 'alphanohtml') : GETPOST('consttype'));
$constnote = (GETPOSTISSET('constnote_'.$constname) ? GETPOST('constnote_'.$constname, 'none') : GETPOST('constnote'));
if (!$error && is_array($_POST))
{
$reg = array();
foreach ($_POST as $key => $val)
{
if (!preg_match('/^constvalue_(.*)_TEMPLATE/', $key, $reg)) continue;
$typetouse = empty($oldtypetonewone[$consttype]) ? $consttype : $oldtypetonewone[$consttype];
$triggername = $reg[1];
$constvalue = GETPOST($key, 'alpha');
$consttype = 'emailtemplate:xxx';
$tmparray=explode(':', $constvalue);
if (! empty($tmparray[0]) && ! empty($tmparray[1])) {
$constvalue = $tmparray[0];
$consttype = 'emailtemplate:'.$tmparray[1];
//var_dump($constvalue);
//var_dump($consttype);
$res = dolibarr_set_const($db, $triggername.'_TEMPLATE', $constvalue, $consttype, 0, '', $conf->entity);
if ($res < 0) {
$error++;
break;
}
} else {
$res = dolibarr_del_const($db, $triggername.'_TEMPLATE', $conf->entity);
}
}
}
$res = dolibarr_set_const($db, $constname, $constvalue, $typetouse, 0, $constnote, $conf->entity);
if (!$res > 0) $error++;
if (!$error)
{
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
$db->rollback();
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -74,12 +97,31 @@ if ($action == 'setvalue' && $user->admin)
{
$db->begin();
$result = dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM", $_POST["email_from"], 'chaine', 0, '', $conf->entity);
$result = dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM", GETPOST("email_from", "none"), 'chaine', 0, '', $conf->entity);
if ($result < 0) $error++;
if (!$error)
{
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
$db->rollback();
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
if ($action == 'setfixednotif' && $user->admin)
{
$db->begin();
if (!$error && is_array($_POST))
{
//var_dump($_POST);
$reg = array();
foreach ($_POST as $key => $val)
{
@ -101,7 +143,7 @@ if ($action == 'setvalue' && $user->admin)
}
elseif (preg_match('/^NOTIF_(.*)_new_key/', $key, $reg))
{
// Add a new entry
// Add a new entry
$newkey = 'NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.((int) GETPOST($shortkey.'_amount'));
$newval = GETPOST($shortkey.'_key');
}
@ -168,9 +210,18 @@ print '</td>';
print '</tr>';
print '</table>';
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
print '</form>';
print '<br><br>';
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="settemplates">';
// Notification per contacts
$title = $langs->trans("ListOfNotificationsPerUser");
if (!empty($conf->societe->enabled)) $title = $langs->trans("ListOfNotificationsPerUserOrContact");
@ -211,7 +262,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
}
$helptext = '';
form_constantes($constantes, 0, $helptext);
form_constantes($constantes, 2, $helptext);
} else {
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
@ -248,14 +299,18 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
print '</table>';
}
print '<div class="opacitymedium">';
print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
if (!empty($conf->societe->enabled)) print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
print '</form>';
print '</div>';
print '<br><br>';
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="setfixednotif">';
print load_fiche_titre($langs->trans("ListOfFixedNotifications"), '', '');
print '<table class="noborder centpercent">';
@ -333,6 +388,12 @@ foreach ($listofnotifiedevents as $notifiedevent)
}
print '</table>';
print '<div class="opacitymedium">';
print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
if (!empty($conf->societe->enabled)) print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
print '</div>';
print '<br>';
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';

View File

@ -18,7 +18,7 @@
// Create the autoloader for Luracast
require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/AutoLoader.php';
call_user_func(function() {
call_user_func(function () {
$loader = Luracast\Restler\AutoLoader::instance();
spl_autoload_register($loader);
return $loader;

View File

@ -44,7 +44,7 @@ if (!$res) die("Include of main fails");
require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/AutoLoader.php';
call_user_func(function() {
call_user_func(function () {
$loader = Luracast\Restler\AutoLoader::instance();
spl_autoload_register($loader);
return $loader;

View File

@ -979,7 +979,6 @@ class BOM extends CommonObject
*
* @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
*/
//public function doScheduledJob($param1, $param2, ...)
public function doScheduledJob()
{
global $conf, $langs;

View File

@ -556,6 +556,12 @@ foreach ($accounts as $key=>$type)
}
// Extra fields
if (is_array($objecttmp->array_options)) {
$obj = new stdClass();
foreach ($objecttmp->array_options as $k => $v) {
$obj->$k = $v;
}
}
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields);

View File

@ -297,7 +297,15 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
if ($massaction == 'withdrawrequest')
if ($massaction == 'makepayment'){
$arrayofselected=is_array($toselect)?$toselect:array();
$loc = dol_buildpath('/compta/paiement.php', 2).'?action=create&facids='.implode(',', $arrayofselected);
header('Location: '.$loc);
exit;
}
elseif ($massaction == 'withdrawrequest')
{
$langs->load("withdrawals");
@ -657,6 +665,7 @@ if ($resql)
'generate_doc'=>$langs->trans("ReGeneratePDF"),
'builddoc'=>$langs->trans("PDFMerge"),
'presend'=>$langs->trans("SendByMail"),
//'makepayment'=>$langs->trans("InvoicePaymentsLimits"), TODO Blank page when using this
);
if ($conf->prelevement->enabled) {
$langs->load("withdrawals");

View File

@ -521,7 +521,9 @@ if (empty($reshook))
}
$desc = $prod->description;
$desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) $desc = $product_desc;
else $desc = dol_concatdesc($desc, $product_desc, '', !empty($conf->global->MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION));
$fk_unit = $prod->fk_unit;
}
else

View File

@ -360,7 +360,7 @@ if ($result)
$obj = $db->fetch_object($result);
print '<tr class="oddeven">';
print '<td width="110" class="nowrap">';
print '<td class="nowraponall">';
$staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->cid);
$staticcontrat->id = $obj->cid;
print $staticcontrat->getNomUrl(1, 16);
@ -425,7 +425,7 @@ if ($resql)
$obj = $db->fetch_object($resql);
print '<tr class="oddeven">';
print '<td width="110" class="nowrap">';
print '<td class="nowraponall">';
$staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->fk_contrat);
$staticcontrat->id = $obj->fk_contrat;
print $staticcontrat->getNomUrl(1, 16);
@ -506,7 +506,7 @@ if ($resql)
print '<tr class="oddeven">';
print '<td width="110" class="nowrap">';
print '<td class="nowraponall">';
$staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->fk_contrat);
$staticcontrat->id = $obj->fk_contrat;
print $staticcontrat->getNomUrl(1, 16);
@ -586,7 +586,7 @@ if ($resql)
print '<tr class="oddeven">';
print '<td width="110" class="nowrap">';
print '<td class="nowraponall">';
$staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->fk_contrat);
$staticcontrat->id = $obj->fk_contrat;
print $staticcontrat->getNomUrl(1, 16);

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2014-2019 Juanjo Menent <jmenent@2byte.es>
@ -612,9 +612,11 @@ while ($i < min($num, $limit))
}
print '<tr class="oddeven">';
// Ref
if (!empty($arrayfields['c.ref']['checked']))
{
print '<td class="nowrap">';
print '<td class="nowraponall">';
print $contracttmp->getNomUrl(1);
if ($obj->nb_late) print img_warning($langs->trans("Late"));
if (!empty($obj->note_private) || !empty($obj->note_public)) {
@ -631,6 +633,7 @@ while ($i < min($num, $limit))
print '</td>';
}
if (!empty($arrayfields['c.ref_customer']['checked']))
{
print '<td>'.$contracttmp->getFormatedCustomerRef($obj->ref_customer).'</td>';

View File

@ -56,7 +56,7 @@ $arrayresult = array();
if (!empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire)
{
$arrayresult['searchintomember'] = array('position'=>8, 'shortcut'=>'M', 'img'=>'object_user', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('', 'object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintomember'] = array('position'=>8, 'shortcut'=>'M', 'img'=>'object_member', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('', 'object_member').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
}
if (((!empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || !empty($conf->fournisseur->enabled)) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire)
@ -75,13 +75,18 @@ if (((!empty($conf->product->enabled) && $user->rights->produit->lire) || (!empt
$arrayresult['searchintoproduct'] = array('position'=>30, 'shortcut'=>'P', 'img'=>'object_product', 'label'=>$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'text'=>img_picto('', 'object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
}
if (!empty($conf->mrp->enabled) && $user->rights->mrp->read && empty($conf->global->MAIN_SEARCHFORM_MRP_DISABLED))
{
$arrayresult['searchintomo'] = array('position'=>35, 'shortcut'=>'', 'img'=>'object_mrp', 'label'=>$langs->trans("SearchIntoMO", $search_boxvalue), 'text'=>img_picto('', 'object_mrp').' '.$langs->trans("SearchIntoMO", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/mrp/mo_list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire)
{
$arrayresult['searchintoprojects'] = array('position'=>40, 'shortcut'=>'Q', 'img'=>'object_projectpub', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('', 'object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintoprojects'] = array('position'=>40, 'shortcut'=>'Q', 'img'=>'object_projectpub', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('', 'object_project').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->rights->projet->lire)
{
$arrayresult['searchintotasks'] = array('position'=>45, 'img'=>'object_task', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('', 'object_task').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintotasks'] = array('position'=>45, 'img'=>'object_projecttask', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('', 'object_projecttask').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (!empty($conf->propal->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_PROPAL_DISABLED) && $user->rights->propal->lire)
@ -103,15 +108,15 @@ if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUST
if (!empty($conf->supplier_proposal->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_PROPAL_DISABLED) && $user->rights->supplier_proposal->lire)
{
$arrayresult['searchintosupplierpropal'] = array('position'=>100, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('', 'object_propal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintosupplierpropal'] = array('position'=>100, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_proposal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
}
if ((! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED) || ! empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire)
{
$arrayresult['searchintosupplierorder'] = array('position'=>110, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('', 'object_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintosupplierorder'] = array('position'=>110, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if ((! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED) || ! empty($conf->supplier_invoice->enabled)) && $user->rights->fournisseur->facture->lire)
{
$arrayresult['searchintosupplierinvoice'] = array('position'=>120, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_bill').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintosupplierinvoice'] = array('position'=>120, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_invoice').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
}
if (!empty($conf->contrat->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTRACT_DISABLED) && $user->rights->contrat->lire)
@ -122,6 +127,10 @@ if (!empty($conf->ficheinter->enabled) && empty($conf->global->MAIN_SEARCHFORM_F
{
$arrayresult['searchintointervention'] = array('position'=>140, 'img'=>'object_intervention', 'label'=>$langs->trans("SearchIntoInterventions", $search_boxvalue), 'text'=>img_picto('', 'object_intervention').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
}
if (!empty($conf->ticket->enabled) && empty($conf->global->MAIN_SEARCHFORM_TICKET_DISABLED) && $user->rights->ticket->read)
{
$arrayresult['searchintotickets'] = array('position'=>145, 'img'=>'object_ticket', 'label'=>$langs->trans("SearchIntoTickets", $search_boxvalue), 'text'=>img_picto('', 'object_ticket').' '.$langs->trans("SearchIntoTickets", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/ticket/list.php?mainmenu=ticket'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : ''));
}
// HR
if (!empty($conf->user->enabled) && empty($conf->global->MAIN_SEARCHFORM_USER_DISABLED) && $user->rights->user->user->lire)
@ -136,10 +145,6 @@ if (!empty($conf->holiday->enabled) && empty($conf->global->MAIN_SEARCHFORM_HOLI
{
$arrayresult['searchintoleaves'] = array('position'=>220, 'img'=>'object_holiday', 'label'=>$langs->trans("SearchIntoLeaves", $search_boxvalue), 'text'=>img_picto('', 'object_holiday').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : ''));
}
if (!empty($conf->ticket->enabled) && empty($conf->global->MAIN_SEARCHFORM_TICKET_DISABLED) && $user->rights->ticket->read)
{
$arrayresult['searchintotickets'] = array('position'=>220, 'img'=>'object_ticket', 'label'=>$langs->trans("SearchIntoTickets", $search_boxvalue), 'text'=>img_picto('', 'object_ticket').' '.$langs->trans("SearchIntoTickets", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/ticket/list.php?mainmenu=ticket'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : ''));
}
/* Do we really need this. We already have a select for users, and we should be able to filter into user list on employee flag

View File

@ -1295,7 +1295,7 @@ abstract class CommonDocGenerator
if (!empty($fields))
{
// Sort extrafields by rank
uasort($fields, function($a, $b) {
uasort($fields, function ($a, $b) {
return ($a->rank > $b->rank) ? -1 : 1;
});

View File

@ -1669,24 +1669,24 @@ class Form
/**
* Return select list of users
*
* @param string $selected User id or user object of user preselected. If 0 or < -2, we use id of current user. If -1, keep unselected (if empty is allowed)
* @param string $htmlname Field name in form
* @param int $show_empty 0=list with no empty value, 1=add also an empty value into list
* @param array $exclude Array list of users id to exclude
* @param int $disabled If select list must be disabled
* @param array|string $include Array list of users id to include or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me
* @param array $enableonly Array list of users id to be enabled. If defined, it means that others will be disabled
* @param string $force_entity '0' or Ids of environment to force
* @param int $maxlength Maximum length of string into list (0=no limit)
* @param int $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status
* @param string $morefilter Add more filters into sql request (Example: 'employee = 1')
* @param integer $show_every 0=default list, 1=add also a value "Everybody" at beginning of list
* @param string $enableonlytext If option $enableonlytext is set, we use this text to explain into label why record is disabled. Not used if enableonly is empty.
* @param string $morecss More css
* @param int $noactive Show only active users (this will also happened whatever is this option if USER_HIDE_INACTIVE_IN_COMBOBOX is on).
* @param int $outputmode 0=HTML select string, 1=Array
* @param bool $multiple add [] in the name of element and add 'multiple' attribut
* @return string HTML select string
* @param string $selected User id or user object of user preselected. If 0 or < -2, we use id of current user. If -1, keep unselected (if empty is allowed)
* @param string $htmlname Field name in form
* @param int $show_empty 0=list with no empty value, 1=add also an empty value into list
* @param array $exclude Array list of users id to exclude
* @param int $disabled If select list must be disabled
* @param array|string $include Array list of users id to include. User '' for all users or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me
* @param array $enableonly Array list of users id to be enabled. If defined, it means that others will be disabled
* @param string $force_entity '0' or Ids of environment to force
* @param int $maxlength Maximum length of string into list (0=no limit)
* @param int $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status
* @param string $morefilter Add more filters into sql request (Example: 'employee = 1')
* @param integer $show_every 0=default list, 1=add also a value "Everybody" at beginning of list
* @param string $enableonlytext If option $enableonlytext is set, we use this text to explain into label why record is disabled. Not used if enableonly is empty.
* @param string $morecss More css
* @param int $noactive Show only active users (this will also happened whatever is this option if USER_HIDE_INACTIVE_IN_COMBOBOX is on).
* @param int $outputmode 0=HTML select string, 1=Array
* @param bool $multiple add [] in the name of element and add 'multiple' attribut
* @return string HTML select string
* @see select_dolgroups()
*/
public function select_dolusers($selected = '', $htmlname = 'userid', $show_empty = 0, $exclude = null, $disabled = 0, $include = '', $enableonly = '', $force_entity = '0', $maxlength = 0, $showstatus = 0, $morefilter = '', $show_every = 0, $enableonlytext = '', $morecss = '', $noactive = 0, $outputmode = 0, $multiple = false)
@ -2507,7 +2507,7 @@ class Form
$label = $objp->label;
if (!empty($objp->label_translated)) $label = $objp->label_translated;
if (!empty($filterkey) && $filterkey != '') $label = preg_replace('/('.preg_quote($filterkey).')/i', '<strong>$1</strong>', $label, 1);
if (!empty($filterkey) && $filterkey != '') $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
$outkey = $objp->rowid;
$outref = $objp->ref;
@ -2579,7 +2579,7 @@ class Form
if ($outorigin && !empty($conf->global->PRODUCT_SHOW_ORIGIN_IN_COMBO)) $opt .= ' ('.getCountry($outorigin, 1).')';
$objRef = $objp->ref;
if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey).')/i', '<strong>$1</strong>', $objRef, 1);
if (!empty($filterkey) && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
$outval .= $objRef;
if ($outbarcode) $outval .= ' ('.$outbarcode.')';
$outval .= ' - '.dol_trunc($label, $maxlengtharticle);
@ -2948,11 +2948,11 @@ class Form
}
$objRef = $objp->ref;
if ($filterkey && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey).')/i', '<strong>$1</strong>', $objRef, 1);
if ($filterkey && $filterkey != '') $objRef = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRef, 1);
$objRefFourn = $objp->ref_fourn;
if ($filterkey && $filterkey != '') $objRefFourn = preg_replace('/('.preg_quote($filterkey).')/i', '<strong>$1</strong>', $objRefFourn, 1);
if ($filterkey && $filterkey != '') $objRefFourn = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $objRefFourn, 1);
$label = $objp->label;
if ($filterkey && $filterkey != '') $label = preg_replace('/('.preg_quote($filterkey).')/i', '<strong>$1</strong>', $label, 1);
if ($filterkey && $filterkey != '') $label = preg_replace('/('.preg_quote($filterkey, '/').')/i', '<strong>$1</strong>', $label, 1);
$optlabel = $objp->ref;
if (!empty($objp->idprodfournprice) && ($objp->ref != $objp->ref_fourn)) {

View File

@ -23,6 +23,10 @@
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
/**
* Class to manage forms for categories
*/
class FormCategory extends Form
{
/**

View File

@ -32,6 +32,10 @@
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
/**
* Class of forms component to manage companies
*/
class FormCompany extends Form
{

View File

@ -1393,7 +1393,7 @@ class FormFile
if ($permtoeditline)
{
$paramsectiondir = (in_array($modulepart, array('medias', 'ecm')) ? '&section_dir='.urlencode($relativepath) : '');
print '<a class="editfielda" href="'.(($useinecm == 1 || $useinecm == 5) ? '#' : ($url.'?action=editfile&urlfile='.urlencode($filepath).$paramsectiondir.$param)).'" class="editfilelink" rel="'.$filepath.'">'.img_edit('default', 0, 'class="paddingrightonly"').'</a>';
print '<a class="editfielda reposition" href="'.(($useinecm == 1 || $useinecm == 5) ? '#' : ($url.'?action=editfile&urlfile='.urlencode($filepath).$paramsectiondir.$param)).'" class="editfilelink" rel="'.$filepath.'">'.img_edit('default', 0, 'class="paddingrightonly"').'</a>';
}
}
if ($permonobject)

View File

@ -236,8 +236,11 @@ function GetRootPath()
return substr($sRealPath, 0, $position);
}
// Emulate the asp Server.mapPath function.
// given an url path return the physical directory that it corresponds to
/**
* Emulate the asp Server.mapPath function.
* @param string $path given an url path return the physical directory that it corresponds to
* @return string Path
*/
function Server_MapPath($path)
{
// This function is available only for Apache
@ -338,7 +341,12 @@ function GetCurrentFolder()
return $sCurrentFolder;
}
// Do a cleanup of the folder name to avoid possible problems
/**
* Do a cleanup of the folder name to avoid possible problems
*
* @param string $sNewFolderName Folder
* @return string Folder sanitized
*/
function SanitizeFolderName($sNewFolderName)
{
$sNewFolderName = stripslashes($sNewFolderName);
@ -349,7 +357,12 @@ function SanitizeFolderName($sNewFolderName)
return $sNewFolderName;
}
// Do a cleanup of the file name to avoid possible problems
/**
* Do a cleanup of the file name to avoid possible problems
*
* @param string $sNewFileName Folder
* @return string Folder sanitized
*/
function SanitizeFileName($sNewFileName)
{
global $Config;
@ -366,7 +379,15 @@ function SanitizeFileName($sNewFileName)
return $sNewFileName;
}
// This is the function that sends the results of the uploading process.
/**
* This is the function that sends the results of the uploading process.
*
* @param string $errorNumber errorNumber
* @param string $fileUrl fileUrl
* @param string $fileName fileName
* @param string $customMsg customMsg
* @return void
*/
function SendUploadResults($errorNumber, $fileUrl = '', $fileName = '', $customMsg = '')
{
// Minified version of the document.domain automatic fix script (#1919).

View File

@ -1409,7 +1409,7 @@ function complete_elementList_with_modules(&$elementList)
*
* @param array $tableau Array of constants array('key'=>array('type'=>type, 'label'=>label)
* where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ...
* @param int $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (no form into table), 2=No form nor button at all (form is output by caller, recommanded)
* @param int $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (deprecated), 2=No form nor button at all (form is output by caller, recommended)
* @param string $helptext Help
* @return void
*/
@ -1420,6 +1420,9 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '')
$form = new Form($db);
if (empty($strictw3c)) {
dol_syslog("Warning: Function form_constantes is calle with parameter strictw3c = 0, this is deprecated. Value must be 2 now.", LOG_DEBUG);
}
if (!empty($strictw3c) && $strictw3c == 1)
{
print "\n".'<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
@ -1584,12 +1587,13 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '')
//var_dump($modelmail);
$moreonlabel = '';
if (!empty($arrayofmessagename[$modelmail->label])) $moreonlabel = ' <span class="opacitymedium">('.$langs->trans("SeveralLangugeVariatFound").')</span>';
$arrayofmessagename[$modelmail->label] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)).$moreonlabel;
// The 'label' is the key that is unique if we exclude the language
$arrayofmessagename[$modelmail->label.':'.$tmp[1]] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)).$moreonlabel;
}
}
//var_dump($arraydefaultmessage);
//var_dump($arrayofmessagename);
print $form->selectarray('constvalue_'.$obj->name, $arrayofmessagename, $obj->value, 'None', 1, 0, '', 0, 0, 0, '', '', 1);
print $form->selectarray('constvalue_'.$obj->name, $arrayofmessagename, $obj->value.':'.$tmp[1], 'None', 0, 0, '', 0, 0, 0, '', '', 1);
}
else // type = 'string' ou 'chaine'
{

View File

@ -720,10 +720,11 @@ function dol_copy($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1)
* @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666'
* @param int $overwriteifexists Overwrite file if exists (1 by default)
* @param array $arrayreplacement Array to use to replace filenames with another one during the copy (works only on file names, not on directory names).
* @param int $excludesubdir 0=Do not exclude subdirectories, 1=Exclude subdirectories, 2=Exclude subdirectories if name is not a 2 chars (used for country codes subdirectories).
* @return int <0 if error, 0 if nothing done (all files already exists and overwriteifexists=0), >0 if OK
* @see dol_copy()
*/
function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayreplacement = null)
function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayreplacement = null, $excludesubdir = 0)
{
global $conf;
@ -759,8 +760,10 @@ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayrep
{
if (is_dir($ossrcfile."/".$file))
{
//var_dump("xxx dolCopyDir $srcfile/$file, $destfile/$file, $newmask, $overwriteifexists");
$tmpresult = dolCopyDir($srcfile."/".$file, $destfile."/".$file, $newmask, $overwriteifexists, $arrayreplacement);
if (empty($excludesubdir) || ($excludesubdir == 2 && strlen($file) == 2)) {
//var_dump("xxx dolCopyDir $srcfile/$file, $destfile/$file, $newmask, $overwriteifexists");
$tmpresult = dolCopyDir($srcfile."/".$file, $destfile."/".$file, $newmask, $overwriteifexists, $arrayreplacement, $excludesubdir);
}
}
else
{

View File

@ -353,6 +353,24 @@ function show_stats_for_company($product, $socid)
print '<td class="right" width="25%">'.$langs->trans("TotalQuantity").'</td>';
print '</tr>';
// MO
if (!empty($conf->mrp->enabled) && $user->rights->mrp->read)
{
$nblines++;
//$ret = $product->load_stats_mo($socid);
if ($ret < 0) dol_print_error($db);
$langs->load("orders");
print '<tr><td>';
print '<a href="mo.php?id='.$product->id.'">'.img_object('', 'mrp').' '.$langs->trans("MO").'</a>';
print '</td><td class="right">';
print $product->stats_mo['suppliers'];
print '</td><td class="right">';
print $product->stats_mo['nb'];
print '</td><td class="right">';
print $product->stats_mo['qty'];
print '</td>';
print '</tr>';
}
// Customer proposals
if (!empty($conf->propal->enabled) && $user->rights->propale->lire)
{
@ -379,7 +397,7 @@ function show_stats_for_company($product, $socid)
if ($ret < 0) dol_print_error($db);
$langs->load("propal");
print '<tr><td>';
print '<a href="supplier_proposal.php?id='.$product->id.'">'.img_object('', 'propal').' '.$langs->trans("SupplierProposals").'</a>';
print '<a href="supplier_proposal.php?id='.$product->id.'">'.img_object('', 'supplier_proposal').' '.$langs->trans("SupplierProposals").'</a>';
print '</td><td class="right">';
print $product->stats_proposal_supplier['suppliers'];
print '</td><td class="right">';
@ -415,7 +433,7 @@ function show_stats_for_company($product, $socid)
if ($ret < 0) dol_print_error($db);
$langs->load("orders");
print '<tr><td>';
print '<a href="commande_fournisseur.php?id='.$product->id.'">'.img_object('', 'order').' '.$langs->trans("SuppliersOrders").'</a>';
print '<a href="commande_fournisseur.php?id='.$product->id.'">'.img_object('', 'supplier_order').' '.$langs->trans("SuppliersOrders").'</a>';
print '</td><td class="right">';
print $product->stats_commande_fournisseur['suppliers'];
print '</td><td class="right">';
@ -425,24 +443,6 @@ function show_stats_for_company($product, $socid)
print '</td>';
print '</tr>';
}
// MO
if (!empty($conf->mrp->enabled) && $user->rights->mrp->read)
{
$nblines++;
//$ret = $product->load_stats_mo($socid);
if ($ret < 0) dol_print_error($db);
$langs->load("orders");
print '<tr><td>';
print '<a href="mo.php?id='.$product->id.'">'.img_object('', 'mrp').' '.$langs->trans("MO").'</a>';
print '</td><td class="right">';
print $product->stats_mo['suppliers'];
print '</td><td class="right">';
print $product->stats_mo['nb'];
print '</td><td class="right">';
print $product->stats_mo['qty'];
print '</td>';
print '</tr>';
}
// Customer invoices
if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
{
@ -469,7 +469,7 @@ function show_stats_for_company($product, $socid)
if ($ret < 0) dol_print_error($db);
$langs->load("bills");
print '<tr><td>';
print '<a href="facture_fournisseur.php?id='.$product->id.'">'.img_object('', 'bill').' '.$langs->trans("SuppliersInvoices").'</a>';
print '<a href="facture_fournisseur.php?id='.$product->id.'">'.img_object('', 'supplier_invoice').' '.$langs->trans("SuppliersInvoices").'</a>';
print '</td><td class="right">';
print $product->stats_facture_fournisseur['suppliers'];
print '</td><td class="right">';

View File

@ -43,6 +43,14 @@ function takepos_prepare_head()
$head[$h][2] = 'receipt';
$h++;
if ($conf->global->TAKEPOS_BAR_RESTAURANT)
{
$head[$h][0] = DOL_URL_ROOT.'/takepos/admin/bar.php';
$head[$h][1] = $langs->trans("BarRestaurant");
$head[$h][2] = 'bar';
$h++;
}
$numterminals = max(1, $conf->global->TAKEPOS_NUM_TERMINALS);
for ($i = 1; $i <= $numterminals; $i++)
{

View File

@ -359,7 +359,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
print $form->textwithpicto($langs->trans("DefaultSkin"), $langs->trans("ThemeDir").' : '.$dirthemestring);
print '</th>';
print '<th class="right">';
$url = 'https://www.dolistore.com/4-skins';
$url = 'https://www.dolistore.com/9-skins';
print '<a href="'.$url.'" target="_blank">';
print $langs->trans('DownloadMoreSkins');
print '</a>';
@ -726,6 +726,33 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
print '</tr>';
}
// TextTitleLinkColor
if ($foruserprofile)
{
}
else
{
$default=(empty($colortexttitlelink) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colortexttitlelink)));
print '<tr class="oddeven">';
print '<td>'.$langs->trans("BackgroundTableTitleTextlinkColor").'</td>';
print '<td colspan="'.($colspan - 1).'">';
if ($edit)
{
print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTTITLELINK, array()), ''), 'THEME_ELDY_TEXTTITLELINK', 'formcolor', 1).' ';
}
else
{
print $formother->showColor($conf->global->THEME_ELDY_TEXTTITLELINK, $langs->trans("Default"));
}
print ' &nbsp; <span class="nowraponall opacitymedium">'.$langs->trans("Default").'</span>: <strong><span style="color: #'.$default.'">'.$default.'</span></strong> ';
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis"));
print '</span>';
print '</td>';
print '</tr>';
}
// BackgroundTableLineOddColor
if ($foruserprofile)
{

View File

@ -282,7 +282,8 @@ class modEmailCollector extends DolibarrModules
$tmpresql = $this->db->query($tmpsql);
if ($tmpresql) {
if ($this->db->num_rows($tmpresql) == 0) {
$descriptionA1 = 'This collector will scan your mailbox to find emails that match some rules and create automatically a ticket (Module Ticket must be enabled) with the email informations. You can use this collector if you provide some support by email, so your ticket request will be automatically generated. If the collector Collect_Responses is also enabled, when you send an email from the ticket, you may also see answers of your customers or partners directly on the ticket view.';
$descriptionA1 = 'This collector will scan your mailbox to find emails that match some rules and create automatically a ticket (Module Ticket must be enabled) with the email informations. You can use this collector if you provide some support by email, so your ticket request will be automatically generated.';
$descriptionA1 .= ' If the collector Collect_Responses is also enabled, when you send an email from the ticket, you may also see answers of your customers or partners directly on the ticket view.';
$sqlforexampleA1 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollector (entity, ref, label, description, source_directory, date_creation, fk_user_creat, status)";
$sqlforexampleA1 .= " VALUES (".$conf->entity.", 'Collect_Ticket_Requets', 'Example to collect ticket requests', '".$this->db->escape($descriptionA1)."', 'INBOX', '".$this->db->idate(dol_now())."', ".$user->id.", 0)";
$sqlforexampleA2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
@ -319,7 +320,9 @@ class modEmailCollector extends DolibarrModules
$tmpresql = $this->db->query($tmpsql);
if ($tmpresql) {
if ($this->db->num_rows($tmpresql) == 0) {
$descriptionC1 = "This collector will scan your mailbox to find emails that match some rules and create automatically a lead (Module Project must be enabled) with the email informations. You can use this collector if you want to follow your lead using the module Project (1 lead = 1 project), so your leads will be automatically generated. If the collector Collect_Responses is also enabled, when you send an email from your leads, proposals or any other object, you may also see answers of your customers or partners directly on the application.<br>Note: With this initial example, the title of the lead is generated including the email. If the thirdparty can't be found in database (new customer), the lead will be attached to the thirdparty with ID 1.";
$descriptionC1 = "This collector will scan your mailbox to find emails that match some rules and create automatically a lead (Module Project must be enabled) with the email informations. You can use this collector if you want to follow your lead using the module Project (1 lead = 1 project), so your leads will be automatically generated.";
$descriptionC1 .= " If the collector Collect_Responses is also enabled, when you send an email from your leads, proposals or any other object, you may also see answers of your customers or partners directly on the application.<br>";
$descriptionC1 .= "Note: With this initial example, the title of the lead is generated including the email. If the thirdparty can't be found in database (new customer), the lead will be attached to the thirdparty with ID 1.";
$sqlforexampleC1 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollector (entity, ref, label, description, source_directory, date_creation, fk_user_creat, status)";
$sqlforexampleC1 .= " VALUES (".$conf->entity.", 'Collect_Leads', 'Example to collect leads', '".$this->db->escape($descriptionC1)."', 'INBOX', '".$this->db->idate(dol_now())."', ".$user->id.", 0)";
$sqlforexampleC2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";

View File

@ -61,6 +61,9 @@ abstract class ModelePDFProduct extends CommonDocGenerator
}
}
/**
* Class template for classes of numbering product
*/
abstract class ModeleProductCode
{
/**
@ -97,7 +100,6 @@ abstract class ModeleProductCode
*/
public function getExample($langs)
{
$langs->load("bills");
return $langs->trans("NoExample");
}

View File

@ -82,7 +82,7 @@ $tmpDir = $conf->dav->multidir_output[$entity]; // We need root dir, not a dir t
// Authentication callback function
$authBackend = new \Sabre\DAV\Auth\Backend\BasicCallBack(function($username, $password) {
$authBackend = new \Sabre\DAV\Auth\Backend\BasicCallBack(function ($username, $password) {
global $user;
global $conf;
global $dolibarr_main_authentication, $dolibarr_auto_user;

View File

@ -4,7 +4,7 @@
* Simple autoloader, so we don't need Composer just for this.
*/
spl_autoload_register(function($class) {
spl_autoload_register(function ($class) {
if (preg_match('/^DebugBar/', $class) || preg_match('/^'.preg_quote('Psr\Log', '/').'/', $class)) {
$file = DOL_DOCUMENT_ROOT.'/includes/'.str_replace('\\', DIRECTORY_SEPARATOR, $class).'.php';
//var_dump($class.' - '.file_exists($file).' - '.$file);

View File

@ -55,11 +55,17 @@ class PaymentDonation extends CommonObject
public $fk_donation;
public $datec = '';
public $tms = '';
public $datep = '';
public $amount; // Total amount of payment
public $amounts = array(); // Array of amounts
public $amount; // Total amount of payment
public $amounts = array(); // Array of amounts
public $typepayment;
public $num_payment;
/**
@ -121,14 +127,14 @@ class PaymentDonation extends CommonObject
}
// Clean parameters
if (isset($this->fk_donation)) $this->fk_donation = (int) $this->fk_donation;
if (isset($this->amount)) $this->amount = trim($this->amount);
if (isset($this->fk_donation)) $this->fk_donation = (int) $this->fk_donation;
if (isset($this->amount)) $this->amount = trim($this->amount);
if (isset($this->fk_typepayment)) $this->fk_typepayment = trim($this->fk_typepayment);
if (isset($this->num_payment)) $this->num_payment = trim($this->num_payment);
if (isset($this->note_public)) $this->note_public = trim($this->note_public);
if (isset($this->fk_bank)) $this->fk_bank = (int) $this->fk_bank;
if (isset($this->fk_user_creat)) $this->fk_user_creat = (int) $this->fk_user_creat;
if (isset($this->fk_user_modif)) $this->fk_user_modif = (int) $this->fk_user_modif;
if (isset($this->num_payment)) $this->num_payment = trim($this->num_payment);
if (isset($this->note_public)) $this->note_public = trim($this->note_public);
if (isset($this->fk_bank)) $this->fk_bank = (int) $this->fk_bank;
if (isset($this->fk_user_creat)) $this->fk_user_creat = (int) $this->fk_user_creat;
if (isset($this->fk_user_modif)) $this->fk_user_modif = (int) $this->fk_user_modif;
$totalamount = 0;
foreach ($this->amounts as $key => $value) // How payment is dispatch
@ -228,26 +234,26 @@ class PaymentDonation extends CommonObject
{
$obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid;
$this->ref = $obj->rowid;
$this->id = $obj->rowid;
$this->ref = $obj->rowid;
$this->fk_donation = $obj->fk_donation;
$this->datec = $this->db->jdate($obj->datec);
$this->tms = $this->db->jdate($obj->tms);
$this->datep = $this->db->jdate($obj->datep);
$this->amount = $obj->amount;
$this->fk_donation = $obj->fk_donation;
$this->datec = $this->db->jdate($obj->datec);
$this->tms = $this->db->jdate($obj->tms);
$this->datep = $this->db->jdate($obj->datep);
$this->amount = $obj->amount;
$this->fk_typepayment = $obj->fk_typepayment;
$this->num_payment = $obj->num_payment;
$this->note_public = $obj->note_public;
$this->fk_bank = $obj->fk_bank;
$this->fk_user_creat = $obj->fk_user_creat;
$this->fk_user_modif = $obj->fk_user_modif;
$this->num_payment = $obj->num_payment;
$this->note_public = $obj->note_public;
$this->fk_bank = $obj->fk_bank;
$this->fk_user_creat = $obj->fk_user_creat;
$this->fk_user_modif = $obj->fk_user_modif;
$this->type_code = $obj->type_code;
$this->type_code = $obj->type_code;
$this->type_label = $obj->type_label;
$this->bank_account = $obj->fk_account;
$this->bank_line = $obj->fk_bank;
$this->bank_line = $obj->fk_bank;
}
$this->db->free($resql);

View File

@ -772,7 +772,6 @@ class EcmFiles extends CommonObject
if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
$result = '';
$companylink = '';
$label = '<u>'.$langs->trans("MyModule").'</u>';
$label .= '<br>';
@ -867,6 +866,9 @@ class EcmFiles extends CommonObject
}
/**
* Class of an index line of a document
*/
class EcmfilesLine
{
/**

View File

@ -1,4 +1,6 @@
<?php
use Sabre\VObject\Recur\EventIterator\HandleRDateExpandTest;
/* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
@ -1185,8 +1187,13 @@ function migrate_contracts_date1($db, $langs, $conf)
print '</td></tr>';
}
/*
* Mise a jour date contrat avec date min effective mise en service si inferieur
/**
* Update contracts with date min real if service date is lower
*
* @param DoliDB $db Database handler
* @param Translate $langs Language
* @param Conf $conf Conf
* @return void
*/
function migrate_contracts_date2($db, $langs, $conf)
{

View File

@ -1803,6 +1803,7 @@ TopMenuDisableImages=Hide images in Top menu
LeftMenuBackgroundColor=Background color for Left menu
BackgroundTableTitleColor=Background color for Table title line
BackgroundTableTitleTextColor=Text color for Table title line
BackgroundTableTitleTextlinkColor=Text color for Table title link line
BackgroundTableLineOddColor=Background color for odd table lines
BackgroundTableLineEvenColor=Background color for even table lines
MinimumNoticePeriod=Minimum notice period (Your leave request must be done before this delay)

View File

@ -105,4 +105,6 @@ CashReport=Cash report
MainPrinterToUse=Main printer to use
OrderPrinterToUse=Order printer to use
MainTemplateToUse=Main template to use
OrderTemplateToUse=Order template to use
OrderTemplateToUse=Order template to use
BarRestaurant=Bar Restaurant
AutoOrder=Customer auto order

View File

@ -953,12 +953,13 @@ SearchIntoMembers=Members
SearchIntoUsers=Users
SearchIntoProductsOrServices=Products or services
SearchIntoProjects=Projects
SearchIntoMO=Manufacturing Orders
SearchIntoTasks=Tasks
SearchIntoCustomerInvoices=Customer invoices
SearchIntoSupplierInvoices=Vendor invoices
SearchIntoCustomerOrders=Sales orders
SearchIntoSupplierOrders=Purchase orders
SearchIntoCustomerProposals=Customer proposals
SearchIntoCustomerProposals=Commercial proposals
SearchIntoSupplierProposals=Vendor proposals
SearchIntoInterventions=Interventions
SearchIntoContracts=Contracts

View File

@ -1803,6 +1803,7 @@ TopMenuDisableImages=Cacher les images du menu principal
LeftMenuBackgroundColor=Couleur de fond pour le menu Gauche
BackgroundTableTitleColor=Couleur de fond pour la ligne de titres des liste/tableaux
BackgroundTableTitleTextColor=Couleur du texte pour la ligne de titre des tableaux
BackgroundTableTitleTextlinkColor=Couleur du texte pour la ligne de titre lien des tableaux
BackgroundTableLineOddColor=Couleur de fond pour les lignes impaires des tables
BackgroundTableLineEvenColor=Couleur de fond pour les lignes paires des tales
MinimumNoticePeriod=Période de préavis minimum (Votre demande de congé doit être faite avant ce délai)

View File

@ -1047,10 +1047,10 @@ class MyObject extends CommonObject
/**
* Action executed by scheduler
* CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters'
* Use public function doScheduledJob($param1, $param2, ...) to get parameters
*
* @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
*/
//public function doScheduledJob($param1, $param2, ...)
public function doScheduledJob()
{
global $conf, $langs;

View File

@ -533,7 +533,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
*/
// Delete (need delete permission, or if draft, just need create/modify permission)
if ($permissiontodelete)
if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd))
{
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a>'."\n";
}

View File

@ -108,7 +108,7 @@ if (!$sortfield) $sortfield = "t.".key($object->fields); // Set here default sea
if (!$sortorder) $sortorder = "ASC";
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST('search_all', 'alphanohtml') ? trim(GETPOST('search_all', 'alphanohtml')) : trim(GETPOST('sall', 'alphanohtml'));
$search = array();
foreach ($object->fields as $key => $val)
{

View File

@ -1008,7 +1008,7 @@ class Mo extends CommonObject
}
$url = dol_buildpath('/mrp/mo_card.php', 1).'?id='.$this->id;
if ($option = 'production') $url = dol_buildpath('/mrp/mo_production.php', 1).'?id='.$this->id;
if ($option == 'production') $url = dol_buildpath('/mrp/mo_production.php', 1).'?id='.$this->id;
if ($option != 'nolink')
{
@ -1226,10 +1226,10 @@ class Mo extends CommonObject
/**
* Action executed by scheduler
* CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters'
* Use public function doScheduledJob($param1, $param2, ...) to get parameters
*
* @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
*/
//public function doScheduledJob($param1, $param2, ...)
public function doScheduledJob()
{
global $conf, $langs;

View File

@ -639,7 +639,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
// Delete (need delete permission, or if draft, just need create/modify permission)
if ($permissiontodelete)
if ($permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd))
{
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a>'."\n";
}

View File

@ -107,7 +107,7 @@ if ($user->socid > 0) // Protection if external user
// Initialize array of search criterias
$search_all = trim(GETPOST("search_all", 'alpha'));
$search_all = GETPOST('search_all', 'alphanohtml') ? trim(GETPOST('search_all', 'alphanohtml')) : trim(GETPOST('sall', 'alphanohtml'));
$search = array();
foreach ($object->fields as $key => $val)
{

View File

@ -141,7 +141,7 @@ for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) {
$price_options[$i] = $langs->trans('SellingPrice').' '.$i;
}
$genPriceOptions = function($level) use ($price_options) {
$genPriceOptions = function ($level) use ($price_options) {
$return = array();

View File

@ -254,8 +254,10 @@ 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;
if (strpos($htmlname, 'search_') !== 0) {
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>';

View File

@ -1443,14 +1443,14 @@ class Product extends CommonObject
}
}
/*
* Sets an accountancy code for a product.
* Also calls PRODUCT_MODIFY trigger when modified
*
* @param string $type It can be 'buy', 'buy_intra', 'buy_export', 'sell', 'sell_intra' or 'sell_export'
* @param string $value Accountancy code
* @return int <0 KO >0 OK
*/
/**
* Sets an accountancy code for a product.
* Also calls PRODUCT_MODIFY trigger when modified
*
* @param string $type It can be 'buy', 'buy_intra', 'buy_export', 'sell', 'sell_intra' or 'sell_export'
* @param string $value Accountancy code
* @return int <0 KO >0 OK
*/
public function setAccountancyCode($type, $value)
{
global $user, $langs, $conf;

View File

@ -101,7 +101,7 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useles
foreach ($listofsearchfields as $key => $value)
{
if ($i == 0) print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
print '<tr '.$bc[false].'>';
print '<tr class="oddeven">';
print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label></td><td><input type="text" class="flat inputsearch" name="'.$key.'" id="'.$key.'" size="18"></td>';
if ($i == 0) print '<td rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td>';
print '</tr>';
@ -201,7 +201,7 @@ if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTA
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Categories").'</th></tr>';
print '<tr '.$bc[0].'><td class="center" colspan="2">';
print '<tr class="oddeven"><td class="center" colspan="2">';
$sql = "SELECT c.label, count(*) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."categorie_product as cs";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid";
@ -413,7 +413,7 @@ llxFooter();
$db->close();
/*
/**
* Print html activity for product type
*
* @param int $product_type Type of product
@ -422,7 +422,6 @@ $db->close();
function activitytrim($product_type)
{
global $conf, $langs, $db;
global $bc;
// We display the last 3 years
$yearofbegindate = date('Y', dol_time_plus_duree(time(), -3, "y"));

View File

@ -31,10 +31,10 @@ $langs->loadLangs(array("stocks", "other"));
// Get parameters
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
$cancel = GETPOST('cancel', 'aZ09');
$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');

View File

@ -164,26 +164,22 @@ if ($id > 0 || !empty($ref))
{
$num = $db->num_rows($result);
if (!empty($id))
$option .= '&amp;id='.$product->id;
if (!empty($search_month))
$option .= '&amp;search_month='.$search_month;
if (!empty($search_year))
$option .= '&amp;search_year='.$search_year;
if ($limit > 0 && $limit != $conf->liste_limit) $option .= '&limit='.urlencode($limit);
if ($limit > 0 && $limit != $conf->liste_limit) $option .= '&limit='.urlencode($limit);
if (!empty($id)) $option .= '&id='.$product->id;
if (!empty($search_month)) $option .= '&search_month='.urlencode($search_month);
if (!empty($search_year)) $option .= '&search_year='.urlencode($search_year);
print '<form method="post" action="'.$_SERVER ['PHP_SELF'].'?id='.$product->id.'" name="search_form">'."\n";
if (!empty($sortfield))
print '<input type="hidden" name="sortfield" value="'.$sortfield.'"/>';
if (!empty($sortorder))
print '<input type="hidden" name="sortorder" value="'.$sortorder.'"/>';
if (!empty($page)) {
print '<input type="hidden" name="page" value="'.$page.'"/>';
$option .= '&amp;page='.$page;
}
print_barre_liste($langs->trans("CustomersOrders"), $page, $_SERVER["PHP_SELF"], "&amp;id=".$product->id, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit);
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print_barre_liste($langs->trans("CustomersOrders"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1);
if (!empty($page)) $option .= '&page='.urlencode($page);
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print '<div class="divsearchfield">';
print $langs->trans('Period').' ('.$langs->trans("OrderDate").') - ';
print $langs->trans('Month').':<input class="flat" type="text" size="4" name="search_month" value="'.$search_month.'"> ';

View File

@ -172,26 +172,22 @@ if ($id > 0 || !empty($ref)) {
if ($result) {
$num = $db->num_rows($result);
if (!empty($id))
$option .= '&amp;id='.$product->id;
if (!empty($search_month))
$option .= '&amp;search_month='.$search_month;
if (!empty($search_year))
$option .= '&amp;search_year='.$search_year;
if ($limit > 0 && $limit != $conf->liste_limit) $option .= '&limit='.urlencode($limit);
if (!empty($id)) $option .= '&id='.$product->id;
if (!empty($search_month)) $option .= '&search_month='.urlencode($search_month);
if (!empty($search_year)) $option .= '&search_year='.urlencode($search_year);
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$product->id.'" name="search_form">'."\n";
if (!empty($sortfield))
print '<input type="hidden" name="sortfield" value="'.$sortfield.'"/>';
if (!empty($sortorder))
print '<input type="hidden" name="sortorder" value="'.$sortorder.'"/>';
if (!empty($page)) {
print '<input type="hidden" name="page" value="'.$page.'"/>';
$option .= '&amp;page='.$page;
}
print_barre_liste($langs->trans("SuppliersOrders"), $page, $_SERVER["PHP_SELF"], "&amp;id=".$product->id, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit);
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print_barre_liste($langs->trans("SuppliersOrders"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1);
if (!empty($page)) $option .= '&page='.urlencode($page);
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print '<div class="divsearchfield">';
print $langs->trans('Period').' ('.$langs->trans("OrderDate").') - ';
print $langs->trans('Month').':<input class="flat" type="text" size="4" name="search_month" value="'.$search_month.'"> ';

View File

@ -153,27 +153,24 @@ if ($id > 0 || !empty($ref))
if ($result)
{
$num = $db->num_rows($result);
if (!empty($id))
$option .= '&amp;id='.$product->id;
if (!empty($search_month))
$option .= '&amp;search_month='.$search_month;
if (!empty($search_year))
$option .= '&amp;search_year='.$search_year;
if ($limit > 0 && $limit != $conf->liste_limit) $option .= '&limit='.urlencode($limit);
if (!empty($id)) $option .= '&id='.$product->id;
if (!empty($search_month)) $option .= '&search_month='.urlencode($search_month);
if (!empty($search_year)) $option .= '&search_year='.urlencode($search_year);
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$product->id.'" name="search_form">'."\n";
if (!empty($sortfield))
print '<input type="hidden" name="sortfield" value="'.$sortfield.'"/>';
if (!empty($sortorder))
print '<input type="hidden" name="sortorder" value="'.$sortorder.'"/>';
if (!empty($page)) {
print '<input type="hidden" name="page" value="'.$page.'"/>';
$option .= '&amp;page='.$page;
}
print_barre_liste($langs->trans("Contrats"), $page, $_SERVER["PHP_SELF"], "&amp;id=".$product->id, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit);
print_barre_liste($langs->trans("Contrats"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1);
$i = 0;
if (!empty($page)) $option .= '&page='.urlencode($page);
$i = 0;
print '<div class="div-table-responsive">';
print '<table class="tagtable liste listwithfilterbefore" width="100%">';

View File

@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
// Load translation files required by the page
$langs->loadLangs(array('companies', 'bills', 'products'));
$langs->loadLangs(array('companies', 'bills', 'products', 'supplier_proposal'));
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
@ -185,25 +185,21 @@ if ($id > 0 || !empty($ref))
{
$num = $db->num_rows($result);
if (!empty($id))
$option .= '&amp;id='.$product->id;
if (!empty($search_month))
$option .= '&amp;search_month='.$search_month;
if (!empty($search_year))
$option .= '&amp;search_year='.$search_year;
if ($limit > 0 && $limit != $conf->liste_limit) $option .= '&limit='.urlencode($limit);
if (!empty($id)) $option .= '&id='.$product->id;
if (!empty($search_month)) $option .= '&search_month='.urlencode($search_month);
if (!empty($search_year)) $option .= '&search_year='.urlencode($search_year);
print '<form method="post" action="'.$_SERVER ['PHP_SELF'].'?id='.$product->id.'" name="search_form">'."\n";
if (!empty($sortfield))
print '<input type="hidden" name="sortfield" value="'.$sortfield.'"/>';
if (!empty($sortorder))
print '<input type="hidden" name="sortorder" value="'.$sortorder.'"/>';
if (!empty($page)) {
print '<input type="hidden" name="page" value="'.$page.'"/>';
$option .= '&amp;page='.$page;
}
print_barre_liste($langs->trans("CustomersInvoices"), $page, $_SERVER["PHP_SELF"], "&amp;id=".$product->id, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit);
print_barre_liste($langs->trans("CustomersInvoices"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1);
if (!empty($page)) $option .= '&page='.urlencode($page);
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print '<div class="divsearchfield">';
print $langs->trans('Period').' ('.$langs->trans("DateInvoice").') - ';

View File

@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
// Load translation files required by the page
$langs->loadLangs(array('companies', 'bills', 'products', 'companies'));
$langs->loadLangs(array('companies', 'bills', 'products', 'companies', 'supplier_proposal'));
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
@ -165,26 +165,22 @@ if ($id > 0 || !empty($ref))
{
$num = $db->num_rows($result);
if (!empty($id))
$option .= '&amp;id='.$product->id;
if (!empty($search_month))
$option .= '&amp;search_month='.$search_month;
if (!empty($search_year))
$option .= '&amp;search_year='.$search_year;
if ($limit > 0 && $limit != $conf->liste_limit) $option .= '&limit='.urlencode($limit);
if (!empty($id)) $option .= '&id='.$product->id;
if (!empty($search_month)) $option .= '&search_month='.urlencode($search_month);
if (!empty($search_year)) $option .= '&search_year='.urlencode($search_year);
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$product->id.'" name="search_form">'."\n";
if (!empty($sortfield))
print '<input type="hidden" name="sortfield" value="'.$sortfield.'"/>';
if (!empty($sortorder))
print '<input type="hidden" name="sortorder" value="'.$sortorder.'"/>';
if (!empty($page)) {
print '<input type="hidden" name="page" value="'.$page.'"/>';
$option .= '&amp;page='.$page;
}
print_barre_liste($langs->trans("SuppliersInvoices"), $page, $_SERVER["PHP_SELF"], "&amp;id=$product->id", $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit);
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print_barre_liste($langs->trans("SuppliersInvoices"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1);
if (!empty($page)) $option .= '&page='.urlencode($page);
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print '<div class="divsearchfield">';
print $langs->trans('Period').' ('.$langs->trans("DateInvoice").') - ';
print $langs->trans('Month').':<input class="flat" type="text" size="4" name="search_month" value="'.$search_month.'"> ';

View File

@ -150,27 +150,23 @@ if ($id > 0 || !empty($ref))
if ($result)
{
$num = $db->num_rows($result);
if (!empty($id))
$option .= '&amp;id='.$product->id;
if (!empty($search_month))
$option .= '&amp;search_month='.urlencode($search_month);
if (!empty($search_year))
$option .= '&amp;search_year='.urlencode($search_year);
if ($limit > 0 && $limit != $conf->liste_limit) $option .= '&limit='.urlencode($limit);
if ($limit > 0 && $limit != $conf->liste_limit) $option .= '&limit='.urlencode($limit);
if (!empty($id)) $option .= '&id='.$product->id;
if (!empty($search_month)) $option .= '&search_month='.urlencode($search_month);
if (!empty($search_year)) $option .= '&search_year='.urlencode($search_year);
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$product->id.'" name="search_form">'."\n";
if (!empty($sortfield))
print '<input type="hidden" name="sortfield" value="'.$sortfield.'"/>';
if (!empty($sortorder))
print '<input type="hidden" name="sortorder" value="'.$sortorder.'"/>';
if (!empty($page)) {
print '<input type="hidden" name="page" value="'.$page.'"/>';
$option .= '&amp;page='.$page;
}
print_barre_liste($langs->trans("Mos"), $page, $_SERVER["PHP_SELF"], "&amp;id=".$product->id, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit);
print_barre_liste($langs->trans("Mos"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1);
$i = 0;
if (!empty($page)) $option .= '&page='.urlencode($page);
$i = 0;
print '<div class="div-table-responsive">';
print '<table class="tagtable liste listwithfilterbefore" width="100%">';

View File

@ -169,26 +169,22 @@ if ($id > 0 || !empty($ref))
{
$num = $db->num_rows($result);
if (!empty($id))
$option .= '&amp;id='.$product->id;
if (!empty($search_month))
$option .= '&amp;search_month='.$search_month;
if (!empty($search_year))
$option .= '&amp;search_year='.$search_year;
if ($limit > 0 && $limit != $conf->liste_limit) $option .= '&limit='.urlencode($limit);
if (!empty($id)) $option .= '&id='.$product->id;
if (!empty($search_month)) $option .= '&search_month='.urlencode($search_month);
if (!empty($search_year)) $option .= '&search_year='.urlencode($search_year);
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$product->id.'" name="search_form">'."\n";
if (!empty($sortfield))
print '<input type="hidden" name="sortfield" value="'.$sortfield.'"/>';
if (!empty($sortorder))
print '<input type="hidden" name="sortorder" value="'.$sortorder.'"/>';
if (!empty($page)) {
print '<input type="hidden" name="page" value="'.$page.'"/>';
$option .= '&amp;page='.$page;
}
print_barre_liste($langs->trans("Proposals"), $page, $_SERVER["PHP_SELF"], "&amp;id=".$product->id, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit);
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print_barre_liste($langs->trans("Proposals"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1);
if (!empty($page)) $option .= '&page='.urlencode($page);
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print '<div class="divsearchfield">';
print $langs->trans('Period').' ('.$langs->trans("DatePropal").') - ';
print $langs->trans('Month').':<input class="flat" type="text" size="4" name="search_month" value="'.$search_month.'"> ';

View File

@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
// Load translation files required by the page
$langs->loadLangs(array('products', 'companies'));
$langs->loadLangs(array('products', 'companies', 'supplier_proposal'));
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
@ -169,26 +169,22 @@ if ($id > 0 || !empty($ref))
{
$num = $db->num_rows($result);
if (!empty($id))
$option .= '&amp;id='.$product->id;
if (!empty($search_month))
$option .= '&amp;search_month='.$search_month;
if (!empty($search_year))
$option .= '&amp;search_year='.$search_year;
if ($limit > 0 && $limit != $conf->liste_limit) $option .= '&limit='.urlencode($limit);
if (!empty($id)) $option .= '&id='.$product->id;
if (!empty($search_month)) $option .= '&search_month='.urlencode($search_month);
if (!empty($search_year)) $option .= '&search_year='.urlencode($search_year);
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$product->id.'" name="search_form">'."\n";
if (!empty($sortfield))
print '<input type="hidden" name="sortfield" value="'.$sortfield.'"/>';
if (!empty($sortorder))
print '<input type="hidden" name="sortorder" value="'.$sortorder.'"/>';
if (!empty($page)) {
print '<input type="hidden" name="page" value="'.$page.'"/>';
$option .= '&amp;page='.$page;
}
print_barre_liste($langs->trans("Proposals"), $page, $_SERVER["PHP_SELF"], "&amp;id=".$product->id, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit);
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print_barre_liste($langs->trans("Proposals"), $page, $_SERVER["PHP_SELF"], $option, $sortfield, $sortorder, '', $num, $totalofrecords, '', 0, '', '', $limit, 0, 0, 1);
if (!empty($page)) $option .= '&page='.urlencode($page);
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print '<div class="divsearchfield">';
print $langs->trans('Period').' ('.$langs->trans("DatePropal").') - ';
print $langs->trans('Month').':<input class="flat" type="text" size="4" name="search_month" value="'.$search_month.'"> ';

View File

@ -129,8 +129,8 @@ try {
));
}
/*
* generate payment response
/**
* Generate payment response
*
* @param \Stripe\PaymentIntent $intent PaymentIntent
* @return void

View File

@ -871,10 +871,12 @@ class Dolresource extends CommonObject
return $resources;
}
/*
/**
* Return an int number of resources linked to the element
*
* @return int
* @param string $element Element type
* @param int $element_id Element id
* @return int Nb of resources loaded
*/
public function fetchElementResources($element, $element_id)
{

View File

@ -0,0 +1,178 @@
<?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
*
* 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/takepos/admin/bar.php
* \ingroup takepos
* \brief Setup page for TakePos module - Bar Restaurant features
*/
require '../../main.inc.php'; // Load $user and permissions
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
require_once DOL_DOCUMENT_ROOT."/core/lib/takepos.lib.php";
// Security check
if (!$user->admin) accessforbidden();
$langs->loadLangs(array("admin", "cashdesk", "printing"));
global $db;
/*
* Actions
*/
if (GETPOST('action', 'alpha') == 'set')
{
$db->begin();
dol_syslog("admin/cashdesk: level ".GETPOST('level', 'alpha'));
if (!$res > 0) $error++;
if (!$error)
{
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
$db->rollback();
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
/*
* View
*/
$form = new Form($db);
$formproduct = new FormProduct($db);
llxHeader('', $langs->trans("CashDeskSetup"));
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("CashDeskSetup").' (TakePOS)', $linkback, 'title_setup');
$head = takepos_prepare_head();
dol_fiche_head($head, 'bar', 'TakePOS', -1);
print '<br>';
// Mode
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="set">';
print '<div class="div-table-responsive">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
print "</tr>\n";
if ($conf->global->TAKEPOS_BAR_RESTAURANT && $conf->global->TAKEPOS_PRINT_METHOD != "browser") {
print '<tr class="oddeven value"><td>';
print $langs->trans("OrderPrinters").' (<a href="'.DOL_URL_ROOT.'/takepos/admin/orderprinters.php?leftmenu=setup">'.$langs->trans("Setup").'</a>)';
print '<td colspan="2">';
print ajax_constantonoff("TAKEPOS_ORDER_PRINTERS", array(), $conf->entity, 0, 0, 1, 0);
//print $form->selectyesno("TAKEPOS_ORDER_PRINTERS", $conf->global->TAKEPOS_ORDER_PRINTERS, 1);
print '</td></tr>';
print '<tr class="oddeven value"><td>';
print $langs->trans("OrderNotes");
print '<td colspan="2">';
print ajax_constantonoff("TAKEPOS_ORDER_NOTES", array(), $conf->entity, 0, 0, 1, 0);
//print $form->selectyesno("TAKEPOS_ORDER_NOTES", $conf->global->TAKEPOS_ORDER_NOTES, 1);
print '</td></tr>';
}
print '<tr class="oddeven value"><td>';
print $langs->trans("BasicPhoneLayout");
print '<td colspan="2">';
//print $form->selectyesno("TAKEPOS_PHONE_BASIC_LAYOUT", $conf->global->TAKEPOS_PHONE_BASIC_LAYOUT, 1);
print ajax_constantonoff("TAKEPOS_PHONE_BASIC_LAYOUT", array(), $conf->entity, 0, 0, 1, 0);
print '</td></tr>';
print '<tr class="oddeven value"><td>';
print $langs->trans("ProductSupplements");
print '<td colspan="2">';
//print $form->selectyesno("TAKEPOS_SUPPLEMENTS", $conf->global->TAKEPOS_SUPPLEMENTS, 1);
print ajax_constantonoff("TAKEPOS_SUPPLEMENTS", array(), $conf->entity, 0, 0, 1, 0);
print '</td></tr>';
if ($conf->global->TAKEPOS_SUPPLEMENTS)
{
print '<tr class="oddeven"><td>';
print $langs->trans("SupplementCategory");
print '<td colspan="2">';
print $form->select_all_categories(Categorie::TYPE_PRODUCT, $conf->global->TAKEPOS_SUPPLEMENTS_CATEGORY, 'TAKEPOS_SUPPLEMENTS_CATEGORY', 64, 0, 0);
print ajax_combobox('TAKEPOS_SUPPLEMENTS_CATEGORY');
print "</td></tr>\n";
}
print '<tr class="oddeven value"><td>';
print $langs->trans("AutoOrder");
print '<td colspan="2">';
print ajax_constantonoff("TAKEPOS_AUTO_ORDER", array(), $conf->entity, 0, 0, 1, 0);
print '</td></tr>';
print '</table>';
if ($conf->global->TAKEPOS_AUTO_ORDER)
{
print '<br>';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Table").'</td><td>'.$langs->trans("URL").'</td><td>'.$langs->trans("QR").'</td>';
print "</tr>\n";
//global $dolibarr_main_url_root;
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
$sql = "SELECT rowid, entity, label, leftpos, toppos, floor FROM ".MAIN_DB_PREFIX."takepos_floor_tables";
$resql = $db->query($sql);
$rows = array();
while ($row = $db->fetch_array($resql)) {
print '<tr class="oddeven value"><td>';
print $langs->trans("Table")." ".$row['label'];
print '<td>';
print "<a target='_blank' href='".$urlwithroot."/takepos/public/auto_order.php?key=".dol_encode($row['rowid'])."'>".$urlwithroot."/takepos/public/auto_order.php?key=".dol_encode($row['rowid'])."</a>";
print '<td>';
print "<img src='".DOL_DOCUMENT_ROOT."/takepos/genimg/qr.php?id=".dol_encode($row['rowid'])."' height='42' width='42'>";
print '</td></tr>';
}
print '</table>';
}
print '</div>';
print '<br>';
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
print "</form>\n";
print '<br>';
llxFooter();
$db->close();

View File

@ -434,19 +434,6 @@ print "</td></tr>\n";
//print $form->selectarray('TAKEPOS_ADDON', $array, (empty($conf->global->TAKEPOS_ADDON) ? '0' : $conf->global->TAKEPOS_ADDON), 0);
//print "</td></tr>\n";
print '</table>';
print '</div>';
print '<br>';
// Bar Restaurant mode
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td class="titlefield">'.$langs->trans("Other").'</td><td>'.$langs->trans("Value").'</td>';
print "</tr>\n";
print '<tr class="oddeven"><td>';
print $langs->trans("EnableBarOrRestaurantFeatures");
print '</td>';
@ -455,48 +442,6 @@ print ajax_constantonoff("TAKEPOS_BAR_RESTAURANT", array(), $conf->entity, 0, 0,
//print $form->selectyesno("TAKEPOS_BAR_RESTAURANT", $conf->global->TAKEPOS_BAR_RESTAURANT, 1);
print "</td></tr>\n";
if ($conf->global->TAKEPOS_BAR_RESTAURANT && $conf->global->TAKEPOS_PRINT_METHOD != "browser") {
print '<tr class="oddeven value"><td>';
print $langs->trans("OrderPrinters").' (<a href="'.DOL_URL_ROOT.'/takepos/admin/orderprinters.php?leftmenu=setup">'.$langs->trans("Setup").'</a>)';
print '<td colspan="2">';
print ajax_constantonoff("TAKEPOS_ORDER_PRINTERS", array(), $conf->entity, 0, 0, 1, 0);
//print $form->selectyesno("TAKEPOS_ORDER_PRINTERS", $conf->global->TAKEPOS_ORDER_PRINTERS, 1);
print '</td></tr>';
print '<tr class="oddeven value"><td>';
print $langs->trans("OrderNotes");
print '<td colspan="2">';
print ajax_constantonoff("TAKEPOS_ORDER_NOTES", array(), $conf->entity, 0, 0, 1, 0);
//print $form->selectyesno("TAKEPOS_ORDER_NOTES", $conf->global->TAKEPOS_ORDER_NOTES, 1);
print '</td></tr>';
}
if ($conf->global->TAKEPOS_BAR_RESTAURANT)
{
print '<tr class="oddeven value"><td>';
print $langs->trans("BasicPhoneLayout");
print '<td colspan="2">';
//print $form->selectyesno("TAKEPOS_PHONE_BASIC_LAYOUT", $conf->global->TAKEPOS_PHONE_BASIC_LAYOUT, 1);
print ajax_constantonoff("TAKEPOS_PHONE_BASIC_LAYOUT", array(), $conf->entity, 0, 0, 1, 0);
print '</td></tr>';
print '<tr class="oddeven value"><td>';
print $langs->trans("ProductSupplements");
print '<td colspan="2">';
//print $form->selectyesno("TAKEPOS_SUPPLEMENTS", $conf->global->TAKEPOS_SUPPLEMENTS, 1);
print ajax_constantonoff("TAKEPOS_SUPPLEMENTS", array(), $conf->entity, 0, 0, 1, 0);
print '</td></tr>';
if ($conf->global->TAKEPOS_SUPPLEMENTS)
{
print '<tr class="oddeven"><td>';
print $langs->trans("SupplementCategory");
print '<td colspan="2">';
print $form->select_all_categories(Categorie::TYPE_PRODUCT, $conf->global->TAKEPOS_SUPPLEMENTS_CATEGORY, 'TAKEPOS_SUPPLEMENTS_CATEGORY', 64, 0, 0);
print ajax_combobox('TAKEPOS_SUPPLEMENTS_CATEGORY');
print "</td></tr>\n";
}
}
print '</table>';
print '</div>';

View File

@ -142,4 +142,10 @@ elseif ($action == 'search' && $term != '') {
}
echo json_encode($object);
} elseif ($action == 'thecheck') {
$place = GETPOST('place', 'alpha');
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php';
$printer = new dolReceiptPrinter($db);
$printer->sendToPrinter($object, $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_INVOICES'.$term}, $conf->global->{'TAKEPOS_PRINTER_TO_USE'.$term});
}

View File

@ -0,0 +1,33 @@
<?php
/* Copyright (C) 2020 Andreu Bisquerra <jove@bisquerra.com>
*
* 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/>.
*/
if (!defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1');
if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1');
if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
require '../../main.inc.php'; // Load $user and permissions
require '../../core/modules/barcode/doc/tcpdfbarcode.modules.php';
$key = GETPOST('key');
$module = new modtcpdfbarcode($db);
$result = $module->buildBarCode("http://www.takepos.com", 'QRCODE', 'Y');

View File

@ -47,13 +47,16 @@ $idproduct = GETPOST('idproduct', 'int');
$place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Bar or Restaurant
$placeid = 0; // $placeid is ID of invoice
if (empty($user->rights->takepos->run)) {
if ($_SESSION["publicterminal"]) {
$_SESSION["takeposterminal"] = 1; // Use Terminal 1 for public customers
}
elseif (empty($user->rights->takepos->run)) {
accessforbidden();
}
if ($conf->global->TAKEPOS_PHONE_BASIC_LAYOUT == 1 && $conf->browser->layout == 'phone')
if (($conf->global->TAKEPOS_PHONE_BASIC_LAYOUT == 1 && $conf->browser->layout == 'phone') || $_SESSION["publicterminal"])
{
// DIRECT LINK TO THIS PAGE FROM MOBILE AND NO TERMINAL SELECTED
if ($_SESSION["takeposterminal"] == "")

View File

@ -37,7 +37,12 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant
if ($_SESSION["publicterminal"]){
// Decode place if is a order from customer phone
$key = GETPOST('key');
$place=dol_decode($key);
}
else $place = (GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : 0); // $place is id of table for Ba or Restaurant
$action = GETPOST('action', 'alpha');
$setterminal = GETPOST('setterminal', 'int');
@ -48,7 +53,10 @@ if ($setterminal > 0)
$langs->loadLangs(array("bills", "orders", "commercial", "cashdesk", "receiptprinter"));
if (empty($user->rights->takepos->run)) {
if ($_SESSION["publicterminal"]) {
$_SESSION["takeposterminal"] = 1; // Use Terminal 1 for public customers
}
elseif (empty($user->rights->takepos->run)) {
accessforbidden();
}
@ -167,6 +175,14 @@ function Exit(){
window.location.href='../user/logout.php';
}
function CheckPlease(){
console.log("Request the check to the waiter");
$.ajax({
type: "GET",
url: "<?php print dol_buildpath('/takepos/ajax/ajax.php', 1).'?action=thecheck&=place='.$place; ?>",
});
}
</script>
<body style="overflow: hidden; background-color:#D1D1D1;">
@ -175,10 +191,13 @@ if ($conf->global->TAKEPOS_NUM_TERMINALS != "1" && $_SESSION["takeposterminal"]
?>
<div class="container">
<div class="phonebuttonsrow">
<button type="button" class="phonebutton" onclick="LoadPlacesList();"><?php echo strtoupper(substr($langs->trans('Floors'), 0, 3)); ?></button>
<button type="button" class="phonebutton" onclick="LoadCats();"><?php echo strtoupper(substr($langs->trans('Categories'), 0, 3)); ?></button>
<button type="button" class="phonebutton" onclick="TakeposPrintingOrder();"><?php echo strtoupper(substr($langs->trans('Order'), 0, 3)); ?></button>
<button type="button" class="phonebutton" onclick="Exit();"><?php echo strtoupper(substr($langs->trans('Logout'), 0, 3)); ?></button>
<?php
if (!$_SESSION["publicterminal"]) print '<button type="button" class="phonebutton" onclick="LoadPlacesList();">'.strtoupper(substr($langs->trans('Floors'), 0, 3)).'</button>';
print '<button type="button" class="phonebutton" onclick="LoadCats();">'.strtoupper(substr($langs->trans('Categories'), 0, 3)).'</button>';
print '<button type="button" class="phonebutton" onclick="TakeposPrintingOrder();">'.strtoupper(substr($langs->trans('Order'), 0, 3)).'</button>';
print '<button type="button" class="phonebutton" onclick="Exit();">'.strtoupper(substr($langs->trans('Logout'), 0, 3)).'</button>';
if ($_SESSION["publicterminal"]) print '<button type="button" class="phonebutton" onclick="CheckPlease();">'.strtoupper(substr($langs->trans('Payment'), 0, 3)).'</button>';
?>
</div>
<div class="row1">
<div id="phonediv1" class="phonediv1"></div>

View File

@ -0,0 +1,29 @@
<?php
/* Copyright (C) - 2020 Andreu Bisquerra Gaya <jove@bisquerra.com>
*
* 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/takepos/public/auto_order.php
* \ingroup takepos
* \brief Public orders for customers
*/
if (!defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
$_SESSION["basiclayout"] = 1;
$_SESSION["publicterminal"] = true; // Is a public customer
require '../phone.php';

View File

@ -1132,6 +1132,9 @@ table[summary="list_of_modules"] .fa-cog {
padding-left: 5px;
padding-right: 5px;
}
.hideonsmartphone { display: none; }
.hideonsmartphoneimp { display: none !important; }
}
/* Force values for small screen 570 */
@ -1189,8 +1192,6 @@ table[summary="list_of_modules"] .fa-cog {
max-width: 138px; /* length of input text in the quick search box when using a smartphone and without dolidroid */
}
.hideonsmartphone { display: none; }
.hideonsmartphoneimp { display: none !important; }
.noenlargeonsmartphone { width : 50px !important; display: inline !important; }
.maxwidthonsmartphone, #search_newcompany.ui-autocomplete-input { max-width: 100px; }
.maxwidth50onsmartphone { max-width: 40px; }
@ -3364,6 +3365,7 @@ tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste
}
tr.liste_titre th a, th.liste_titre a, tr.liste_titre td a, td.liste_titre a, form.liste_titre div a, div.liste_titre a {
text-shadow: none !important;
color: rgb(<?php echo $colortexttitlelink ?>);
}
tr.liste_titre_topborder td {
border-top-width: <?php echo $borderwidth; ?>px;

View File

@ -128,6 +128,7 @@ $colorbacklinebreak = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (emp
$colorbackbody = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_BACKBODY) ? $colorbackbody : $conf->global->THEME_ELDY_BACKBODY) : (empty($user->conf->THEME_ELDY_BACKBODY) ? $colorbackbody : $user->conf->THEME_ELDY_BACKBODY);
$colortexttitlenotab = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTTITLENOTAB) ? $colortexttitlenotab : $conf->global->THEME_ELDY_TEXTTITLENOTAB) : (empty($user->conf->THEME_ELDY_TEXTTITLENOTAB) ? $colortexttitlenotab : $user->conf->THEME_ELDY_TEXTTITLENOTAB);
$colortexttitle = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTTITLE) ? $colortexttitle : $conf->global->THEME_ELDY_TEXTTITLE) : (empty($user->conf->THEME_ELDY_TEXTTITLE) ? $colortexttitle : $user->conf->THEME_ELDY_TEXTTITLE);
$colortexttitlelink = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTTITLELINK) ? $colortexttitlelink : $conf->global->THEME_ELDY_TEXTTITLELINK) : (empty($user->conf->THEME_ELDY_TEXTTITLELINK) ? $colortexttitlelink : $user->conf->THEME_ELDY_TEXTTITLELINK);
$colortext = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXT) ? $colortext : $conf->global->THEME_ELDY_TEXT) : (empty($user->conf->THEME_ELDY_TEXT) ? $colortext : $user->conf->THEME_ELDY_TEXT);
$colortextlink = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTLINK) ? $colortextlink : $conf->global->THEME_ELDY_TEXTLINK) : (empty($user->conf->THEME_ELDY_TEXTLINK) ? $colortextlink : $user->conf->THEME_ELDY_TEXTLINK);
$fontsize = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_FONT_SIZE1) ? $fontsize : $conf->global->THEME_ELDY_FONT_SIZE1) : (empty($user->conf->THEME_ELDY_FONT_SIZE1) ? $fontsize : $user->conf->THEME_ELDY_FONT_SIZE1);

View File

@ -69,6 +69,7 @@ $colorbacklinebreak = '233,228,230'; // line break
$colorbackbody = '255,255,255';
$colortexttitlenotab = '0,113,120'; // 150,90,121 140,80,10 or 10,140,80 #875a7b green=0,113,120, violet: 0,50,120
$colortexttitle = '0,0,0';
$colortexttitlelink = '10, 20, 100';
$colortext = '0,0,0';
$colortextlink = '10, 20, 100';
$fontsize = '0.86em';

View File

@ -130,6 +130,7 @@ $colorbacklinebreak = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (emp
$colorbackbody = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_BACKBODY) ? $colorbackbody : $conf->global->THEME_ELDY_BACKBODY) : (empty($user->conf->THEME_ELDY_BACKBODY) ? $colorbackbody : $user->conf->THEME_ELDY_BACKBODY);
$colortexttitlenotab = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTTITLENOTAB) ? $colortexttitlenotab : $conf->global->THEME_ELDY_TEXTTITLENOTAB) : (empty($user->conf->THEME_ELDY_TEXTTITLENOTAB) ? $colortexttitlenotab : $user->conf->THEME_ELDY_TEXTTITLENOTAB);
$colortexttitle = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTTITLE) ? $colortext : $conf->global->THEME_ELDY_TEXTTITLE) : (empty($user->conf->THEME_ELDY_TEXTTITLE) ? $colortexttitle : $user->conf->THEME_ELDY_TEXTTITLE);
$colortexttitlelink = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTTITLELINK) ? $colortexttitlelink : $conf->global->THEME_ELDY_TEXTTITLELINK) : (empty($user->conf->THEME_ELDY_TEXTTITLELINK) ? $colortexttitlelink : $user->conf->THEME_ELDY_TEXTTITLELINK);
$colortext = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXT) ? $colortext : $conf->global->THEME_ELDY_TEXT) : (empty($user->conf->THEME_ELDY_TEXT) ? $colortext : $user->conf->THEME_ELDY_TEXT);
$colortextlink = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TEXTLINK) ? $colortext : $conf->global->THEME_ELDY_TEXTLINK) : (empty($user->conf->THEME_ELDY_TEXTLINK) ? $colortextlink : $user->conf->THEME_ELDY_TEXTLINK);
$fontsize = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_FONT_SIZE1) ? $fontsize : $conf->global->THEME_ELDY_FONT_SIZE1) : (empty($user->conf->THEME_ELDY_FONT_SIZE1) ? $fontsize : $user->conf->THEME_ELDY_FONT_SIZE1);
@ -3398,6 +3399,7 @@ tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste
}
tr.liste_titre th a, th.liste_titre a, tr.liste_titre td a, td.liste_titre a, form.liste_titre div a, div.liste_titre a {
text-shadow: none !important;
color: rgb(<?php echo $colortexttitlelink ?>);
}
tr.liste_titre_topborder td {
border-top-width: <?php echo $borderwidth; ?>px;

View File

@ -65,6 +65,7 @@ $colorbacklinebreak = '214,218,220';
$colorbackbody = '248,248,248';
$colortexttitlenotab = '80,71,5';
$colortexttitle = '20,20,20';
$colortexttitlelink = '0,0,120';
$colortext = '0,0,0';
$colortextlink = '0,0,120';
$fontsize = '14';

View File

@ -20,24 +20,21 @@ class Diff
const DELETED = 1;
const INSERTED = 2;
/* Returns the diff for two strings. The return value is an array, each of
/**
* Returns the diff for two strings. The return value is an array, each of
* whose values is an array containing two values: a line (or character, if
* $compareCharacters is true), and one of the constants DIFF::UNMODIFIED (the
* line or character is in both strings), DIFF::DELETED (the line or character
* is only in the first string), and DIFF::INSERTED (the line or character is
* only in the second string). The parameters are:
*
* $string1 - the first string
* $string2 - the second string
* $compareCharacters - true to compare characters, and false to compare
* lines; this optional parameter defaults to false
* @param string $string1 First string
* @param string $string2 Second string
* @param string $compareCharacters true to compare characters, and false to compare lines; this optional parameter defaults to false
* @return array Array of diff
*/
public static function compare(
$string1,
$string2,
$compareCharacters = false
) {
public static function compare($string1, $string2, $compareCharacters = false)
{
// initialise the sequences and comparison start and end positions
$start = 0;
if ($compareCharacters) {
@ -90,12 +87,13 @@ class Diff
return $diff;
}
/* Returns the diff for two files. The parameters are:
/**
* Returns the diff for two files. The parameters are:
*
* $file1 - the path to the first file
* $file2 - the path to the second file
* $compareCharacters - true to compare characters, and false to compare
* lines; this optional parameter defaults to false
* @param string $file1 Path to the first file
* @param string $file2 Path to the second file
* @param boolean $compareCharacters true to compare characters, and false to compare lines; this optional parameter defaults to false
* @return array Array of diff
*/
public static function compareFiles(
$file1,
@ -111,23 +109,18 @@ class Diff
);
}
/* Returns the table of longest common subsequence lengths for the specified
* sequences. The parameters are:
/**
* Returns the table of longest common subsequence lengths for the specified sequences. The parameters are:
*
* $sequence1 - the first sequence
* $sequence2 - the second sequence
* $start - the starting index
* $end1 - the ending index for the first sequence
* $end2 - the ending index for the second sequence
* @param string $sequence1 the first sequence
* @param string $sequence2 the second sequence
* @param string $start the starting index
* @param string $end1 the ending index for the first sequence
* @param string $end2 the ending index for the second sequence
* @return array array of diff
*/
private static function computeTable(
$sequence1,
$sequence2,
$start,
$end1,
$end2
) {
private static function computeTable($sequence1, $sequence2, $start, $end1, $end2)
{
// determine the lengths to be compared
$length1 = $end1 - $start + 1;
$length2 = $end2 - $start + 1;
@ -156,21 +149,18 @@ class Diff
return $table;
}
/* Returns the partial diff for the specificed sequences, in reverse order.
* The parameters are:
/**
* Returns the partial diff for the specificed sequences, in reverse order.
* The parameters are:
*
* $table - the table returned by the computeTable function
* $sequence1 - the first sequence
* $sequence2 - the second sequence
* $start - the starting index
* @param string $table the table returned by the computeTable function
* @param string $sequence1 the first sequence
* @param string $sequence2 the second sequence
* @param string $start the starting index
* @return array array of diff
*/
private static function generatePartialDiff(
$table,
$sequence1,
$sequence2,
$start
) {
private static function generatePartialDiff($table, $sequence1, $sequence2, $start)
{
// initialise the diff
$diff = array();
@ -205,17 +195,17 @@ class Diff
return $diff;
}
/* Returns a diff as a string, where unmodified lines are prefixed by ' ',
/**
* Returns a diff as a string, where unmodified lines are prefixed by ' ',
* deletions are prefixed by '- ', and insertions are prefixed by '+ '. The
* parameters are:
*
* $diff - the diff array
* $separator - the separator between lines; this optional parameter defaults
* to "\n"
* @param array $diff the diff array
* @param string $separator the separator between lines; this optional parameter defaults to "\n"
* @return string String
*/
public static function toString($diff, $separator = "\n")
{
// initialise the string
$string = '';
@ -242,17 +232,17 @@ class Diff
return $string;
}
/* Returns a diff as an HTML string, where unmodified lines are contained
/**
* Returns a diff as an HTML string, where unmodified lines are contained
* within 'span' elements, deletions are contained within 'del' elements, and
* insertions are contained within 'ins' elements. The parameters are:
*
* $diff - the diff array
* $separator - the separator between lines; this optional parameter defaults
* to '<br>'
* @param string $diff the diff array
* @param string $separator the separator between lines; this optional parameter defaults to '<br>'
* @return string HTML string
*/
public static function toHTML($diff, $separator = '<br>')
{
// initialise the HTML
$html = '';
@ -283,17 +273,16 @@ class Diff
return $html;
}
/* Returns a diff as an HTML table. The parameters are:
/**
* Returns a diff as an HTML table. The parameters are:
*
* $diff - the diff array
* $indentation - indentation to add to every line of the generated HTML; this
* optional parameter defaults to ''
* $separator - the separator between lines; this optional parameter
* defaults to '<br>'
* @param string $diff the diff array
* @param string $indentation indentation to add to every line of the generated HTML; this optional parameter defaults to ''
* @param string $separator the separator between lines; this optional parameter defaults to '<br>'
* @return string HTML string
*/
public static function toTable($diff, $indentation = '', $separator = '<br>')
{
// initialise the HTML
$html = $indentation."<table class=\"diff\">\n";
@ -373,14 +362,16 @@ class Diff
return $html.$indentation."</table>\n";
}
/* Returns the content of the cell, for use in the toTable function. The
/**
* Returns the content of the cell, for use in the toTable function. The
* parameters are:
*
* $diff - the diff array
* $indentation - indentation to add to every line of the generated HTML
* $separator - the separator between lines
* $index - the current index, passes by reference
* $type - the type of line
* @param string $diff the diff array
* @param string $indentation indentation to add to every line of the generated HTML
* @param string $separator the separator between lines
* @param string $index the current index, passes by reference
* @param string $type the type of line
* @return string HTML string
*/
private static function getCellContent($diff, $indentation, $separator, &$index, $type)
{

View File

@ -137,7 +137,12 @@ $server->register(
// Full methods code
/**
* Full methods code
*
* @param string $authentication Authentication string
* @return array Array of data
*/
function getVersions($authentication)
{
global $db, $conf, $langs;

View File

@ -249,6 +249,13 @@ class Website extends CommonObject
// }
}
if (! $error) {
$stringtodolibarrfile = "# Some properties for Dolibarr web site CMS\n";
$stringtodolibarrfile .= "param=value\n";
//print $conf->website->dir_output.'/'.$this->ref.'/.dolibarr';exit;
file_put_contents($conf->website->dir_output.'/'.$this->ref.'/.dolibarr', $stringtodolibarrfile);
}
// Commit or rollback
if ($error) {
$this->db->rollback();
@ -668,7 +675,7 @@ class Website extends CommonObject
if (!$error)
{
dolCopyDir($pathofwebsiteold, $pathofwebsitenew, $conf->global->MAIN_UMASK, 0);
dolCopyDir($pathofwebsiteold, $pathofwebsitenew, $conf->global->MAIN_UMASK, 0, null, 2);
// Check symlink to medias and restore it if ko
$pathtomedias = DOL_DATA_ROOT.'/medias'; // Target
@ -927,30 +934,34 @@ class Website extends CommonObject
$arrayreplacementincss['file=logos%2Fthumbs%2F'.$mysoc->logo] = "file=logos%2Fthumbs%2F__LOGO_KEY__";
}
// Create output directories
dol_syslog("Create containers dir");
dol_mkdir($conf->website->dir_temp.'/'.$website->ref.'/containers');
dol_mkdir($conf->website->dir_temp.'/'.$website->ref.'/medias/image/websitekey');
dol_mkdir($conf->website->dir_temp.'/'.$website->ref.'/medias/js/websitekey');
// Copy files into 'containers'
$srcdir = $conf->website->dir_output.'/'.$website->ref;
$destdir = $conf->website->dir_temp.'/'.$website->ref.'/containers';
// Create containers dir
dol_syslog("Create containers dir");
dol_mkdir($conf->website->dir_temp.'/'.$website->ref.'/containers');
// Copy files into medias
dol_syslog("Copy content from ".$srcdir." into ".$destdir);
dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename);
dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename, 2);
// Copy files into medias/image
$srcdir = DOL_DATA_ROOT.'/medias/image/'.$website->ref;
$destdir = $conf->website->dir_temp.'/'.$website->ref.'/medias/image/websitekey';
dol_syslog("Copy content from ".$srcdir." into ".$destdir);
dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename);
// Copy files into medias/js
$srcdir = DOL_DATA_ROOT.'/medias/js/'.$website->ref;
$destdir = $conf->website->dir_temp.'/'.$website->ref.'/medias/js/websitekey';
// Copy containers files
dol_syslog("Copy content from ".$srcdir." into ".$destdir);
dolCopyDir($srcdir, $destdir, 0, 1, $arrayreplacementinfilename);
// Make some replacement into some files
$cssindestdir = $conf->website->dir_temp.'/'.$website->ref.'/containers/styles.css.php';
dolReplaceInFile($cssindestdir, $arrayreplacementincss);

View File

@ -271,7 +271,11 @@ if (GETPOST('optioncontent')) $algo .= 'content';
if (GETPOST('optionsitefiles')) $algo .= 'sitefiles';
if (empty($sortfield)) {
$sortfield = 'pageurl'; $sortorder = 'ASC';
if ($action == 'file_manager') {
$sortfield='name'; $sortorder = 'ASC';
} else {
$sortfield = 'pageurl'; $sortorder = 'ASC';
}
}
$searchkey = GETPOST('searchstring', 'none');
@ -3527,9 +3531,10 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction =
print $langs->trans("SearchString");
print '</div>';
print '<div class="tagtd">';
print '<input type="text" name="searchstring" value="'.dol_escape_htmltag($searchkey).'" autofocus>';
print '<input type="submit" class="button" name="buttonreplacesitesearch" value="'.$langs->trans("Search").'">';
print '<input type="text" name="searchstring" value="'.dol_escape_htmltag($searchkey, 0, 0, '', 1).'" autofocus>';
print '<input type="submit" class="button" name="buttonreplacesitesearch" value="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '</div>';
print '</div>';

View File

@ -715,7 +715,6 @@ class Hook extends CommonObject
*
* @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
*/
//public function doScheduledJob($param1, $param2, ...)
public function doScheduledJob()
{
global $conf, $langs;

View File

@ -73,7 +73,11 @@ class AccountingAccountTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -84,7 +88,11 @@ class AccountingAccountTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

View File

@ -73,7 +73,11 @@ class ActionCommTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -84,7 +88,11 @@ class ActionCommTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

View File

@ -75,7 +75,11 @@ class AdherentTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -91,7 +95,11 @@ class AdherentTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

View File

@ -73,7 +73,11 @@ class AdminLibTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -82,7 +86,11 @@ class AdminLibTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

View File

@ -74,7 +74,11 @@ class BOMTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -83,7 +87,11 @@ class BOMTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

View File

@ -75,7 +75,11 @@ class BankAccountTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -84,7 +88,11 @@ class BankAccountTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

View File

@ -103,7 +103,11 @@ class BuildDocTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -121,7 +125,11 @@ class BuildDocTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

View File

@ -73,7 +73,11 @@ class CMailFileTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -82,7 +86,11 @@ class CMailFileTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

View File

@ -74,7 +74,11 @@ class CategorieTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -83,7 +87,11 @@ class CategorieTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

View File

@ -74,7 +74,11 @@ class ChargeSocialesTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -83,7 +87,11 @@ class ChargeSocialesTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

View File

@ -86,7 +86,11 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -95,7 +99,11 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

View File

@ -86,7 +86,11 @@ class CodingSqlTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -95,7 +99,11 @@ class CodingSqlTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

View File

@ -75,7 +75,11 @@ class CommandeFournisseurTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -84,7 +88,11 @@ class CommandeFournisseurTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

View File

@ -73,7 +73,11 @@ class CommandeTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -84,7 +88,11 @@ class CommandeTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

View File

@ -73,7 +73,11 @@ class CommonInvoiceTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -82,7 +86,11 @@ class CommonInvoiceTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

View File

@ -74,7 +74,11 @@ class CommonObjectTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -83,7 +87,11 @@ class CommonObjectTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

View File

@ -74,7 +74,11 @@ class CompanyBankAccountTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -83,7 +87,11 @@ class CompanyBankAccountTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

View File

@ -73,7 +73,11 @@ class CompanyLibTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -82,7 +86,11 @@ class CompanyLibTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

View File

@ -82,7 +82,11 @@ class ContactTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -92,7 +96,11 @@ class ContactTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

View File

@ -74,7 +74,11 @@ class ContratTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -83,7 +87,11 @@ class ContratTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

View File

@ -76,7 +76,11 @@ class CoreTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -85,7 +89,11 @@ class CoreTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

View File

@ -74,7 +74,11 @@ class DateLibTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -83,7 +87,11 @@ class DateLibTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

View File

@ -74,7 +74,11 @@ class DateLibTzFranceTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -88,7 +92,11 @@ class DateLibTzFranceTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

View File

@ -74,7 +74,11 @@ class DiscountTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -83,7 +87,11 @@ class DiscountTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

View File

@ -74,7 +74,11 @@ class EntrepotTest extends PHPUnit\Framework\TestCase
print "\n";
}
// Static methods
/**
* setUpBeforeClass
*
* @return void
*/
public static function setUpBeforeClass()
{
global $conf,$user,$langs,$db;
@ -86,7 +90,11 @@ class EntrepotTest extends PHPUnit\Framework\TestCase
print __METHOD__."\n";
}
// tear down after class
/**
* tearDownAfterClass
*
* @return void
*/
public static function tearDownAfterClass()
{
global $conf,$user,$langs,$db;

Some files were not shown because too many files have changed in this diff Show More