Merge branch 'develop' into new_branch_13_09_2018
This commit is contained in:
commit
1dfbb22bf8
@ -8,9 +8,12 @@ For Users:
|
||||
NEW: Stable module: Website
|
||||
NEW: Stable module: WebDAV
|
||||
NEW: Stable module: Module Builder
|
||||
NEW: Stable module "Skype" has been replaced with module "Social Networks" to support more tools.
|
||||
NEW: Stable module "Skype" has been replaced with module "Social Networks" to support more tools.
|
||||
NEW: Experimental module "TakePos"
|
||||
NEW: Dolibarr can provide information in page title when multicompany is enabled of not, making
|
||||
Android application like DoliDroid able to provide native features for multicompany module.
|
||||
NEW: Compatibility with PHP 7.3
|
||||
|
||||
|
||||
For developers:
|
||||
* Code changes to be more compatible with PSR2
|
||||
|
||||
@ -622,8 +622,9 @@ if (empty($reshook))
|
||||
// Set output language
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
// Get email content fro mtemplae
|
||||
// Get email content from template
|
||||
$arraydefaultmessage=null;
|
||||
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION;
|
||||
|
||||
@ -693,8 +694,9 @@ if (empty($reshook))
|
||||
// Set output language
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
// Get email content fro mtemplae
|
||||
// Get email content from template
|
||||
$arraydefaultmessage=null;
|
||||
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION;
|
||||
|
||||
@ -1384,6 +1386,7 @@ else
|
||||
// Set output language
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
// Get email content from template
|
||||
$arraydefaultmessage=null;
|
||||
@ -1444,8 +1447,9 @@ else
|
||||
// Set output language
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
// Get email content fro mtemplae
|
||||
// Get email content from template
|
||||
$arraydefaultmessage=null;
|
||||
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION;
|
||||
|
||||
|
||||
@ -2628,6 +2628,7 @@ class Adherent extends CommonObject
|
||||
// Send reminder email
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang);
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
dol_syslog("sendReminderForExpiredSubscription Language set to ".$outputlangs->defaultlang);
|
||||
|
||||
|
||||
@ -56,8 +56,10 @@ class AdherentType extends CommonObject
|
||||
*/
|
||||
public $libelle;
|
||||
|
||||
/** @var string Label */
|
||||
public $label;
|
||||
/**
|
||||
* @var string Adherent type label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
/**
|
||||
* @var int Subsription required (0 or 1)
|
||||
|
||||
@ -582,7 +582,7 @@ if (! empty($arrayfields['t.libelle']['checked'])) print_liste_field_titr
|
||||
if (! empty($arrayfields['d.address']['checked'])) print_liste_field_titre($arrayfields['d.address']['label'],$_SERVER["PHP_SELF"],'d.address','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.zip']['checked'])) print_liste_field_titre($arrayfields['d.zip']['label'],$_SERVER["PHP_SELF"],'d.zip','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.town']['checked'])) print_liste_field_titre($arrayfields['d.town']['label'],$_SERVER["PHP_SELF"],'d.town','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.town']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.phone']['checked'])) print_liste_field_titre($arrayfields['d.phone']['label'],$_SERVER["PHP_SELF"],'d.phone','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.phone_perso']['checked'])) print_liste_field_titre($arrayfields['d.phone_perso']['label'],$_SERVER["PHP_SELF"],'d.phone_perso','',$param,'',$sortfield,$sortorder);
|
||||
|
||||
@ -359,8 +359,9 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
// Set output language
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
// Get email content fro mtemplae
|
||||
// Get email content from template
|
||||
$arraydefaultmessage=null;
|
||||
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION;
|
||||
|
||||
@ -1053,8 +1054,9 @@ if ($rowid > 0)
|
||||
// Set output language
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
// Get email content fro mtemplae
|
||||
// Get email content from template
|
||||
$arraydefaultmessage=null;
|
||||
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION;
|
||||
|
||||
|
||||
@ -328,20 +328,20 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
// Name
|
||||
|
||||
print '<tr class="oddeven"><td class="fieldrequired"><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
|
||||
print '<input name="nom" id="name" class="minwidth200" value="'. ($conf->global->MAIN_INFO_SOCIETE_NOM?$conf->global->MAIN_INFO_SOCIETE_NOM: GETPOST("nom",'nohtml')) . '" autofocus="autofocus"></td></tr>'."\n";
|
||||
print '<input name="nom" id="name" class="minwidth200" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_NOM?$conf->global->MAIN_INFO_SOCIETE_NOM: GETPOST("nom",'nohtml')) . '" autofocus="autofocus"></td></tr>'."\n";
|
||||
|
||||
// Addresse
|
||||
|
||||
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ADDRESS">'.$langs->trans("CompanyAddress").'</label></td><td>';
|
||||
print '<textarea name="MAIN_INFO_SOCIETE_ADDRESS" id="MAIN_INFO_SOCIETE_ADDRESS" class="quatrevingtpercent" rows="'.ROWS_3.'">'. ($conf->global->MAIN_INFO_SOCIETE_ADDRESS?$conf->global->MAIN_INFO_SOCIETE_ADDRESS: GETPOST("MAIN_INFO_SOCIETE_ADDRESS",'nohtml')) . '</textarea></td></tr>'."\n";
|
||||
print '<textarea name="MAIN_INFO_SOCIETE_ADDRESS" id="MAIN_INFO_SOCIETE_ADDRESS" class="quatrevingtpercent" rows="'.ROWS_3.'">'. ($conf->global->MAIN_INFO_SOCIETE_ADDRESS?$conf->global->MAIN_INFO_SOCIETE_ADDRESS:GETPOST("MAIN_INFO_SOCIETE_ADDRESS",'nohtml')) . '</textarea></td></tr>'."\n";
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ZIP">'.$langs->trans("CompanyZip").'</label></td><td>';
|
||||
print '<input class="minwidth100" name="MAIN_INFO_SOCIETE_ZIP" id="MAIN_INFO_SOCIETE_ZIP" value="'. ($conf->global->MAIN_INFO_SOCIETE_ZIP?$conf->global->MAIN_INFO_SOCIETE_ZIP: GETPOST("MAIN_INFO_SOCIETE_ZIP",'alpha')) . '"></td></tr>'."\n";
|
||||
print '<input class="minwidth100" name="MAIN_INFO_SOCIETE_ZIP" id="MAIN_INFO_SOCIETE_ZIP" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ZIP?$conf->global->MAIN_INFO_SOCIETE_ZIP:GETPOST("MAIN_INFO_SOCIETE_ZIP",'alpha')) . '"></td></tr>'."\n";
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_TOWN">'.$langs->trans("CompanyTown").'</label></td><td>';
|
||||
print '<input name="MAIN_INFO_SOCIETE_TOWN" class="minwidth100" id="MAIN_INFO_SOCIETE_TOWN" value="'. ($conf->global->MAIN_INFO_SOCIETE_TOWN?$conf->global->MAIN_INFO_SOCIETE_TOWN: GETPOST("MAIN_INFO_SOCIETE_TOWN",'nohtml')) . '"></td></tr>'."\n";
|
||||
print '<input name="MAIN_INFO_SOCIETE_TOWN" class="minwidth100" id="MAIN_INFO_SOCIETE_TOWN" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TOWN?$conf->global->MAIN_INFO_SOCIETE_TOWN:GETPOST("MAIN_INFO_SOCIETE_TOWN",'nohtml')) . '"></td></tr>'."\n";
|
||||
|
||||
// Country
|
||||
|
||||
@ -363,29 +363,29 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
|
||||
print '<input name="tel" id="phone" value="'. $conf->global->MAIN_INFO_SOCIETE_TEL . '"></td></tr>';
|
||||
print '<input name="tel" id="phone" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TEL) . '"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
|
||||
print '<input name="fax" id="fax" value="'. $conf->global->MAIN_INFO_SOCIETE_FAX . '"></td></tr>';
|
||||
print '<input name="fax" id="fax" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_FAX) . '"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
|
||||
print '<input name="mail" id="email" class="minwidth200" value="'. $conf->global->MAIN_INFO_SOCIETE_MAIL . '"></td></tr>';
|
||||
print '<input name="mail" id="email" class="minwidth200" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_MAIL) . '"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Web
|
||||
print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
|
||||
print '<input name="web" id="web" class="minwidth300" value="'. $conf->global->MAIN_INFO_SOCIETE_WEB . '"></td></tr>';
|
||||
print '<input name="web" id="web" class="minwidth300" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_WEB) . '"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Barcode
|
||||
if (! empty($conf->barcode->enabled)) {
|
||||
|
||||
print '<tr class="oddeven"><td><label for="barcode">'.$langs->trans("Gencod").'</label></td><td>';
|
||||
print '<input name="barcode" id="barcode" class="minwidth150" value="'. $conf->global->MAIN_INFO_SOCIETE_GENCOD . '"></td></tr>';
|
||||
print '<input name="barcode" id="barcode" class="minwidth150" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_GENCOD) . '"></td></tr>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -424,19 +424,19 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
// Managing Director(s)
|
||||
|
||||
print '<tr class="oddeven"><td><label for="director">'.$langs->trans("ManagingDirectors").'</label></td><td>';
|
||||
print '<input name="MAIN_INFO_SOCIETE_MANAGERS" id="director" class="minwidth200" value="' . $conf->global->MAIN_INFO_SOCIETE_MANAGERS . '"></td></tr>';
|
||||
print '<input name="MAIN_INFO_SOCIETE_MANAGERS" id="director" class="minwidth200" value="' . dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_MANAGERS) . '"></td></tr>';
|
||||
|
||||
// GDPR contact
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("GDPRContact"), $langs->trans("GDPRContactDesc"));
|
||||
print '</td><td>';
|
||||
print '<input name="MAIN_INFO_GDPR" id="director" class="minwidth500" value="' . $conf->global->MAIN_INFO_GDPR . '"></td></tr>';
|
||||
print '<input name="MAIN_INFO_GDPR" id="director" class="minwidth500" value="' . dol_escape_htmltag($conf->global->MAIN_INFO_GDPR) . '"></td></tr>';
|
||||
|
||||
// Capital
|
||||
|
||||
print '<tr class="oddeven"><td><label for="capital">'.$langs->trans("Capital").'</label></td><td>';
|
||||
print '<input name="capital" id="capital" class="minwidth100" value="' . $conf->global->MAIN_INFO_CAPITAL . '"></td></tr>';
|
||||
print '<input name="capital" id="capital" class="minwidth100" value="' . dol_escape_htmltag($conf->global->MAIN_INFO_CAPITAL) . '"></td></tr>';
|
||||
|
||||
// Juridical Status
|
||||
|
||||
@ -455,7 +455,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<tr class="oddeven"><td><label for="profid1">'.$langs->transcountry("ProfId1",$mysoc->country_code).'</label></td><td>';
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
print '<input name="siren" id="profid1" class="minwidth200" value="' . (! empty($conf->global->MAIN_INFO_SIREN) ? $conf->global->MAIN_INFO_SIREN : '') . '">';
|
||||
print '<input name="siren" id="profid1" class="minwidth200" value="' . dol_escape_htmltag(! empty($conf->global->MAIN_INFO_SIREN) ? $conf->global->MAIN_INFO_SIREN : '') . '">';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -471,7 +471,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<tr class="oddeven"><td><label for="profid2">'.$langs->transcountry("ProfId2",$mysoc->country_code).'</label></td><td>';
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
print '<input name="siret" id="profid2" class="minwidth200" value="' . (! empty($conf->global->MAIN_INFO_SIRET) ? $conf->global->MAIN_INFO_SIRET : '' ) . '">';
|
||||
print '<input name="siret" id="profid2" class="minwidth200" value="' . dol_escape_htmltag(! empty($conf->global->MAIN_INFO_SIRET) ? $conf->global->MAIN_INFO_SIRET : '' ) . '">';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -487,7 +487,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<tr class="oddeven"><td><label for="profid3">'.$langs->transcountry("ProfId3",$mysoc->country_code).'</label></td><td>';
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
print '<input name="ape" id="profid3" class="minwidth200" value="' . (! empty($conf->global->MAIN_INFO_APE) ? $conf->global->MAIN_INFO_APE : '') . '">';
|
||||
print '<input name="ape" id="profid3" class="minwidth200" value="' . dol_escape_htmltag(! empty($conf->global->MAIN_INFO_APE) ? $conf->global->MAIN_INFO_APE : '') . '">';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -503,7 +503,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<tr class="oddeven"><td><label for="profid4">'.$langs->transcountry("ProfId4",$mysoc->country_code).'</label></td><td>';
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
print '<input name="rcs" id="profid4" class="minwidth200" value="' . (! empty($conf->global->MAIN_INFO_RCS) ? $conf->global->MAIN_INFO_RCS : '') . '">';
|
||||
print '<input name="rcs" id="profid4" class="minwidth200" value="' . dol_escape_htmltag(! empty($conf->global->MAIN_INFO_RCS) ? $conf->global->MAIN_INFO_RCS : '') . '">';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -519,7 +519,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<tr class="oddeven"><td><label for="profid5">'.$langs->transcountry("ProfId5",$mysoc->country_code).'</label></td><td>';
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
print '<input name="MAIN_INFO_PROFID5" id="profid5" class="minwidth200" value="' . (! empty($conf->global->MAIN_INFO_PROFID5) ? $conf->global->MAIN_INFO_PROFID5 : '') . '">';
|
||||
print '<input name="MAIN_INFO_PROFID5" id="profid5" class="minwidth200" value="' . dol_escape_htmltag(! empty($conf->global->MAIN_INFO_PROFID5) ? $conf->global->MAIN_INFO_PROFID5 : '') . '">';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -535,7 +535,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<tr class="oddeven"><td><label for="profid6">'.$langs->transcountry("ProfId6",$mysoc->country_code).'</label></td><td>';
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
print '<input name="MAIN_INFO_PROFID6" id="profid6" class="minwidth200" value="' . (! empty($conf->global->MAIN_INFO_PROFID6) ? $conf->global->MAIN_INFO_PROFID6 : '') . '">';
|
||||
print '<input name="MAIN_INFO_PROFID6" id="profid6" class="minwidth200" value="' . dol_escape_htmltag(! empty($conf->global->MAIN_INFO_PROFID6) ? $conf->global->MAIN_INFO_PROFID6 : '') . '">';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -547,7 +547,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
// TVA Intra
|
||||
|
||||
print '<tr class="oddeven"><td><label for="intra_vat">'.$langs->trans("VATIntra").'</label></td><td>';
|
||||
print '<input name="tva" id="intra_vat" class="minwidth200" value="' . (! empty($conf->global->MAIN_INFO_TVAINTRA) ? $conf->global->MAIN_INFO_TVAINTRA : '') . '">';
|
||||
print '<input name="tva" id="intra_vat" class="minwidth200" value="' . dol_escape_htmltag(! empty($conf->global->MAIN_INFO_TVAINTRA) ? $conf->global->MAIN_INFO_TVAINTRA : '') . '">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Object of the company
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2017-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2017-2018 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -17,8 +17,13 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/defaultvalues.php
|
||||
* \brief Page to set default values used used in a create form
|
||||
* \file htdocs/admin/defaultvalues.php
|
||||
* \brief Page to set default values used used in a create form
|
||||
* Default values are stored into $user->default_values[url]['createform']['querystring'|'_noquery_'][paramkey]=paramvalue
|
||||
* Default filters are stored into $user->default_values[url]['filters']['querystring'|'_noquery_'][paramkey]=paramvalue
|
||||
* Default sort order are stored into $user->default_values[url]['sortorder']['querystring'|'_noquery_'][paramkey]=paramvalue
|
||||
* Default focus are stored into $user->default_values[url]['focus']['querystring'|'_noquery_'][paramkey]=paramvalue
|
||||
* Mandatory fields are stored into $user->default_values[url]['mandatory']['querystring'|'_noquery_'][paramkey]=paramvalue
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
@ -230,9 +235,9 @@ if ($mode == 'sortorder')
|
||||
{
|
||||
print info_admin($langs->trans("WarningSettingSortOrder")).'<br>';
|
||||
}
|
||||
if ($mode == 'focus')
|
||||
if ($mode == 'mandatory')
|
||||
{
|
||||
print info_admin($langs->trans("FeatureNotYetAvailable")).'<br>';
|
||||
print info_admin($langs->trans("FeatureSupportedOnTextFieldsOnly")).'<br>';
|
||||
}
|
||||
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -261,7 +266,7 @@ else
|
||||
}
|
||||
print_liste_field_titre($textkey,$_SERVER["PHP_SELF"],'param','',$param,'',$sortfield,$sortorder);
|
||||
// Value
|
||||
if ($mode != 'focus')
|
||||
if ($mode != 'focus' && $mode != 'mandatory')
|
||||
{
|
||||
if ($mode != 'sortorder')
|
||||
{
|
||||
@ -294,14 +299,14 @@ print "\n";
|
||||
print '<tr class="oddeven">';
|
||||
// Page
|
||||
print '<td>';
|
||||
print '<input type="text" class="flat minwidth200 maxwidthonsmartphone" name="defaulturl" value="">';
|
||||
print '<input type="text" class="flat minwidth200 maxwidthonsmartphone" name="defaulturl" value="'.dol_escape_htmltag(GETPOST('defaulturl','alphanohtml')).'">';
|
||||
print '</td>'."\n";
|
||||
// Field
|
||||
print '<td>';
|
||||
print '<input type="text" class="flat maxwidth100onsmartphone" name="defaultkey" value="">';
|
||||
print '<input type="text" class="flat maxwidth100onsmartphone" name="defaultkey" value="'.dol_escape_htmltag(GETPOST('defaultkey','alphanohtml')).'">';
|
||||
print '</td>';
|
||||
// Value
|
||||
if ($mode != 'focus')
|
||||
if ($mode != 'focus' && $mode != 'mandatory')
|
||||
{
|
||||
print '<td>';
|
||||
print '<input type="text" class="flat maxwidth100onsmartphone" name="defaultvalue" value="">';
|
||||
@ -311,15 +316,16 @@ if ($mode != 'focus')
|
||||
if (! empty($conf->multicompany->enabled) && !$user->entity)
|
||||
{
|
||||
print '<td>';
|
||||
print '<input type="text" class="flat" size="1" name="entity" value="'.$conf->entity.'">';
|
||||
print '<input type="text" class="flat" size="1" disabled name="entity" value="'.$conf->entity.'">'; // We see environment, but to change it we must switch on other entity
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center">';
|
||||
print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
|
||||
print '</td>';
|
||||
}
|
||||
print '<td align="center">';
|
||||
$disabled='';
|
||||
if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) $disabled=' disabled="disabled"';
|
||||
print '<input type="submit" class="button"'.$disabled.' value="'.$langs->trans("Add").'" name="add">';
|
||||
@ -363,7 +369,7 @@ if ($result)
|
||||
print '</td>'."\n";
|
||||
|
||||
// Value
|
||||
if ($mode != 'focus')
|
||||
if ($mode != 'focus' && $mode != 'mandatory')
|
||||
{
|
||||
print '<td>';
|
||||
/*print '<input type="hidden" name="const['.$i.'][rowid]" value="'.$obj->rowid.'">';
|
||||
@ -376,6 +382,9 @@ if ($result)
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Multicompany
|
||||
print '<td></td>';
|
||||
|
||||
// Actions
|
||||
print '<td align="center">';
|
||||
if ($action != 'edit' || GETPOST('rowid') != $obj->rowid)
|
||||
|
||||
@ -242,10 +242,10 @@ if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
preg_match('/^([0-9]+)/i',$obj->note,$reg);
|
||||
preg_match('/^([0-9]+)/i',$obj->note,$reg);
|
||||
$idrss = $reg[1];
|
||||
$keyrssurl="EXTERNAL_RSS_URLRSS_".$idrss;
|
||||
$keyrsstitle="EXTERNAL_RSS_URLRSS_".$idrss;
|
||||
$keyrsstitle="EXTERNAL_RSS_TITLE_".$idrss;
|
||||
$keyrssurl="EXTERNAL_RSS_URLRSS_".$idrss;
|
||||
//print "x".$idrss;
|
||||
|
||||
$rssparser=new RssParser($db);
|
||||
|
||||
@ -96,7 +96,7 @@ $usefilter=0;
|
||||
$listofsessions=listOfSessions();
|
||||
$num=count($listofsessions);
|
||||
|
||||
print_barre_liste($langs->trans("Sessions"), $page, $_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',$num,0,'setup');
|
||||
print_barre_liste($langs->trans("Sessions"), $page, $_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'', $num, ($num?$num:''),'setup'); // Do not show numer (0) if no session found (it means we can't know)
|
||||
|
||||
$savehandler=ini_get("session.save_handler");
|
||||
$savepath=ini_get("session.save_path");
|
||||
|
||||
@ -108,17 +108,17 @@ class Asset extends CommonObject
|
||||
|
||||
public $entity;
|
||||
|
||||
/**
|
||||
* @var string Asset label
|
||||
*/
|
||||
public $label;
|
||||
/**
|
||||
* @var string Asset label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
public $amount;
|
||||
|
||||
/**
|
||||
* @var int Thirdparty ID
|
||||
*/
|
||||
public $fk_soc;
|
||||
public $fk_soc;
|
||||
|
||||
/**
|
||||
* @var string description
|
||||
|
||||
@ -46,8 +46,10 @@ class AssetType extends CommonObject
|
||||
|
||||
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
|
||||
/** @var string Label */
|
||||
public $label;
|
||||
/**
|
||||
* @var string Asset type label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
/** @var string Accountancy code asset */
|
||||
public $accountancy_code_asset;
|
||||
|
||||
@ -993,7 +993,7 @@ if (empty($reshook))
|
||||
if ($tva_npr)
|
||||
$info_bits |= 0x01;
|
||||
|
||||
if (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min))) {
|
||||
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS) ) && (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min)))) {
|
||||
$mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency));
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
} else {
|
||||
@ -1057,7 +1057,7 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
// Update a line within proposal
|
||||
else if ($action == 'updateligne' && $usercancreate && GETPOST('save'))
|
||||
else if ($action == 'updateline' && $usercancreate && GETPOST('save'))
|
||||
{
|
||||
// Define info_bits
|
||||
$info_bits = 0;
|
||||
@ -1112,8 +1112,7 @@ if (empty($reshook))
|
||||
$price_min = $product->multiprices_min [$object->thirdparty->price_level];
|
||||
|
||||
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
|
||||
|
||||
if ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) {
|
||||
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS) )&& ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min)))) {
|
||||
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
|
||||
$error ++;
|
||||
}
|
||||
@ -1194,7 +1193,7 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'updateligne' && $usercancreate && GETPOST('cancel','alpha'))
|
||||
else if ($action == 'updateline' && $usercancreate && GETPOST('cancel','alpha'))
|
||||
{
|
||||
header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition
|
||||
exit();
|
||||
@ -2284,7 +2283,7 @@ if ($action == 'create')
|
||||
|
||||
print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#addline' : '#line_' . GETPOST('lineid')) . '" method="POST">
|
||||
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">
|
||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateligne') . '">
|
||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
|
||||
<input type="hidden" name="mode" value="">
|
||||
<input type="hidden" name="id" value="' . $object->id . '">
|
||||
';
|
||||
|
||||
@ -1620,6 +1620,7 @@ class Propal extends CommonObject
|
||||
$line->product_type = $objp->product_type;
|
||||
$line->label = $objp->custom_label;
|
||||
$line->desc = $objp->description; // Description ligne
|
||||
$line->description = $objp->description; // Description ligne
|
||||
$line->qty = $objp->qty;
|
||||
$line->vat_src_code = $objp->vat_src_code;
|
||||
$line->tva_tx = $objp->tva_tx;
|
||||
@ -3550,103 +3551,13 @@ class Propal extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve an array of propal lines
|
||||
* Retrieve an array of proposal lines
|
||||
*
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
function getLinesArray()
|
||||
{
|
||||
return $this->fetch_lines();
|
||||
/*
|
||||
$this->lines = array();
|
||||
|
||||
$sql = 'SELECT pt.rowid, pt.label as custom_label, pt.description, pt.fk_product, pt.fk_remise_except,';
|
||||
$sql.= ' pt.qty, pt.vat_src_code, pt.tva_tx, pt.localtax1_tx, pt.localtax2_tx, pt.localtax1_type, pt.localtax2_type, pt.remise_percent, pt.subprice, pt.info_bits,';
|
||||
$sql.= ' pt.total_ht, pt.total_tva, pt.total_ttc, pt.total_localtax1, pt.total_localtax2, pt.fk_product_fournisseur_price as fk_fournprice, pt.buy_price_ht as pa_ht, pt.special_code,';
|
||||
$sql.= ' pt.date_start, pt.date_end, pt.product_type, pt.rang, pt.fk_parent_line,';
|
||||
$sql.= ' pt.fk_unit,';
|
||||
$sql.= ' p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, p.description as product_desc, p.tobatch as product_tobatch,';
|
||||
$sql.= ' p.entity,';
|
||||
$sql.= ' pt.fk_multicurrency, pt.multicurrency_code, pt.multicurrency_subprice, pt.multicurrency_total_ht, pt.multicurrency_total_tva, pt.multicurrency_total_ttc';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'propaldet as pt';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pt.fk_product=p.rowid';
|
||||
$sql.= ' WHERE pt.fk_propal = '.$this->id;
|
||||
$sql.= ' ORDER BY pt.rang ASC, pt.rowid';
|
||||
|
||||
dol_syslog(get_class($this).'::getLinesArray', LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$this->lines[$i] = new PropaleLigne($this->db);
|
||||
$this->lines[$i]->id = $obj->rowid; // for backward compatibility
|
||||
$this->lines[$i]->rowid = $obj->rowid;
|
||||
$this->lines[$i]->label = $obj->custom_label;
|
||||
$this->lines[$i]->desc = $obj->description;
|
||||
$this->lines[$i]->description = $obj->description;
|
||||
$this->lines[$i]->fk_product = $obj->fk_product;
|
||||
$this->lines[$i]->ref = $obj->ref;
|
||||
$this->lines[$i]->product_ref = $obj->ref;
|
||||
$this->lines[$i]->entity = $obj->entity; // Product entity
|
||||
$this->lines[$i]->product_label = $obj->product_label;
|
||||
$this->lines[$i]->product_desc = $obj->product_desc;
|
||||
$this->lines[$i]->product_tobatch = $obj->product_tobatch;
|
||||
$this->lines[$i]->fk_product_type = $obj->fk_product_type; // deprecated
|
||||
$this->lines[$i]->product_type = $obj->product_type;
|
||||
$this->lines[$i]->qty = $obj->qty;
|
||||
$this->lines[$i]->subprice = $obj->subprice;
|
||||
$this->lines[$i]->fk_remise_except = $obj->fk_remise_except;
|
||||
$this->lines[$i]->remise_percent = $obj->remise_percent;
|
||||
|
||||
$this->lines[$i]->vat_src_code = $obj->vat_src_code;
|
||||
$this->lines[$i]->tva_tx = $obj->tva_tx;
|
||||
$this->lines[$i]->localtax1_tx = $obj->localtax1_tx;
|
||||
$this->lines[$i]->localtax2_tx = $obj->localtax2_tx;
|
||||
$this->lines[$i]->localtax1_type = $obj->localtax1_type;
|
||||
$this->lines[$i]->localtax2_type = $obj->localtax2_type;
|
||||
$this->lines[$i]->info_bits = $obj->info_bits;
|
||||
$this->lines[$i]->total_ht = $obj->total_ht;
|
||||
$this->lines[$i]->total_tva = $obj->total_tva;
|
||||
$this->lines[$i]->total_ttc = $obj->total_ttc;
|
||||
$this->lines[$i]->total_localtax1 = $obj->total_localtax1;
|
||||
$this->lines[$i]->total_localtax2 = $obj->total_localtax2;
|
||||
$this->lines[$i]->fk_fournprice = $obj->fk_fournprice;
|
||||
$marginInfos = getMarginInfos($obj->subprice, $obj->remise_percent, $obj->tva_tx, $obj->localtax1_tx, $obj->localtax2_tx, $this->lines[$i]->fk_fournprice, $obj->pa_ht);
|
||||
$this->lines[$i]->pa_ht = $marginInfos[0];
|
||||
$this->lines[$i]->marge_tx = $marginInfos[1];
|
||||
$this->lines[$i]->marque_tx = $marginInfos[2];
|
||||
$this->lines[$i]->fk_parent_line = $obj->fk_parent_line;
|
||||
$this->lines[$i]->special_code = $obj->special_code;
|
||||
$this->lines[$i]->rang = $obj->rang;
|
||||
$this->lines[$i]->date_start = $this->db->jdate($obj->date_start);
|
||||
$this->lines[$i]->date_end = $this->db->jdate($obj->date_end);
|
||||
$this->lines[$i]->fk_unit = $obj->fk_unit;
|
||||
|
||||
// Multicurrency
|
||||
$this->lines[$i]->fk_multicurrency = $obj->fk_multicurrency;
|
||||
$this->lines[$i]->multicurrency_code = $obj->multicurrency_code;
|
||||
$this->lines[$i]->multicurrency_subprice = $obj->multicurrency_subprice;
|
||||
$this->lines[$i]->multicurrency_total_ht = $obj->multicurrency_total_ht;
|
||||
$this->lines[$i]->multicurrency_total_tva = $obj->multicurrency_total_tva;
|
||||
$this->lines[$i]->multicurrency_total_ttc = $obj->multicurrency_total_ttc;
|
||||
|
||||
$i++;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
return -1;
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -931,7 +931,7 @@ if (empty($reshook))
|
||||
if ($tva_npr)
|
||||
$info_bits |= 0x01;
|
||||
|
||||
if (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min))) {
|
||||
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS) )&& (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min)))) {
|
||||
$mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency));
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
} else {
|
||||
@ -1052,7 +1052,7 @@ if (empty($reshook))
|
||||
|
||||
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
|
||||
|
||||
if ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) {
|
||||
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS) )&& ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min)))) {
|
||||
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@ class Account extends CommonObject
|
||||
public $rowid;
|
||||
|
||||
/**
|
||||
* Label
|
||||
* Account Label
|
||||
* @var string
|
||||
*/
|
||||
public $label;
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
<?php
|
||||
use Stripe\BankAccount;
|
||||
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
@ -428,7 +426,7 @@ foreach ($accounts as $key=>$type)
|
||||
// Ref
|
||||
if (! empty($arrayfields['b.ref']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->getNomUrl(1).'</td>';
|
||||
print '<td class="nowrap">'.$obj->getNomUrl(1).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
|
||||
<?php
|
||||
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2017 Pierre-Henry Favre <support@atm-consulting.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -18,9 +17,9 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/**
|
||||
* \file htdocs/compta/recap-compta.php
|
||||
* \ingroup compta
|
||||
* \brief Page de fiche recap customer
|
||||
* \file htdocs/compta/compta-files.php
|
||||
* \ingroup compta
|
||||
* \brief Page to show portoflio and files of a thirdparty and download it
|
||||
*/
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
@ -30,7 +29,9 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
|
||||
|
||||
restrictedArea($user,'banque');
|
||||
|
||||
$langs->load("companies");
|
||||
if (! empty($conf->facture->enabled)) $langs->load("bills");
|
||||
$date_start =GETPOST('date_start','alpha');
|
||||
@ -67,15 +68,22 @@ $arrayfields=array(
|
||||
'date'=>array('label'=>"Date", 'checked'=>1),
|
||||
//...
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
//$parameters = array('socid' => $id);
|
||||
//$reshook = $hookmanager->executeHooks('doActions', $parameters, $object); // Note that $object may have been modified by some hooks
|
||||
//if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Fetch the lines/files from db /
|
||||
* View
|
||||
*/
|
||||
|
||||
$filesarray=array();
|
||||
$result=false;
|
||||
if(($action=="searchfiles"||$action=="dl" ) && $date_start && $date_stop){
|
||||
|
||||
@ -954,6 +954,8 @@ if (empty($reshook))
|
||||
|
||||
if($facture_source->type == Facture::TYPE_SITUATION)
|
||||
{
|
||||
$source_fk_prev_id = $line->fk_prev_id; // temporary storing situation invoice fk_prev_id
|
||||
$line->fk_prev_id = $line->id; // Credit note line need to be linked to the situation invoice it is create from
|
||||
|
||||
if(!empty($facture_source->tab_previous_situation_invoice))
|
||||
{
|
||||
@ -977,7 +979,7 @@ if (empty($reshook))
|
||||
$maxPrevSituationPercent = 0;
|
||||
foreach($facture_source->tab_previous_situation_invoice[$lineIndex]->lines as $prevLine)
|
||||
{
|
||||
if($prevLine->id == $line->fk_prev_id)
|
||||
if($prevLine->id == $source_fk_prev_id)
|
||||
{
|
||||
$maxPrevSituationPercent = max($maxPrevSituationPercent,$prevLine->situation_percent);
|
||||
|
||||
@ -1535,6 +1537,7 @@ if (empty($reshook))
|
||||
$line->origin = $object->origin;
|
||||
$line->origin_id = $line->id;
|
||||
$line->fetch_optionals($line->id);
|
||||
$line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note
|
||||
|
||||
// Si fk_remise_except defini on vérifie si la réduction à déjà été appliquée
|
||||
if ($line->fk_remise_except)
|
||||
@ -1960,7 +1963,7 @@ if (empty($reshook))
|
||||
if ($tva_npr)
|
||||
$info_bits |= 0x01;
|
||||
|
||||
if (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min))) {
|
||||
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS) )&& (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min)))) {
|
||||
$mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency));
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
} else {
|
||||
@ -2032,7 +2035,7 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST('cancel','alpha'))
|
||||
elseif ($action == 'updateline' && $user->rights->facture->creer && ! GETPOST('cancel','alpha'))
|
||||
{
|
||||
if (! $object->fetch($id) > 0) dol_print_error($db);
|
||||
$object->fetch_thirdparty();
|
||||
@ -2123,7 +2126,7 @@ if (empty($reshook))
|
||||
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
|
||||
|
||||
// Check price is not lower than minimum (check is done only for standard or replacement invoices)
|
||||
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) {
|
||||
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS) ) && (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min)))) {
|
||||
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
@ -2255,7 +2258,7 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['cancel'] == $langs->trans('Cancel')) {
|
||||
else if ($action == 'updateline' && $user->rights->facture->creer && $_POST['cancel'] == $langs->trans('Cancel')) {
|
||||
header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $id); // Pour reaffichage de la fiche en cours d'edition
|
||||
exit();
|
||||
}
|
||||
@ -4511,7 +4514,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
|
||||
print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#addline' : '#line_' . GETPOST('lineid')) . '" method="POST">
|
||||
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">
|
||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateligne') . '">
|
||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
|
||||
<input type="hidden" name="mode" value="">
|
||||
<input type="hidden" name="id" value="' . $object->id . '">
|
||||
';
|
||||
|
||||
@ -1253,12 +1253,14 @@ class Facture extends CommonInvoice
|
||||
|
||||
if ($addlinktonotes)
|
||||
{
|
||||
$txttoshow=($user->societe_id>0?$this->note_public:$this->note_private);
|
||||
$txttoshow=($user->socid > 0 ? $this->note_public : $this->note_private);
|
||||
if ($txttoshow)
|
||||
{
|
||||
$notetoshow=$langs->trans("ViewPrivateNote").':<br>'.dol_string_nohtmltag($txttoshow,1);
|
||||
$result.=' <span class="note inline-block">';
|
||||
$result.='<a href="'.DOL_URL_ROOT.'/compta/facture/note.php?id='.$this->id.'" class="classfortooltip" title="'.dol_escape_htmltag($notetoshow).'">'.img_picto('','object_generic').'</a>';
|
||||
$result.='<a href="'.DOL_URL_ROOT.'/compta/facture/note.php?id='.$this->id.'" class="classfortooltip" title="'.dol_escape_htmltag($notetoshow).'">';
|
||||
$result.=img_picto('','note');
|
||||
$result.='</a>';
|
||||
//$result.=img_picto($langs->trans("ViewNote"),'object_generic');
|
||||
//$result.='</a>';
|
||||
$result.='</span>';
|
||||
@ -4913,9 +4915,10 @@ class FactureLigne extends CommonInvoiceLine
|
||||
* Warning: If invoice is a replacement invoice, this->fk_prev_id is id of the replaced line.
|
||||
*
|
||||
* @param int $invoiceid Invoice id
|
||||
* @param bool $include_credit_note Include credit note or not
|
||||
* @return int >= 0
|
||||
*/
|
||||
function get_prev_progress($invoiceid)
|
||||
function get_prev_progress($invoiceid, $include_credit_note=true)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (is_null($this->fk_prev_id) || empty($this->fk_prev_id) || $this->fk_prev_id == "") {
|
||||
@ -4930,7 +4933,26 @@ class FactureLigne extends CommonInvoiceLine
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql && $resql->num_rows > 0) {
|
||||
$res = $this->db->fetch_array($resql);
|
||||
return floatval($res['situation_percent']);
|
||||
|
||||
$returnPercent = floatval($res['situation_percent']);
|
||||
|
||||
if($include_credit_note) {
|
||||
|
||||
$sql = 'SELECT fd.situation_percent FROM ' . MAIN_DB_PREFIX . 'facturedet fd';
|
||||
$sql.= ' JOIN ' . MAIN_DB_PREFIX . 'facture f ON (f.rowid = fd.fk_facture) ';
|
||||
$sql.= ' WHERE fd.fk_prev_id =' . $this->fk_prev_id;
|
||||
$sql.= ' AND f.situation_cycle_ref = '.$tmpinvoice->situation_cycle_ref; // Prevent cycle outed
|
||||
$sql.= ' AND f.type = '.Facture::TYPE_CREDIT_NOTE;
|
||||
|
||||
$res = $this->db->query($sql);
|
||||
if($res) {
|
||||
while($obj = $this->db->fetch_object($res)) {
|
||||
$returnPercent = $returnPercent + floatval($obj->situation_percent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $returnPercent;
|
||||
} else {
|
||||
$this->error = $this->db->error();
|
||||
dol_syslog(get_class($this) . "::select Error " . $this->error, LOG_ERR);
|
||||
|
||||
@ -664,7 +664,7 @@ if (empty($reshook))
|
||||
if ($tva_npr)
|
||||
$info_bits |= 0x01;
|
||||
|
||||
if (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min)))
|
||||
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS) )&& (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min))))
|
||||
{
|
||||
$mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency));
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
@ -744,7 +744,7 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
elseif ($action == 'updateligne' && $user->rights->facture->creer && ! GETPOST('cancel','alpha'))
|
||||
elseif ($action == 'updateline' && $user->rights->facture->creer && ! GETPOST('cancel','alpha'))
|
||||
{
|
||||
if (! $object->fetch($id) > 0) dol_print_error($db);
|
||||
$object->fetch_thirdparty();
|
||||
@ -831,7 +831,7 @@ if (empty($reshook))
|
||||
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
|
||||
|
||||
// Check price is not lower than minimum (check is done only for standard or replacement invoices)
|
||||
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min)))
|
||||
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS) )&& (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))))
|
||||
{
|
||||
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
|
||||
$error ++;
|
||||
@ -1626,7 +1626,7 @@ else
|
||||
// Lines
|
||||
print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#add' : '#line_' . GETPOST('lineid')) . '" method="POST">
|
||||
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">
|
||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateligne') . '">
|
||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
|
||||
<input type="hidden" name="mode" value="">
|
||||
<input type="hidden" name="id" value="' . $object->id . '">
|
||||
';
|
||||
|
||||
@ -904,7 +904,7 @@ if ($resql)
|
||||
|
||||
$projectstatic=new Project($db);
|
||||
$discount = new DiscountAbsolute($db);
|
||||
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
$i=0;
|
||||
@ -914,6 +914,7 @@ if ($resql)
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$datelimit=$db->jdate($obj->datelimite);
|
||||
|
||||
$facturestatic->id=$obj->id;
|
||||
$facturestatic->ref=$obj->ref;
|
||||
$facturestatic->type=$obj->type;
|
||||
@ -957,12 +958,10 @@ if ($resql)
|
||||
|
||||
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
||||
|
||||
print '<td class="nobordernopadding nowrap">';
|
||||
print '<td class="nobordernopadding nowraponall">';
|
||||
print $facturestatic->getNomUrl(1,'',200,0,'',0,1);
|
||||
print empty($obj->increment)?'':' ('.$obj->increment.')';
|
||||
print '</td>';
|
||||
|
||||
print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
|
||||
$filename=dol_sanitizeFileName($obj->ref);
|
||||
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->id;
|
||||
|
||||
@ -732,7 +732,7 @@ while ($i < min($num,$limit))
|
||||
// Job position
|
||||
if (! empty($arrayfields['p.poste']['checked']))
|
||||
{
|
||||
print '<td>'.dol_trunc($obj->poste,20).'</td>';
|
||||
print '<td class="tdoverflowmax100">'.$obj->poste.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Zip
|
||||
|
||||
@ -566,7 +566,7 @@ if (empty($reshook))
|
||||
$info_bits=0;
|
||||
if ($tva_npr) $info_bits |= 0x01;
|
||||
|
||||
if($price_min && (price2num($pu_ht)*(1-price2num($remise_percent)/100) < price2num($price_min)))
|
||||
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS) )&& ($price_min && (price2num($pu_ht)*(1-price2num($remise_percent)/100) < price2num($price_min))))
|
||||
{
|
||||
$object->error = $langs->trans("CantBeLessThanMinPrice",price(price2num($price_min,'MU'),0,$langs,0,0,-1,$conf->currency));
|
||||
$result = -1 ;
|
||||
|
||||
@ -1710,7 +1710,7 @@ class Contrat extends CommonObject
|
||||
else
|
||||
{
|
||||
$this->db->rollback();
|
||||
dol_syslog(get_class($this)."::updateligne Erreur -2");
|
||||
dol_syslog(get_class($this)."::updateline Erreur -2");
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
@ -1718,7 +1718,7 @@ class Contrat extends CommonObject
|
||||
{
|
||||
$this->db->rollback();
|
||||
$this->error=$this->db->error();
|
||||
dol_syslog(get_class($this)."::updateligne Erreur -1");
|
||||
dol_syslog(get_class($this)."::updateline Erreur -1");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -622,7 +622,7 @@ while ($i < min($num,$limit))
|
||||
if (!empty($obj->note_private) || !empty($obj->note_public))
|
||||
{
|
||||
print ' <span class="note">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/contrat/note.php?id='.$obj->rowid.'">'.img_picto($langs->trans("ViewPrivateNote"),'object_generic').'</a>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/contrat/note.php?id='.$obj->rowid.'&save_lastsearch_values=1">'.img_picto($langs->trans("ViewPrivateNote"),'note').'</a>';
|
||||
print '</span>';
|
||||
}
|
||||
|
||||
|
||||
@ -389,13 +389,17 @@ class CMailFile
|
||||
// TODO if (! empty($moreinheader)) ...
|
||||
|
||||
// Give the message a subject
|
||||
$this->message->setSubject($this->encodetorfc2822($subject));
|
||||
try {
|
||||
$result = $this->message->setSubject($subject);
|
||||
} catch (Exception $e) {
|
||||
$this->errors[] = $e->getMessage();
|
||||
}
|
||||
|
||||
// Set the From address with an associative array
|
||||
//$this->message->setFrom(array('john@doe.com' => 'John Doe'));
|
||||
if (! empty($from)) {
|
||||
try {
|
||||
$this->message->setFrom($this->getArrayAddress($from));
|
||||
$result = $this->message->setFrom($this->getArrayAddress($from));
|
||||
} catch (Exception $e) {
|
||||
$this->errors[] = $e->getMessage();
|
||||
}
|
||||
@ -404,7 +408,7 @@ class CMailFile
|
||||
// Set the To addresses with an associative array
|
||||
if (! empty($to)) {
|
||||
try {
|
||||
$this->message->setTo($this->getArrayAddress($to));
|
||||
$result = $this->message->setTo($this->getArrayAddress($to));
|
||||
} catch (Exception $e) {
|
||||
$this->errors[] = $e->getMessage();
|
||||
}
|
||||
@ -412,13 +416,17 @@ class CMailFile
|
||||
|
||||
if (! empty($replyto)) {
|
||||
try {
|
||||
$this->message->SetReplyTo($this->getArrayAddress($replyto));
|
||||
$result = $this->message->SetReplyTo($this->getArrayAddress($replyto));
|
||||
} catch (Exception $e) {
|
||||
$this->errors[] = $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
$this->message->setCharSet($conf->file->character_set_client);
|
||||
try {
|
||||
$result = $this->message->setCharSet($conf->file->character_set_client);
|
||||
} catch (Exception $e) {
|
||||
$this->errors[] = $e->getMessage();
|
||||
}
|
||||
|
||||
if (! empty($this->html))
|
||||
{
|
||||
|
||||
@ -976,7 +976,7 @@ abstract class CommonObject
|
||||
* @param string $source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user)
|
||||
* @param int $list 0:Return array contains all properties, 1:Return array contains just id
|
||||
* @param string $code Filter on this code of contact type ('SHIPPING', 'BILLING', ...)
|
||||
* @return array Array of contacts
|
||||
* @return array|int Array of contacts, -1 if error
|
||||
*/
|
||||
function liste_contact($statut=-1,$source='external',$list=0,$code='')
|
||||
{
|
||||
@ -2930,7 +2930,9 @@ abstract class CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch array of objects linked to current object. Links are loaded into this->linkedObjects array and this->linkedObjectsIds
|
||||
* Fetch array of objects linked to current object (object of enabled modules only). Links are loaded into
|
||||
* this->linkedObjectsIds array and
|
||||
* this->linkedObjects array if $loadalsoobjects = 1
|
||||
* Possible usage for parameters:
|
||||
* - all parameters empty -> we look all link to current object (current object can be source or target)
|
||||
* - source id+type -> will get target list linked to source
|
||||
@ -2938,17 +2940,18 @@ abstract class CommonObject
|
||||
* - source id+type + target type -> will get target list of the type
|
||||
* - target id+type + target source -> will get source list of the type
|
||||
*
|
||||
* @param int $sourceid Object source id (if not defined, id of object)
|
||||
* @param string $sourcetype Object source type (if not defined, element name of object)
|
||||
* @param int $targetid Object target id (if not defined, id of object)
|
||||
* @param string $targettype Object target type (if not defined, elemennt name of object)
|
||||
* @param string $clause 'OR' or 'AND' clause used when both source id and target id are provided
|
||||
* @param int $alsosametype 0=Return only links to object that differs from source. 1=Include also link to objects of same type.
|
||||
* @param string $orderby SQL 'ORDER BY' clause
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param int $sourceid Object source id (if not defined, id of object)
|
||||
* @param string $sourcetype Object source type (if not defined, element name of object)
|
||||
* @param int $targetid Object target id (if not defined, id of object)
|
||||
* @param string $targettype Object target type (if not defined, elemennt name of object)
|
||||
* @param string $clause 'OR' or 'AND' clause used when both source id and target id are provided
|
||||
* @param int $alsosametype 0=Return only links to object that differs from source type. 1=Include also link to objects of same type.
|
||||
* @param string $orderby SQL 'ORDER BY' clause
|
||||
* @param int $loadalsoobjects Load also array this->linkedObjects (Use 0 to increase performances)
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @see add_object_linked, updateObjectLinked, deleteObjectLinked
|
||||
*/
|
||||
function fetchObjectLinked($sourceid=null,$sourcetype='',$targetid=null,$targettype='',$clause='OR',$alsosametype=1,$orderby='sourcetype')
|
||||
function fetchObjectLinked($sourceid=null,$sourcetype='',$targetid=null,$targettype='',$clause='OR',$alsosametype=1,$orderby='sourcetype',$loadalsoobjects=1)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -2977,10 +2980,10 @@ abstract class CommonObject
|
||||
$targettype = (! empty($targettype) ? $targettype : $this->element);
|
||||
|
||||
/*if (empty($sourceid) && empty($targetid))
|
||||
{
|
||||
dol_syslog('Bad usage of function. No source nor target id defined (nor as parameter nor as object id)', LOG_ERR);
|
||||
return -1;
|
||||
}*/
|
||||
{
|
||||
dol_syslog('Bad usage of function. No source nor target id defined (nor as parameter nor as object id)', LOG_ERR);
|
||||
return -1;
|
||||
}*/
|
||||
|
||||
// Links between objects are stored in table element_element
|
||||
$sql = 'SELECT rowid, fk_source, sourcetype, fk_target, targettype';
|
||||
@ -3042,7 +3045,8 @@ abstract class CommonObject
|
||||
|
||||
if (! empty($this->linkedObjectsIds))
|
||||
{
|
||||
foreach($this->linkedObjectsIds as $objecttype => $objectids) // $objecttype is a module name ('facture', 'mymodule', ...) or a module name with a suffix ('project_task', 'mymodule_myobj', ...)
|
||||
$tmparray = $this->linkedObjectsIds;
|
||||
foreach($tmparray as $objecttype => $objectids) // $objecttype is a module name ('facture', 'mymodule', ...) or a module name with a suffix ('project_task', 'mymodule_myobj', ...)
|
||||
{
|
||||
// Parse element/subelement (ex: project_task, cabinetmed_consultation, ...)
|
||||
$module = $element = $subelement = $objecttype;
|
||||
@ -3108,21 +3112,28 @@ abstract class CommonObject
|
||||
// Here $module, $classfile and $classname are set
|
||||
if ($conf->$module->enabled && (($element != $this->element) || $alsosametype))
|
||||
{
|
||||
dol_include_once('/'.$classpath.'/'.$classfile.'.class.php');
|
||||
//print '/'.$classpath.'/'.$classfile.'.class.php '.class_exists($classname);
|
||||
if (class_exists($classname))
|
||||
if ($loadalsoobjects)
|
||||
{
|
||||
foreach($objectids as $i => $objectid) // $i is rowid into llx_element_element
|
||||
dol_include_once('/'.$classpath.'/'.$classfile.'.class.php');
|
||||
//print '/'.$classpath.'/'.$classfile.'.class.php '.class_exists($classname);
|
||||
if (class_exists($classname))
|
||||
{
|
||||
$object = new $classname($this->db);
|
||||
$ret = $object->fetch($objectid);
|
||||
if ($ret >= 0)
|
||||
foreach($objectids as $i => $objectid) // $i is rowid into llx_element_element
|
||||
{
|
||||
$this->linkedObjects[$objecttype][$i] = $object;
|
||||
$object = new $classname($this->db);
|
||||
$ret = $object->fetch($objectid);
|
||||
if ($ret >= 0)
|
||||
{
|
||||
$this->linkedObjects[$objecttype][$i] = $object;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($this->linkedObjectsIds[$objecttype]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
@ -5260,37 +5271,34 @@ abstract class CommonObject
|
||||
$val=$this->fields[$key];
|
||||
|
||||
$out='';
|
||||
$type='';
|
||||
$param['options']=array();
|
||||
$size =$this->fields[$key]['size'];
|
||||
// Because we work on extrafields
|
||||
if(preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)){
|
||||
$param['options']=array($reg[1].':'.$reg[2]=>'N');
|
||||
$type ='link';
|
||||
}else if(preg_match('/^link:(.*):(.*)/i', $val['type'], $reg)){
|
||||
$param['options']=array($reg[1].':'.$reg[2]=>'N');
|
||||
$type ='link';
|
||||
}else if(preg_match('/^sellist:(.*):(.*):(.*):(.*)/i', $val['type'], $reg)){
|
||||
|
||||
$param['options']=array($reg[1].':'.$reg[2].':'.$reg[3].':'.$reg[4]=>'N');
|
||||
$type ='sellist';
|
||||
}else if(preg_match('/varchar\((\d+)\)/', $val['type'],$reg)){
|
||||
|
||||
$param['options']=array();
|
||||
$type ='varchar';
|
||||
$size=$reg[1];
|
||||
}else if(preg_match('/varchar/', $val['type'])){
|
||||
|
||||
$param['options']=array();
|
||||
$type ='varchar';
|
||||
}else if(is_array($this->fields[$key]['arrayofkeyval'])){
|
||||
|
||||
$param['options']=$this->fields[$key]['arrayofkeyval'];
|
||||
$type ='select';
|
||||
}else {
|
||||
$param['options']=array();
|
||||
$type =$this->fields[$key]['type'];
|
||||
}
|
||||
$type='';
|
||||
$param = array();
|
||||
$param['options']=array();
|
||||
$size =$this->fields[$key]['size'];
|
||||
// Because we work on extrafields
|
||||
if(preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)){
|
||||
$param['options']=array($reg[1].':'.$reg[2]=>'N');
|
||||
$type ='link';
|
||||
} elseif(preg_match('/^link:(.*):(.*)/i', $val['type'], $reg)) {
|
||||
$param['options']=array($reg[1].':'.$reg[2]=>'N');
|
||||
$type ='link';
|
||||
} elseif(preg_match('/^sellist:(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) {
|
||||
$param['options']=array($reg[1].':'.$reg[2].':'.$reg[3].':'.$reg[4]=>'N');
|
||||
$type ='sellist';
|
||||
} elseif(preg_match('/varchar\((\d+)\)/', $val['type'],$reg)) {
|
||||
$param['options']=array();
|
||||
$type ='varchar';
|
||||
$size=$reg[1];
|
||||
} elseif(preg_match('/varchar/', $val['type'])) {
|
||||
$param['options']=array();
|
||||
$type ='varchar';
|
||||
} elseif(is_array($this->fields[$key]['arrayofkeyval'])) {
|
||||
$param['options']=$this->fields[$key]['arrayofkeyval'];
|
||||
$type ='select';
|
||||
} else {
|
||||
$param['options']=array();
|
||||
$type =$this->fields[$key]['type'];
|
||||
}
|
||||
|
||||
$label=$this->fields[$key]['label'];
|
||||
//$elementtype=$this->fields[$key]['elementtype']; // Seems not used
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Steve Dillon
|
||||
* Copyright (C) 2003 Laurent Passebecq
|
||||
/* Copyright (C) 2003 Steve Dillon
|
||||
* Copyright (C) 2003 Laurent Passebecq
|
||||
* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Francis Appels <francis.appels@yahoo.com>
|
||||
* Copyright (C) 2015 Francis Appels <francis.appels@yahoo.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
|
||||
@ -218,26 +218,26 @@ abstract class CommonStickerGenerator
|
||||
$pdf->SetDrawColor(0,0,0);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* protected Convert units (in to mm, mm to in)
|
||||
* Convert units (in to mm, mm to in)
|
||||
* $src and $dest must be 'in' or 'mm'
|
||||
*
|
||||
* @param int $value value
|
||||
* @param string $src from
|
||||
* @param string $dest to
|
||||
* @param string $src from ('in' or 'mm')
|
||||
* @param string $dest to ('in' or 'mm')
|
||||
* @return float value value after conversion
|
||||
*/
|
||||
function _Convert_Metric($value, $src, $dest)
|
||||
private function convertMetric($value, $src, $dest)
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($src != $dest) {
|
||||
$tab['in'] = 39.37008;
|
||||
$tab['mm'] = 1000;
|
||||
$tab = array(
|
||||
'in'=>39.37008,
|
||||
'mm'=>1000
|
||||
);
|
||||
return $value * $tab[$dest] / $tab[$src];
|
||||
} else {
|
||||
return $value;
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
@ -273,14 +273,14 @@ abstract class CommonStickerGenerator
|
||||
$this->_Metric = $format['metric'];
|
||||
$this->_Avery_Name = $format['name'];
|
||||
$this->_Avery_Code = $format['code'];
|
||||
$this->_Margin_Left = $this->_Convert_Metric($format['marginLeft'], $this->_Metric, $this->_Metric_Doc);
|
||||
$this->_Margin_Top = $this->_Convert_Metric($format['marginTop'], $this->_Metric, $this->_Metric_Doc);
|
||||
$this->_X_Space = $this->_Convert_Metric($format['SpaceX'], $this->_Metric, $this->_Metric_Doc);
|
||||
$this->_Y_Space = $this->_Convert_Metric($format['SpaceY'], $this->_Metric, $this->_Metric_Doc);
|
||||
$this->_Margin_Left = $this->convertMetric($format['marginLeft'], $this->_Metric, $this->_Metric_Doc);
|
||||
$this->_Margin_Top = $this->convertMetric($format['marginTop'], $this->_Metric, $this->_Metric_Doc);
|
||||
$this->_X_Space = $this->convertMetric($format['SpaceX'], $this->_Metric, $this->_Metric_Doc);
|
||||
$this->_Y_Space = $this->convertMetric($format['SpaceY'], $this->_Metric, $this->_Metric_Doc);
|
||||
$this->_X_Number = $format['NX'];
|
||||
$this->_Y_Number = $format['NY'];
|
||||
$this->_Width = $this->_Convert_Metric($format['width'], $this->_Metric, $this->_Metric_Doc);
|
||||
$this->_Height = $this->_Convert_Metric($format['height'], $this->_Metric, $this->_Metric_Doc);
|
||||
$this->_Width = $this->convertMetric($format['width'], $this->_Metric, $this->_Metric_Doc);
|
||||
$this->_Height = $this->convertMetric($format['height'], $this->_Metric, $this->_Metric_Doc);
|
||||
$this->Set_Char_Size($pdf, $format['font-size']);
|
||||
}
|
||||
}
|
||||
|
||||
@ -99,7 +99,11 @@ class EmailSenderProfile extends CommonObject
|
||||
*/
|
||||
public $entity;
|
||||
|
||||
public $label;
|
||||
/**
|
||||
* @var string Email Sender Profile label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
public $email;
|
||||
public $date_creation;
|
||||
public $tms;
|
||||
|
||||
@ -3422,7 +3422,7 @@ class Form
|
||||
if ($obj->situation_final != 1) {
|
||||
//Not prov?
|
||||
if (substr($obj->facnumber, 1, 4) != 'PROV') {
|
||||
if ($selected == $obj->situation_final) {
|
||||
if ($selected == $obj->rowid) {
|
||||
$opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->facnumber . '</option>';
|
||||
} else {
|
||||
$opt .= '<option value="' . $obj->rowid . '">' . $obj->facnumber . '</option>';
|
||||
|
||||
@ -763,7 +763,7 @@ function xml2php($xml)
|
||||
}
|
||||
|
||||
//Let see if the new child is not in the array
|
||||
if ($tab==false && in_array($key,array_keys($array)))
|
||||
if ($tab === false && in_array($key,array_keys($array)))
|
||||
{
|
||||
//If this element is already in the array we will create an indexed array
|
||||
$tmp = $array[$key];
|
||||
@ -772,7 +772,7 @@ function xml2php($xml)
|
||||
$array[$key][] = $child;
|
||||
$tab = true;
|
||||
}
|
||||
elseif($tab == true)
|
||||
elseif($tab === true)
|
||||
{
|
||||
//Add an element in an existing array
|
||||
$array[$key][] = $child;
|
||||
|
||||
@ -729,6 +729,11 @@ function defaultvalues_prepare_head()
|
||||
$head[$h][2] = 'focus';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/defaultvalues.php?mode=mandatory";
|
||||
$head[$h][1] = $langs->trans("DefaultMandatory");
|
||||
$head[$h][2] = 'mandatory';
|
||||
$h++;
|
||||
|
||||
/*$head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=searchkey";
|
||||
$head[$h][1] = $langs->trans("TranslationKeySearch");
|
||||
$head[$h][2] = 'searchkey';
|
||||
|
||||
@ -923,41 +923,41 @@ function num_open_day($timestampStart, $timestampEnd, $inhour=0, $lastday=0, $ha
|
||||
* This replace old function monthArrayOrSelected.
|
||||
*
|
||||
* @param Translate $outputlangs Object langs
|
||||
* @param int $short 1=Return short label
|
||||
* @param int $short 0=Return long label, 1=Return short label
|
||||
* @return array Month string or array if selected < 0
|
||||
*/
|
||||
function monthArray($outputlangs,$short=0)
|
||||
{
|
||||
$montharray = array (
|
||||
1 => $outputlangs->trans("January"),
|
||||
2 => $outputlangs->trans("February"),
|
||||
3 => $outputlangs->trans("March"),
|
||||
4 => $outputlangs->trans("April"),
|
||||
5 => $outputlangs->trans("May"),
|
||||
6 => $outputlangs->trans("June"),
|
||||
7 => $outputlangs->trans("July"),
|
||||
8 => $outputlangs->trans("August"),
|
||||
9 => $outputlangs->trans("September"),
|
||||
10 => $outputlangs->trans("October"),
|
||||
11 => $outputlangs->trans("November"),
|
||||
12 => $outputlangs->trans("December")
|
||||
1 => $outputlangs->trans("Month01"),
|
||||
2 => $outputlangs->trans("Month02"),
|
||||
3 => $outputlangs->trans("Month03"),
|
||||
4 => $outputlangs->trans("Month04"),
|
||||
5 => $outputlangs->trans("Month05"),
|
||||
6 => $outputlangs->trans("Month06"),
|
||||
7 => $outputlangs->trans("Month07"),
|
||||
8 => $outputlangs->trans("Month08"),
|
||||
9 => $outputlangs->trans("Month09"),
|
||||
10 => $outputlangs->trans("Month10"),
|
||||
11 => $outputlangs->trans("Month11"),
|
||||
12 => $outputlangs->trans("Month12")
|
||||
);
|
||||
|
||||
if (! empty($short))
|
||||
{
|
||||
$montharray = array (
|
||||
1 => $outputlangs->trans("JanuaryMin"),
|
||||
2 => $outputlangs->trans("FebruaryMin"),
|
||||
3 => $outputlangs->trans("MarchMin"),
|
||||
4 => $outputlangs->trans("AprilMin"),
|
||||
5 => $outputlangs->trans("MayMin"),
|
||||
6 => $outputlangs->trans("JuneMin"),
|
||||
7 => $outputlangs->trans("JulyMin"),
|
||||
8 => $outputlangs->trans("AugustMin"),
|
||||
9 => $outputlangs->trans("SeptemberMin"),
|
||||
10 => $outputlangs->trans("OctoberMin"),
|
||||
11 => $outputlangs->trans("NovemberMin"),
|
||||
12 => $outputlangs->trans("DecemberMin")
|
||||
1 => $outputlangs->trans("MonthShort01"),
|
||||
2 => $outputlangs->trans("MonthShort02"),
|
||||
3 => $outputlangs->trans("MonthShort03"),
|
||||
4 => $outputlangs->trans("MonthShort04"),
|
||||
5 => $outputlangs->trans("MonthShort05"),
|
||||
6 => $outputlangs->trans("MonthShort06"),
|
||||
7 => $outputlangs->trans("MonthShort07"),
|
||||
8 => $outputlangs->trans("MonthShort08"),
|
||||
9 => $outputlangs->trans("MonthShort09"),
|
||||
10 => $outputlangs->trans("MonthShort10"),
|
||||
11 => $outputlangs->trans("MonthShort11"),
|
||||
12 => $outputlangs->trans("MonthShort12")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -430,7 +430,7 @@ function GETPOST($paramname, $check='none', $method=0, $filter=null, $options=nu
|
||||
}
|
||||
elseif (isset($user->default_values[$relativepathstring]['filters']))
|
||||
{
|
||||
foreach($user->default_values[$relativepathstring]['filters'] as $defkey => $defval)
|
||||
foreach($user->default_values[$relativepathstring]['filters'] as $defkey => $defval) // $defkey is a querystring like 'a=b&c=d', $defval is key of user
|
||||
{
|
||||
$qualified = 0;
|
||||
if ($defkey != '_noquery_')
|
||||
@ -586,7 +586,6 @@ function GETPOST($paramname, $check='none', $method=0, $filter=null, $options=nu
|
||||
// Save data into session if key start with 'search_' or is 'smonth', 'syear', 'month', 'year'
|
||||
if (empty($method) || $method == 3 || $method == 4)
|
||||
{
|
||||
//if (preg_match('/^search_/', $paramname) || in_array($paramname, array('sortorder', 'sortfield", 'smonth', 'syear', 'month', 'year')))
|
||||
if (preg_match('/^search_/', $paramname) || in_array($paramname, array('sortorder','sortfield')))
|
||||
{
|
||||
//var_dump($paramname.' - '.$out.' '.$user->default_values[$relativepathstring]['filters'][$paramname]);
|
||||
@ -595,8 +594,7 @@ function GETPOST($paramname, $check='none', $method=0, $filter=null, $options=nu
|
||||
// - posted value not empty, or
|
||||
// - if posted value is empty and a default value exists that is not empty (it means we did a filter to an empty value when default was not).
|
||||
|
||||
//if (! empty($out) || ! empty($user->default_values[$relativepathstring]['filters'][$paramname]))
|
||||
if ($out != '') // $out = '0' like 'abc' is a search criteria to keep
|
||||
if ($out != '') // $out = '0' or 'abc', it is a search criteria to keep
|
||||
{
|
||||
$user->lastsearch_values_tmp[$relativepathstring][$paramname]=$out;
|
||||
}
|
||||
@ -3152,8 +3150,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
|
||||
//if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on')))
|
||||
if (empty($srconly) && in_array($pictowithoutext, array(
|
||||
'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize',
|
||||
'switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow')
|
||||
'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize',
|
||||
'note','switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow')
|
||||
)) {
|
||||
$fakey = $pictowithoutext;
|
||||
$facolor = ''; $fasize = '';
|
||||
@ -3197,6 +3195,11 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
elseif ($pictowithoutext == 'grip_title' || $pictowithoutext == 'grip') {
|
||||
$fakey = 'fa-arrows';
|
||||
}
|
||||
elseif ($pictowithoutext == 'listlight') {
|
||||
$fakey = 'fa-download';
|
||||
$facolor = '#999';
|
||||
$marginleftonlyshort=1;
|
||||
}
|
||||
elseif ($pictowithoutext == 'printer') {
|
||||
$fakey = 'fa-print';
|
||||
$fasize = '1.2em';
|
||||
@ -3206,6 +3209,11 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
$fakey = 'fa-crop';
|
||||
$facolor = '#444';
|
||||
}
|
||||
elseif ($pictowithoutext == 'note') {
|
||||
$fakey = 'fa-sticky-note-o';
|
||||
$facolor = '#999';
|
||||
$marginleftonlyshort=1;
|
||||
}
|
||||
elseif ($pictowithoutext == 'uparrow') {
|
||||
$fakey = 'fa-mail-forward';
|
||||
$facolor = '#555';
|
||||
@ -4257,7 +4265,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
|
||||
// Left
|
||||
//if ($picto && $titre) print '<td class="nobordernopadding hideonsmartphone" width="40" align="left" valign="middle">'.img_picto('', $picto, 'id="pictotitle"', $pictoisfullpath).'</td>';
|
||||
print '<td class="nobordernopadding valignmiddle">';
|
||||
if ($picto && $titre) print img_picto('', $picto, 'class="hideonsmartphone valignmiddle opacityhigh widthpictotitle" id="pictotitle"', $pictoisfullpath);
|
||||
if ($picto && $titre) print img_picto('', $picto, 'class="hideonsmartphone valignmiddle opacityhigh pictotitle widthpictotitle"', $pictoisfullpath);
|
||||
print '<div class="titre inline-block">'.$titre;
|
||||
if (!empty($titre) && $savtotalnboflines >= 0 && (string) $savtotalnboflines != '') print ' ('.$totalnboflines.')';
|
||||
print '</div></td>';
|
||||
@ -7025,7 +7033,8 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode=
|
||||
*/
|
||||
function printCommonFooter($zone='private')
|
||||
{
|
||||
global $conf, $hookmanager;
|
||||
global $conf, $hookmanager, $user;
|
||||
global $action;
|
||||
global $micro_start_time;
|
||||
|
||||
if ($zone == 'private') print "\n".'<!-- Common footer for private page -->'."\n";
|
||||
@ -7058,7 +7067,71 @@ function printCommonFooter($zone='private')
|
||||
print '});'."\n";
|
||||
}
|
||||
|
||||
// Google Analytics (need Google module)
|
||||
// Management of focus and mandatory for fields
|
||||
if ($action == 'create' || $action == 'edit')
|
||||
{
|
||||
print '/* Code js to manage focus and mandatory form fields */'."\n";
|
||||
$relativepathstring = $_SERVER["PHP_SELF"];
|
||||
// Clean $relativepathstring
|
||||
if (constant('DOL_URL_ROOT')) $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_URL_ROOT'),'/').'/', '', $relativepathstring);
|
||||
$relativepathstring = preg_replace('/^\//', '', $relativepathstring);
|
||||
$relativepathstring = preg_replace('/^custom\//', '', $relativepathstring);
|
||||
$tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING']));
|
||||
foreach($user->default_values[$relativepathstring]['focus'] as $defkey => $defval)
|
||||
{
|
||||
$qualified = 0;
|
||||
if ($defkey != '_noquery_')
|
||||
{
|
||||
$tmpqueryarraytohave=explode('&', $defkey);
|
||||
$foundintru=0;
|
||||
foreach($tmpqueryarraytohave as $tmpquerytohave)
|
||||
{
|
||||
if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1;
|
||||
}
|
||||
if (! $foundintru) $qualified=1;
|
||||
//var_dump($defkey.'-'.$qualified);
|
||||
}
|
||||
else $qualified = 1;
|
||||
|
||||
if ($qualified)
|
||||
{
|
||||
foreach($defval as $paramkey => $paramval)
|
||||
{
|
||||
// Add property 'required' on input
|
||||
print 'jQuery("input[name=\''.$paramkey.'\']").focus();'."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach($user->default_values[$relativepathstring]['mandatory'] as $defkey => $defval)
|
||||
{
|
||||
$qualified = 0;
|
||||
if ($defkey != '_noquery_')
|
||||
{
|
||||
$tmpqueryarraytohave=explode('&', $defkey);
|
||||
$foundintru=0;
|
||||
foreach($tmpqueryarraytohave as $tmpquerytohave)
|
||||
{
|
||||
if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1;
|
||||
}
|
||||
if (! $foundintru) $qualified=1;
|
||||
//var_dump($defkey.'-'.$qualified);
|
||||
}
|
||||
else $qualified = 1;
|
||||
|
||||
if ($qualified)
|
||||
{
|
||||
foreach($defval as $paramkey => $paramval)
|
||||
{
|
||||
// Add property 'required' on input
|
||||
print 'jQuery("input[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n";
|
||||
print 'jQuery("select[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n"; // required on a select works only if key is "", this does not happen in Dolibarr
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Google Analytics
|
||||
// TODO Add a hook here
|
||||
if (! empty($conf->google->enabled) && ! empty($conf->global->MAIN_GOOGLE_AN_ID))
|
||||
{
|
||||
if (($conf->dol_use_jmobile != 4))
|
||||
|
||||
@ -172,7 +172,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di
|
||||
if ($date_start && $date_end) $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
||||
$sql.= " AND (d.product_type = 0"; // Limit to products
|
||||
$sql.= " AND d.date_start is null AND d.date_end IS NULL)"; // enhance detection of products
|
||||
$sql.= " AND (d.".$f_rate." <> 0 OR d.".$total_tva." <> 0)";
|
||||
if (empty($conf->global->MAIN_INCLUDE_ZERO_VAT_IN_REPORTS)) $sql.= " AND (d.".$f_rate." <> 0 OR d.".$total_tva." <> 0)";
|
||||
$sql.= " ORDER BY d.rowid, d.".$fk_facture;
|
||||
}
|
||||
else
|
||||
@ -213,7 +213,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di
|
||||
if ($date_start && $date_end) $sql.= " AND pa.datep >= '".$db->idate($date_start)."' AND pa.datep <= '".$db->idate($date_end)."'";
|
||||
$sql.= " AND (d.product_type = 0"; // Limit to products
|
||||
$sql.= " AND d.date_start is null AND d.date_end IS NULL)"; // enhance detection of products
|
||||
$sql.= " AND (d.".$f_rate." <> 0 OR d.".$total_tva." <> 0)";
|
||||
if (empty($conf->global->MAIN_INCLUDE_ZERO_VAT_IN_REPORTS)) $sql.= " AND (d.".$f_rate." <> 0 OR d.".$total_tva." <> 0)";
|
||||
$sql.= " ORDER BY d.rowid, d.".$fk_facture.", pf.rowid";
|
||||
}
|
||||
|
||||
@ -320,7 +320,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di
|
||||
if ($date_start && $date_end) $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
||||
$sql.= " AND (d.product_type = 1"; // Limit to services
|
||||
$sql.= " OR d.date_start is NOT null OR d.date_end IS NOT NULL)"; // enhance detection of service
|
||||
$sql.= " AND (d.".$f_rate." <> 0 OR d.".$total_tva." <> 0)";
|
||||
if (empty($conf->global->MAIN_INCLUDE_ZERO_VAT_IN_REPORTS)) $sql.= " AND (d.".$f_rate." <> 0 OR d.".$total_tva." <> 0)";
|
||||
$sql.= " ORDER BY d.rowid, d.".$fk_facture;
|
||||
}
|
||||
else
|
||||
@ -361,7 +361,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di
|
||||
if ($date_start && $date_end) $sql.= " AND pa.datep >= '".$db->idate($date_start)."' AND pa.datep <= '".$db->idate($date_end)."'";
|
||||
$sql.= " AND (d.product_type = 1"; // Limit to services
|
||||
$sql.= " OR d.date_start is NOT null OR d.date_end IS NOT NULL)"; // enhance detection of service
|
||||
$sql.= " AND (d.".$f_rate." <> 0 OR d.".$total_tva." <> 0)";
|
||||
if (empty($conf->global->MAIN_INCLUDE_ZERO_VAT_IN_REPORTS)) $sql.= " AND (d.".$f_rate." <> 0 OR d.".$total_tva." <> 0)";
|
||||
$sql.= " ORDER BY d.rowid, d.".$fk_facture.", pf.rowid";
|
||||
}
|
||||
|
||||
@ -465,7 +465,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di
|
||||
if ($date_start && $date_end) $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
|
||||
$sql.= " AND (d.product_type = -1";
|
||||
$sql.= " OR e.date_debut is NOT null OR e.date_fin IS NOT NULL)"; // enhance detection of service
|
||||
$sql.= " AND (d.".$f_rate." <> 0 OR d.total_tva <> 0)";
|
||||
if (empty($conf->global->MAIN_INCLUDE_ZERO_VAT_IN_REPORTS)) $sql.= " AND (d.".$f_rate." <> 0 OR d.total_tva <> 0)";
|
||||
$sql.= " ORDER BY e.rowid";
|
||||
|
||||
if (! $sql)
|
||||
@ -641,7 +641,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
|
||||
if ($date_start && $date_end) $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
||||
$sql.= " AND (d.product_type = 0"; // Limit to products
|
||||
$sql.= " AND d.date_start is null AND d.date_end IS NULL)"; // enhance detection of products
|
||||
$sql.= " AND (d.".$f_rate." <> 0 OR d.".$total_tva." <> 0)";
|
||||
if (empty($conf->global->MAIN_INCLUDE_ZERO_VAT_IN_REPORTS)) $sql.= " AND (d.".$f_rate." <> 0 OR d.".$total_tva." <> 0)";
|
||||
$sql.= " ORDER BY d.rowid, d.".$fk_facture;
|
||||
}
|
||||
else
|
||||
@ -682,7 +682,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
|
||||
if ($date_start && $date_end) $sql.= " AND pa.datep >= '".$db->idate($date_start)."' AND pa.datep <= '".$db->idate($date_end)."'";
|
||||
$sql.= " AND (d.product_type = 0"; // Limit to products
|
||||
$sql.= " AND d.date_start is null AND d.date_end IS NULL)"; // enhance detection of products
|
||||
$sql.= " AND (d.".$f_rate." <> 0 OR d.".$total_tva." <> 0)";
|
||||
if (empty($conf->global->MAIN_INCLUDE_ZERO_VAT_IN_REPORTS)) $sql.= " AND (d.".$f_rate." <> 0 OR d.".$total_tva." <> 0)";
|
||||
$sql.= " ORDER BY d.rowid, d.".$fk_facture.", pf.rowid";
|
||||
}
|
||||
|
||||
@ -789,7 +789,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
|
||||
if ($date_start && $date_end) $sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
||||
$sql.= " AND (d.product_type = 1"; // Limit to services
|
||||
$sql.= " OR d.date_start is NOT null OR d.date_end IS NOT NULL)"; // enhance detection of service
|
||||
$sql.= " AND (d.".$f_rate." <> 0 OR d.".$total_tva." <> 0)";
|
||||
if (empty($conf->global->MAIN_INCLUDE_ZERO_VAT_IN_REPORTS)) $sql.= " AND (d.".$f_rate." <> 0 OR d.".$total_tva." <> 0)";
|
||||
$sql.= " ORDER BY d.rowid, d.".$fk_facture;
|
||||
}
|
||||
else
|
||||
@ -830,7 +830,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
|
||||
if ($date_start && $date_end) $sql.= " AND pa.datep >= '".$db->idate($date_start)."' AND pa.datep <= '".$db->idate($date_end)."'";
|
||||
$sql.= " AND (d.product_type = 1"; // Limit to services
|
||||
$sql.= " OR d.date_start is NOT null OR d.date_end IS NOT NULL)"; // enhance detection of service
|
||||
$sql.= " AND (d.".$f_rate." <> 0 OR d.".$total_tva." <> 0)";
|
||||
if (empty($conf->global->MAIN_INCLUDE_ZERO_VAT_IN_REPORTS)) $sql.= " AND (d.".$f_rate." <> 0 OR d.".$total_tva." <> 0)";
|
||||
$sql.= " ORDER BY d.rowid, d.".$fk_facture.", pf.rowid";
|
||||
}
|
||||
|
||||
@ -934,7 +934,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
|
||||
if ($date_start && $date_end) $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
|
||||
$sql.= " AND (d.product_type = -1";
|
||||
$sql.= " OR e.date_debut is NOT null OR e.date_fin IS NOT NULL)"; // enhance detection of service
|
||||
$sql.= " AND (d.".$f_rate." <> 0 OR d.total_tva <> 0)";
|
||||
if (empty($conf->global->MAIN_INCLUDE_ZERO_VAT_IN_REPORTS)) $sql.= " AND (d.".$f_rate." <> 0 OR d.total_tva <> 0)";
|
||||
$sql.= " ORDER BY e.rowid";
|
||||
|
||||
if (! $sql)
|
||||
|
||||
@ -114,7 +114,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
|
||||
|
||||
// Translations
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "dict", "withdrawals", "companies", "projects", "bills"));
|
||||
|
||||
if (! empty($conf->bank->dir_output))
|
||||
|
||||
@ -224,7 +224,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
|
||||
|
||||
// Translations
|
||||
// Load translation files required by the page
|
||||
$outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "orders", "deliveries"));
|
||||
|
||||
$nblignes = count($object->lines);
|
||||
@ -1239,7 +1239,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
{
|
||||
global $conf,$langs,$hookmanager;
|
||||
|
||||
// Translations
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "bills", "propal", "orders", "companies"));
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
@ -216,6 +216,7 @@ class doc_generic_contract_odt extends ModelePDFContract
|
||||
$sav_charset_output=$outputlangs->charset_output;
|
||||
$outputlangs->charset_output='UTF-8';
|
||||
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "dict", "companies", "bills"));
|
||||
|
||||
if ($conf->contrat->dir_output)
|
||||
|
||||
@ -180,7 +180,7 @@ class pdf_strato extends ModelePDFContract
|
||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
|
||||
|
||||
// Translations
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "dict", "companies", "contracts"));
|
||||
|
||||
if ($conf->contrat->dir_output)
|
||||
@ -542,7 +542,7 @@ class pdf_strato extends ModelePDFContract
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
// Translations
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "dict", "contract", "companies"));
|
||||
|
||||
pdf_pagehead($pdf,$outputlangs,$this->page_hauteur);
|
||||
|
||||
@ -83,6 +83,7 @@ class html_cerfafr extends ModeleDon
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "donations"));
|
||||
|
||||
$currency = !empty($currency) ? $currency : $conf->currency;
|
||||
|
||||
@ -227,6 +227,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
|
||||
$sav_charset_output=$outputlangs->charset_output;
|
||||
$outputlangs->charset_output='UTF-8';
|
||||
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "dict", "companies", "bills"));
|
||||
|
||||
if ($conf->expedition->dir_output."/sending")
|
||||
|
||||
@ -165,7 +165,7 @@ class pdf_merou extends ModelePdfExpedition
|
||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
|
||||
|
||||
// Translations
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies", "propal", "deliveries", "sendings", "productbatch"));
|
||||
|
||||
if ($conf->expedition->dir_output)
|
||||
|
||||
@ -196,7 +196,7 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
|
||||
|
||||
// Translations
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies", "propal", "deliveries", "sendings", "productbatch"));
|
||||
|
||||
$nblignes = count($object->lines);
|
||||
|
||||
@ -211,7 +211,7 @@ class pdf_standard extends ModeleExpenseReport
|
||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
|
||||
|
||||
// Translations
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "trips", "projects", "dict"));
|
||||
|
||||
$nblignes = count($object->lines);
|
||||
@ -568,9 +568,9 @@ class pdf_standard extends ModeleExpenseReport
|
||||
*/
|
||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
{
|
||||
global $conf,$langs,$hookmanager;
|
||||
global $conf, $langs, $hookmanager;
|
||||
|
||||
// Translations
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "trips", "companies"));
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
@ -239,7 +239,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
|
||||
|
||||
// Translations
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies"));
|
||||
|
||||
$nblignes = count($object->lines);
|
||||
@ -1574,7 +1574,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
// Translations
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "bills", "propal", "companies"));
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
@ -172,7 +172,7 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
|
||||
|
||||
// Translations
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "interventions", "dict", "companies"));
|
||||
|
||||
if ($conf->ficheinter->dir_output)
|
||||
|
||||
@ -195,7 +195,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
|
||||
|
||||
// Translations
|
||||
// Load translation files required by the page
|
||||
$outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "sendings", "deliveries"));
|
||||
|
||||
if ($conf->expedition->dir_output)
|
||||
|
||||
@ -81,7 +81,6 @@ class modCashDesk extends DolibarrModules
|
||||
|
||||
// Permissions
|
||||
$this->rights = array();
|
||||
$this->rights_class = 'cashdesk';
|
||||
$r=0;
|
||||
|
||||
$r++;
|
||||
|
||||
@ -133,6 +133,13 @@ class modProduct extends DolibarrModules
|
||||
$this->rights[$r][4] = 'export';
|
||||
$r++;
|
||||
|
||||
$this->rights[$r][0] = 39;
|
||||
$this->rights[$r][1] = 'Ignore minimum price';
|
||||
$this->rights[$r][2] = 'r';
|
||||
$this->rights[$r][3] = 0;
|
||||
$this->rights[$r][4] = 'ignore_price_min_advance';
|
||||
$r++;
|
||||
|
||||
// Menus
|
||||
//-------
|
||||
|
||||
|
||||
326
htdocs/core/modules/modTakePos.class.php
Normal file
326
htdocs/core/modules/modTakePos.class.php
Normal file
@ -0,0 +1,326 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018 SuperAdmin
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \defgroup takepos Module TakePos
|
||||
* \brief TakePos module descriptor.
|
||||
*
|
||||
* \file htdocs/takepos/core/modules/modTakePos.class.php
|
||||
* \ingroup takepos
|
||||
* \brief Description and activation file for module TakePos
|
||||
*/
|
||||
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Class to describe and enable module TakePos
|
||||
*/
|
||||
class modTakePos extends DolibarrModules
|
||||
{
|
||||
/**
|
||||
* Constructor. Define names, constants, directories, boxes, permissions
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct($db)
|
||||
{
|
||||
global $langs,$conf;
|
||||
|
||||
$this->db = $db;
|
||||
|
||||
// Id for module (must be unique).
|
||||
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
|
||||
$this->numero = 50150;
|
||||
// Key text used to identify module (for permissions, menus, etc...)
|
||||
$this->rights_class = 'takepos';
|
||||
|
||||
// Family can be 'crm','financial','hr','projects','products','ecm','technic','interface','other'
|
||||
// It is used to group modules by family in module setup page
|
||||
$this->family = "portal";
|
||||
// Module position in the family on 2 digits ('01', '10', '20', ...)
|
||||
$this->module_position = '90';
|
||||
// Gives the possibility to the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this)
|
||||
//$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily")));
|
||||
|
||||
// Module label (no space allowed), used if translation string 'ModuleTakePosName' not found (MyModue is name of module).
|
||||
$this->name = preg_replace('/^mod/i','',get_class($this));
|
||||
// Module description, used if translation string 'ModuleTakePosDesc' not found (MyModue is name of module).
|
||||
$this->description = "Point of sales module (Touch Screen POS)";
|
||||
// Used only if file README.md and README-LL.md not found.
|
||||
$this->descriptionlong = "Point Of Sales (compliant with touch screen)";
|
||||
|
||||
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
|
||||
$this->version = 'experimental';
|
||||
// Key used in llx_const table to save module status enabled/disabled (where TAKEPOS is value of property name of module in uppercase)
|
||||
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
||||
// Name of image file used for this module.
|
||||
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
|
||||
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
|
||||
$this->picto='list';
|
||||
|
||||
// Defined all module parts (triggers, login, substitutions, menus, css, etc...)
|
||||
// for default path (eg: /takepos/core/xxxxx) (0=disable, 1=enable)
|
||||
// for specific path of parts (eg: /takepos/core/modules/barcode)
|
||||
// for specific css file (eg: /takepos/css/takepos.css.php)
|
||||
$this->module_parts = array(
|
||||
'triggers' => 0, // Set this to 1 if module has its own trigger directory (core/triggers)
|
||||
'login' => 0, // Set this to 1 if module has its own login method file (core/login)
|
||||
'substitutions' => 1, // Set this to 1 if module has its own substitution function file (core/substitutions)
|
||||
'menus' => 0, // Set this to 1 if module has its own menus handler directory (core/menus)
|
||||
'theme' => 0, // Set this to 1 if module has its own theme directory (theme)
|
||||
'tpl' => 0, // Set this to 1 if module overwrite template dir (core/tpl)
|
||||
'barcode' => 0, // Set this to 1 if module has its own barcode directory (core/modules/barcode)
|
||||
'models' => 0, // Set this to 1 if module has its own models directory (core/modules/xxx)
|
||||
'hooks' => array('data'=>array('invoicecard'), 'entity'=>'0') // Set here all hooks context managed by module. To find available hook context, make a "grep -r '>initHooks(' *" on source code. You can also set hook context 'all'
|
||||
);
|
||||
|
||||
// Data directories to create when module is enabled.
|
||||
// Example: this->dirs = array("/takepos/temp","/takepos/subdir");
|
||||
$this->dirs = array();
|
||||
|
||||
// Config pages. Put here list of php page, stored into takepos/admin directory, to use to setup module.
|
||||
$this->config_page_url = array("setup.php@takepos");
|
||||
|
||||
// Dependencies
|
||||
$this->hidden = false; // A condition to hide module
|
||||
$this->depends = array('always'=>"modBanque", 'always'=>"modFacture", 'always'=>"modProduct", 'always'=>'modCategorie', 'FR'=>'modBlockedLog'); // List of module class names as string that must be enabled if this module is enabled
|
||||
$this->requiredby = array(); // List of module ids to disable if this one is disabled
|
||||
$this->conflictwith = array(); // List of module class names as string this module is in conflict with
|
||||
$this->langfiles = array("cashdesk");
|
||||
$this->phpmin = array(5,43); // Minimum version of PHP required by module
|
||||
$this->need_dolibarr_version = array(4,0); // Minimum version of Dolibarr required by module
|
||||
$this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
|
||||
$this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
|
||||
//$this->automatic_activation = array('FR'=>'TakePosWasAutomaticallyActivatedBecauseOfYourCountryChoice');
|
||||
//$this->always_enabled = true; // If true, can't be disabled
|
||||
|
||||
// Constants
|
||||
// List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive)
|
||||
// Example: $this->const=array(0=>array('TAKEPOS_MYNEWCONST1','chaine','myvalue','This is a constant to add',1),
|
||||
// 1=>array('TAKEPOS_MYNEWCONST2','chaine','myvalue','This is another constant to add',0, 'current', 1)
|
||||
// );
|
||||
$this->const = array(
|
||||
//1=>array('TAKEPOS_MYCONSTANT', 'chaine', 'avalue', 'This is a constant to add', 1, 'allentities', 1)
|
||||
);
|
||||
|
||||
|
||||
if (! isset($conf->takepos) || ! isset($conf->takepos->enabled))
|
||||
{
|
||||
$conf->takepos=new stdClass();
|
||||
$conf->takepos->enabled=0;
|
||||
}
|
||||
|
||||
|
||||
// Array to add new pages in new tabs
|
||||
$this->tabs = array();
|
||||
// Example:
|
||||
// $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@takepos:$user->rights->takepos->read:/takepos/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1
|
||||
// $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@takepos:$user->rights->othermodule->read:/takepos/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
|
||||
// $this->tabs[] = array('data'=>'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname
|
||||
//
|
||||
// Where objecttype can be
|
||||
// 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
|
||||
// 'contact' to add a tab in contact view
|
||||
// 'contract' to add a tab in contract view
|
||||
// 'group' to add a tab in group view
|
||||
// 'intervention' to add a tab in intervention view
|
||||
// 'invoice' to add a tab in customer invoice view
|
||||
// 'invoice_supplier' to add a tab in supplier invoice view
|
||||
// 'member' to add a tab in fundation member view
|
||||
// 'opensurveypoll' to add a tab in opensurvey poll view
|
||||
// 'order' to add a tab in customer order view
|
||||
// 'order_supplier' to add a tab in supplier order view
|
||||
// 'payment' to add a tab in payment view
|
||||
// 'payment_supplier' to add a tab in supplier payment view
|
||||
// 'product' to add a tab in product view
|
||||
// 'propal' to add a tab in propal view
|
||||
// 'project' to add a tab in project view
|
||||
// 'stock' to add a tab in stock view
|
||||
// 'thirdparty' to add a tab in third party view
|
||||
// 'user' to add a tab in user view
|
||||
|
||||
|
||||
// Dictionaries
|
||||
$this->dictionaries=array();
|
||||
/* Example:
|
||||
$this->dictionaries=array(
|
||||
'langs'=>'mylangfile@takepos',
|
||||
'tabname'=>array(MAIN_DB_PREFIX."table1",MAIN_DB_PREFIX."table2",MAIN_DB_PREFIX."table3"), // List of tables we want to see into dictonnary editor
|
||||
'tablib'=>array("Table1","Table2","Table3"), // Label of tables
|
||||
'tabsql'=>array('SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table1 as f','SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table2 as f','SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table3 as f'), // Request to select fields
|
||||
'tabsqlsort'=>array("label ASC","label ASC","label ASC"), // Sort order
|
||||
'tabfield'=>array("code,label","code,label","code,label"), // List of fields (result of select to show dictionary)
|
||||
'tabfieldvalue'=>array("code,label","code,label","code,label"), // List of fields (list of fields to edit a record)
|
||||
'tabfieldinsert'=>array("code,label","code,label","code,label"), // List of fields (list of fields for insert)
|
||||
'tabrowid'=>array("rowid","rowid","rowid"), // Name of columns with primary key (try to always name it 'rowid')
|
||||
'tabcond'=>array($conf->takepos->enabled,$conf->takepos->enabled,$conf->takepos->enabled) // Condition to show each dictionary
|
||||
);
|
||||
*/
|
||||
|
||||
|
||||
// Boxes/Widgets
|
||||
// Add here list of php file(s) stored in takepos/core/boxes that contains class to show a widget.
|
||||
$this->boxes = array(
|
||||
//0=>array('file'=>'takeposwidget1.php@takepos','note'=>'Widget provided by TakePos','enabledbydefaulton'=>'Home'),
|
||||
//1=>array('file'=>'takeposwidget2.php@takepos','note'=>'Widget provided by TakePos'),
|
||||
//2=>array('file'=>'takeposwidget3.php@takepos','note'=>'Widget provided by TakePos')
|
||||
);
|
||||
|
||||
|
||||
// Cronjobs (List of cron jobs entries to add when module is enabled)
|
||||
// unit_frequency must be 60 for minute, 3600 for hour, 86400 for day, 604800 for week
|
||||
$this->cronjobs = array(
|
||||
//0=>array('label'=>'MyJob label', 'jobtype'=>'method', 'class'=>'/takepos/class/myobject.class.php', 'objectname'=>'MyObject', 'method'=>'doScheduledJob', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true)
|
||||
);
|
||||
// Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'/dir/class/file.class.php', 'objectname'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true),
|
||||
// 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24, 'status'=>0, 'test'=>true)
|
||||
// );
|
||||
|
||||
|
||||
// Permissions
|
||||
$this->rights = array(); // Permission array used by this module
|
||||
|
||||
/*$r=0;
|
||||
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Read myobject of TakePos'; // Permission label
|
||||
$this->rights[$r][3] = 1; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'read'; // In php code, permission will be checked by test if ($user->rights->takepos->level1->level2)
|
||||
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->takepos->level1->level2)
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Create/Update myobject of TakePos'; // Permission label
|
||||
$this->rights[$r][3] = 1; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->takepos->level1->level2)
|
||||
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->takepos->level1->level2)
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Delete myobject of TakePos'; // Permission label
|
||||
$this->rights[$r][3] = 1; // Permission by default for new user (0/1)
|
||||
$this->rights[$r][4] = 'delete'; // In php code, permission will be checked by test if ($user->rights->takepos->level1->level2)
|
||||
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->takepos->level1->level2)
|
||||
*/
|
||||
|
||||
// Main menu entries
|
||||
$this->menu = array(); // List of menus to add
|
||||
$r=0;
|
||||
|
||||
// Add here entries to declare new menus
|
||||
|
||||
/* BEGIN MODULEBUILDER TOPMENU */
|
||||
$this->menu[$r++]=array('fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||
'type'=>'top', // This is a Top menu entry
|
||||
'titre'=>'PointOfSale',
|
||||
'mainmenu'=>'takepos',
|
||||
'leftmenu'=>'',
|
||||
'url'=>'/takepos/takepos.php',
|
||||
'langs'=>'cashdesk', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>1000+$r,
|
||||
'enabled'=>'$conf->takepos->enabled', // Define condition to show or hide menu entry. Use '$conf->takepos->enabled' if entry must be visible if module is enabled.
|
||||
'perms'=>'1', // Use 'perms'=>'$user->rights->takepos->level1->level2' if you want your menu with a permission rules
|
||||
'target'=>'takepos',
|
||||
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
|
||||
/* END MODULEBUILDER TOPMENU */
|
||||
|
||||
/* BEGIN MODULEBUILDER LEFTMENU MYOBJECT
|
||||
$this->menu[$r++]=array( 'fk_menu'=>'fk_mainmenu=takepos', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||
'type'=>'left', // This is a Left menu entry
|
||||
'titre'=>'List MyObject',
|
||||
'mainmenu'=>'takepos',
|
||||
'leftmenu'=>'takepos_myobject_list',
|
||||
'url'=>'/takepos/myobject_list.php',
|
||||
'langs'=>'cashdesk', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>1000+$r,
|
||||
'enabled'=>'$conf->takepos->enabled', // Define condition to show or hide menu entry. Use '$conf->takepos->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'1', // Use 'perms'=>'$user->rights->takepos->level1->level2' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
$this->menu[$r++]=array( 'fk_menu'=>'fk_mainmenu=takepos,fk_leftmenu=takepos', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||
'type'=>'left', // This is a Left menu entry
|
||||
'titre'=>'New MyObject',
|
||||
'mainmenu'=>'takepos',
|
||||
'leftmenu'=>'takepos_myobject_new',
|
||||
'url'=>'/takepos/myobject_page.php?action=create',
|
||||
'langs'=>'cashdesk', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>1000+$r,
|
||||
'enabled'=>'$conf->takepos->enabled', // Define condition to show or hide menu entry. Use '$conf->takepos->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'1', // Use 'perms'=>'$user->rights->takepos->level1->level2' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
END MODULEBUILDER LEFTMENU MYOBJECT */
|
||||
|
||||
|
||||
// Exports
|
||||
$r=1;
|
||||
|
||||
/* BEGIN MODULEBUILDER EXPORT MYOBJECT */
|
||||
/*
|
||||
$langs->load("cashdesk");
|
||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||
$this->export_label[$r]='MyObjectLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
|
||||
$this->export_icon[$r]='myobject@takepos';
|
||||
$keyforclass = 'MyObject'; $keyforclassfile='/mymobule/class/myobject.class.php'; $keyforelement='myobject';
|
||||
include DOL_DOCUMENT_ROOT.'/core/commonfieldsinexport.inc.php';
|
||||
$keyforselect='myobject'; $keyforaliasextra='extra'; $keyforelement='myobject';
|
||||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
//$this->export_dependencies_array[$r]=array('mysubobject'=>'ts.rowid', 't.myfield'=>array('t.myfield2','t.myfield3')); // To force to activate one or several fields if we select some fields that need same (like to select a unique key if we ask a field of a child to avoid the DISTINCT to discard them, or for computed field than need several other fields)
|
||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'myobject as t';
|
||||
$this->export_sql_end[$r] .=' WHERE 1 = 1';
|
||||
$this->export_sql_end[$r] .=' AND t.entity IN ('.getEntity('myobject').')';
|
||||
$r++; */
|
||||
/* END MODULEBUILDER EXPORT MYOBJECT */
|
||||
}
|
||||
|
||||
/**
|
||||
* Function called when module is enabled.
|
||||
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
|
||||
* It also creates data directories
|
||||
*
|
||||
* @param string $options Options when enabling module ('', 'noboxes')
|
||||
* @return int 1 if OK, 0 if KO
|
||||
*/
|
||||
public function init($options='')
|
||||
{
|
||||
$this->_load_tables('/takepos/sql/');
|
||||
|
||||
$sql = array();
|
||||
|
||||
// Remove permissions and default values
|
||||
$this->remove($options);
|
||||
|
||||
return $this->_init($sql, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function called when module is disabled.
|
||||
* Remove from database constants, boxes and permissions from Dolibarr database.
|
||||
* Data directories are not deleted
|
||||
*
|
||||
* @param string $options Options when enabling module ('', 'noboxes')
|
||||
* @return int 1 if OK, 0 if KO
|
||||
*/
|
||||
public function remove($options = '')
|
||||
{
|
||||
$sql = array();
|
||||
|
||||
return $this->_remove($sql, $options);
|
||||
}
|
||||
}
|
||||
@ -240,6 +240,7 @@ class doc_generic_product_odt extends ModelePDFProduct
|
||||
$sav_charset_output=$outputlangs->charset_output;
|
||||
$outputlangs->charset_output='UTF-8';
|
||||
|
||||
// Load translation files required by the page
|
||||
$outputlangs->loadLangs(array("main", "dict", "companies", "bills"));
|
||||
|
||||
if ($conf->produit->dir_output)
|
||||
|
||||
@ -445,6 +445,7 @@ class doc_generic_task_odt extends ModelePDFTask
|
||||
$sav_charset_output=$outputlangs->charset_output;
|
||||
$outputlangs->charset_output='UTF-8';
|
||||
|
||||
// Load translation files required by the page
|
||||
$outputlangs->loadLangs(array("main", "dict", "companies", "projects"));
|
||||
|
||||
if ($conf->projet->dir_output)
|
||||
|
||||
@ -122,24 +122,22 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode
|
||||
|
||||
$return='000001';
|
||||
|
||||
$field='';$where='';
|
||||
if ($type == 0)
|
||||
{
|
||||
$field='';
|
||||
$where='';
|
||||
$prefix = '';
|
||||
if ($type == 0) {
|
||||
$field = 'code_client';
|
||||
$prefix = $this->prefixcustomer;
|
||||
//$where = ' AND client in (1,2)';
|
||||
}
|
||||
else if ($type == 1)
|
||||
{
|
||||
} elseif ($type == 1) {
|
||||
$field = 'code_fournisseur';
|
||||
$prefix = $this->prefixsupplier;
|
||||
//$where = ' AND fournisseur = 1';
|
||||
}
|
||||
else return -1;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
if ($type == 0) $prefix=$this->prefixcustomer;
|
||||
if ($type == 1) $prefix=$this->prefixsupplier;
|
||||
|
||||
// D'abord on recupere la valeur max (reponse immediate car champ indexe)
|
||||
// D'abord on recupere la valeur max (reponse immediate car champ indexe)
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(".$field." FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe";
|
||||
|
||||
@ -214,7 +214,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
|
||||
|
||||
// Translations
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "supplier_proposal"));
|
||||
|
||||
$nblignes = count($object->lines);
|
||||
@ -1280,9 +1280,9 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
||||
*/
|
||||
function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
|
||||
{
|
||||
global $conf,$langs;
|
||||
global $conf, $langs;
|
||||
|
||||
// Translations
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "bills", "supplier_proposal", "companies"));
|
||||
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
@ -33,12 +33,12 @@ class mod_ticket_universal extends ModeleNumRefTicket
|
||||
* Dolibarr version of the loaded document
|
||||
* @public string
|
||||
*/
|
||||
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
public $error = '';
|
||||
public $error = '';
|
||||
|
||||
/**
|
||||
* @var string Nom du modele
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -42,7 +43,7 @@ print '});'."\n";
|
||||
|
||||
print '$("#show-'.$blocname.'").click(function(){'."\n";
|
||||
print ' setShowHide(1);'."\n";
|
||||
print ' $("#'.$blocname.'").show("blind", {direction: "vertical"}, 300).addClass("nohideobject");'."\n";
|
||||
print ' $("#'.$blocname.'_bloc").show("blind", {direction: "vertical"}, 300).addClass("nohideobject");'."\n";
|
||||
print ' $(this).hide();'."\n";
|
||||
print ' $("#hide-'.$blocname.'").show();'."\n";
|
||||
print '});'."\n";
|
||||
|
||||
@ -74,6 +74,7 @@ if ($action == 'presend')
|
||||
{
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array('commercial','bills','orders','contracts','members','propal','products','supplier_proposal','interventions'));
|
||||
}
|
||||
|
||||
|
||||
@ -259,9 +259,9 @@ if (!empty($extrafieldsline))
|
||||
<td colspan="<?php echo 7+$colspan ?>"><?php echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?>
|
||||
<?php
|
||||
$hourmin=(isset($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE:'');
|
||||
print $form->selectDate($line->date_start, 'date_start', $hourmin, $hourmin, $line->date_start?0:1, "updateligne", 1, 0);
|
||||
print $form->selectDate($line->date_start, 'date_start', $hourmin, $hourmin, $line->date_start?0:1, "updateline", 1, 0);
|
||||
print ' '.$langs->trans('to').' ';
|
||||
print $form->selectDate($line->date_end, 'date_end', $hourmin, $hourmin, $line->date_end?0:1, "updateligne", 1, 0);
|
||||
print $form->selectDate($line->date_end, 'date_end', $hourmin, $hourmin, $line->date_end?0:1, "updateline", 1, 0);
|
||||
print '<script type="text/javascript">';
|
||||
if (!$line->date_start) {
|
||||
if (isset($conf->global->MAIN_DEFAULT_DATE_START_HOUR)) {
|
||||
|
||||
@ -26,7 +26,7 @@ require_once DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php";
|
||||
|
||||
|
||||
/**
|
||||
* Crob Job class
|
||||
* Cron Job class
|
||||
*/
|
||||
class Cronjob extends CommonObject
|
||||
{
|
||||
@ -53,7 +53,12 @@ class Cronjob extends CommonObject
|
||||
public $jobtype;
|
||||
public $tms='';
|
||||
public $datec='';
|
||||
public $label;
|
||||
|
||||
/**
|
||||
* @var string Cron Job label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
public $command;
|
||||
public $classesname;
|
||||
public $objectname;
|
||||
@ -1351,7 +1356,12 @@ class Cronjobline
|
||||
|
||||
public $tms='';
|
||||
public $datec='';
|
||||
public $label;
|
||||
|
||||
/**
|
||||
* @var string Cron Job Line label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
public $jobtype;
|
||||
public $command;
|
||||
public $classesname;
|
||||
|
||||
@ -56,7 +56,12 @@ class EcmFiles extends CommonObject
|
||||
*/
|
||||
public $ref;
|
||||
|
||||
public $label; // hash of file content (md5_file(dol_osencode($destfull))
|
||||
/**
|
||||
* hash of file content (md5_file(dol_osencode($destfull))
|
||||
* @var string Ecm Files label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
public $share; // hash for file sharing, empty by default (example: getRandomPassword(true))
|
||||
|
||||
/**
|
||||
@ -848,7 +853,10 @@ class EcmFiles extends CommonObject
|
||||
|
||||
class EcmfilesLine
|
||||
{
|
||||
public $label;
|
||||
/**
|
||||
* @var string ECM files line label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
/**
|
||||
* @var int Entity
|
||||
|
||||
@ -1212,7 +1212,7 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == "updateligne" && $user->rights->expensereport->creer)
|
||||
if ($action == "updateline" && $user->rights->expensereport->creer)
|
||||
{
|
||||
$object = new ExpenseReport($db);
|
||||
$object->fetch($id);
|
||||
@ -1964,7 +1964,7 @@ else
|
||||
|
||||
print '<div style="clear: both;"></div>';
|
||||
|
||||
$actiontouse='updateligne';
|
||||
$actiontouse='updateline';
|
||||
if (($object->fk_statut==0 || $object->fk_statut==99) && $action != 'editline') $actiontouse='addline';
|
||||
|
||||
print '<form name="expensereport" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
|
||||
@ -3159,7 +3159,12 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
||||
// From llx_commande_fournisseurdet
|
||||
public $fk_parent_line;
|
||||
public $fk_facture;
|
||||
|
||||
/**
|
||||
* @var string supplier order line label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
public $rang = 0;
|
||||
public $special_code = 0;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -72,9 +72,29 @@ ALTER TABLE llx_categorie ADD COLUMN ref_ext varchar(255);
|
||||
|
||||
ALTER TABLE llx_societe ADD COLUMN twitter varchar(255) after skype;
|
||||
ALTER TABLE llx_societe ADD COLUMN facebook varchar(255) after skype;
|
||||
ALTER TABLE llx_societe ADD COLUMN instagram varchar(255) after skype;
|
||||
ALTER TABLE llx_societe ADD COLUMN snapchat varchar(255) after skype;
|
||||
ALTER TABLE llx_societe ADD COLUMN googleplus varchar(255) after skype;
|
||||
ALTER TABLE llx_societe ADD COLUMN youtube varchar(255) after skype;
|
||||
ALTER TABLE llx_societe ADD COLUMN whatsapp varchar(255) after skype;
|
||||
ALTER TABLE llx_socpeople ADD COLUMN twitter varchar(255) after skype;
|
||||
ALTER TABLE llx_socpeople ADD COLUMN facebook varchar(255) after skype;
|
||||
|
||||
ALTER TABLE llx_socpeople ADD COLUMN instagram varchar(255) after skype;
|
||||
ALTER TABLE llx_socpeople ADD COLUMN snapchat varchar(255) after skype;
|
||||
ALTER TABLE llx_socpeople ADD COLUMN googleplus varchar(255) after skype;
|
||||
ALTER TABLE llx_socpeople ADD COLUMN youtube varchar(255) after skype;
|
||||
ALTER TABLE llx_socpeople ADD COLUMN whatsapp varchar(255) after skype;
|
||||
|
||||
ALTER TABLE llx_website CHANGE COLUMN fk_user_create fk_user_creat integer;
|
||||
ALTER TABLE llx_website_page CHANGE COLUMN fk_user_create fk_user_creat integer;
|
||||
|
||||
|
||||
CREATE TABLE llx_takepos_floor_tables(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
entity integer DEFAULT 1 NOT NULL,
|
||||
label varchar(255),
|
||||
leftpos float,
|
||||
toppos float,
|
||||
floor smallint
|
||||
) ENGINE=innodb;
|
||||
|
||||
|
||||
@ -53,6 +53,11 @@ create table llx_societe
|
||||
skype varchar(255), --
|
||||
twitter varchar(255), --
|
||||
facebook varchar(255), --
|
||||
instagram varchar(255), --
|
||||
snapchat varchar(255), --
|
||||
googleplus varchar(255), --
|
||||
youtube varchar(255), --
|
||||
whatsapp varchar(255), --
|
||||
fk_effectif integer DEFAULT 0, --
|
||||
fk_typent integer DEFAULT 0, --
|
||||
fk_forme_juridique integer DEFAULT 0, -- juridical status
|
||||
|
||||
@ -45,6 +45,11 @@ create table llx_socpeople
|
||||
skype varchar(255),
|
||||
twitter varchar(255), --
|
||||
facebook varchar(255), --
|
||||
instagram varchar(255), --
|
||||
snapchat varchar(255), --
|
||||
google+ varchar(255), --
|
||||
youtube varchar(255), --
|
||||
whatsapp varchar(255), --
|
||||
photo varchar(255),
|
||||
no_email smallint NOT NULL DEFAULT 0,
|
||||
priv smallint NOT NULL DEFAULT 0,
|
||||
|
||||
26
htdocs/install/mysql/tables/llx_takepos_floor_tables.sql
Normal file
26
htdocs/install/mysql/tables/llx_takepos_floor_tables.sql
Normal file
@ -0,0 +1,26 @@
|
||||
-- Copyright (C) 2018 SuperAdmin
|
||||
--
|
||||
-- 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 http://www.gnu.org/licenses/.
|
||||
|
||||
|
||||
CREATE TABLE llx_takepos_floor_tables(
|
||||
-- BEGIN MODULEBUILDER FIELDS
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
entity integer DEFAULT 1 NOT NULL,
|
||||
label varchar(255),
|
||||
leftpos float,
|
||||
toppos float,
|
||||
floor smallint
|
||||
-- END MODULEBUILDER FIELDS
|
||||
) ENGINE=innodb;
|
||||
@ -620,6 +620,8 @@ Module50000Name=PayBox
|
||||
Module50000Desc=Offer customers a PayBox online payment page (credit/debit cards). This can be used to allow your customers to make free payments or for a payment on a particular Dolibarr object (invoice, order, ...)
|
||||
Module50100Name=Point of sales
|
||||
Module50100Desc=Point of sales module (POS).
|
||||
Module50150Name=Point of salesaa
|
||||
Module50150Desc=Point of sales module (Touch screen POS).
|
||||
Module50200Name=Paypal
|
||||
Module50200Desc=Offer customers a PayPal online payment page (PayPal account or credit/debit cards). This can be used to allow your customers to make free payments or for a payment on a particular Dolibarr object (invoice, order, ...)
|
||||
Module50400Name=Accounting (advanced)
|
||||
@ -1437,6 +1439,7 @@ DefaultCreateForm=Default values (on forms to create)
|
||||
DefaultSearchFilters=Default search filters
|
||||
DefaultSortOrder=Default sort orders
|
||||
DefaultFocus=Default focus fields
|
||||
DefaultMandatory=Mandatory form fields
|
||||
##### Products #####
|
||||
ProductSetup=Products module setup
|
||||
ServiceSetup=Services module setup
|
||||
@ -1608,9 +1611,9 @@ CashDeskBankAccountForCheque= Default account to use to receive payments by cheq
|
||||
CashDeskBankAccountForCB= Default account to use to receive payments by credit cards
|
||||
CashDeskDoNotDecreaseStock=Disable stock decrease when a sell is done from Point of Sale (if "no", stock decrease is done for each sell done from POS, whatever is option set into module Stock).
|
||||
CashDeskIdWareHouse=Force and restrict warehouse to use for stock decrease
|
||||
StockDecreaseForPointOfSaleDisabled=Stock decrease from Point Of Sale disabled
|
||||
StockDecreaseForPointOfSaleDisabled=Stock decrease from Point of Sale disabled
|
||||
StockDecreaseForPointOfSaleDisabledbyBatch=Stock decrease in POS is not compatible with lot management
|
||||
CashDeskYouDidNotDisableStockDecease=You did not disable stock decrease when making a sale from Point Of Sale. Hence a warehouse is required.
|
||||
CashDeskYouDidNotDisableStockDecease=You did not disable stock decrease when making a sale from Point of Sale. Hence a warehouse is required.
|
||||
##### Bookmark #####
|
||||
BookmarkSetup=Bookmark module setup
|
||||
BookmarkDesc=This module allows you to manage bookmarks. You can also add shortcuts to any Dolibarr pages or external web sites on your left menu.
|
||||
@ -1809,10 +1812,11 @@ SocialNetworkSetup=Setup of module Social Networks
|
||||
EnableFeatureFor=Enable features for <strong>%s</strong>
|
||||
VATIsUsedIsOff=Note: The option to use sales Tax or VAT has been set to <strong>Off</strong> in the menu %s - %s, so Sale tax or Vat used will always be 0 for sales.
|
||||
SwapSenderAndRecipientOnPDF=Swap sender and recipient address on PDF
|
||||
FeatureSupportedOnTextFieldsOnly=Warning, feature supported on text fields only
|
||||
##### Resource ####
|
||||
ResourceSetup=Configuration du module Resource
|
||||
UseSearchToSelectResource=Use a search form to choose a resource (rather than a drop-down list).
|
||||
DisabledResourceLinkUser=Disable feature to link a resource to users
|
||||
DisabledResourceLinkContact=Disable feature to link a resource to contacts
|
||||
ConfirmUnactivation=Confirm module reset
|
||||
OnMobileOnly=On small screen (smartphone) only
|
||||
OnMobileOnly=On small screen (smartphone) only
|
||||
|
||||
@ -39,6 +39,7 @@ EventRemindersByEmailNotEnabled=Event reminders by email was not enabled into %s
|
||||
##### Agenda event labels #####
|
||||
NewCompanyToDolibarr=Third party %s created
|
||||
ContractValidatedInDolibarr=Contract %s validated
|
||||
CONTRACT_DELETEInDolibarr=Contract %s deleted
|
||||
PropalClosedSignedInDolibarr=Proposal %s signed
|
||||
PropalClosedRefusedInDolibarr=Proposal %s refused
|
||||
PropalValidatedInDolibarr=Proposal %s validated
|
||||
|
||||
@ -32,3 +32,12 @@ DeleteArticle=Click to remove this article
|
||||
FilterRefOrLabelOrBC=Search (Ref/Label)
|
||||
UserNeedPermissionToEditStockToUsePos=You ask to decrease stock on invoice creation, so user that uses POS needs to have permission to edit stock.
|
||||
DolibarrReceiptPrinter=Dolibarr Receipt Printer
|
||||
PointOfSale=Point of sales
|
||||
CloseBill=Close Bill
|
||||
Floors=Floors
|
||||
Floor=Floor
|
||||
AddTable=Add table
|
||||
Place=Place
|
||||
TakeboxNecesary='TakeBOX' application required
|
||||
OrderPrinters=Order printers
|
||||
SearchProduct=Search product
|
||||
|
||||
@ -741,6 +741,7 @@ LinkTo=Link to
|
||||
LinkToProposal=Link to proposal
|
||||
LinkToOrder=Link to order
|
||||
LinkToInvoice=Link to invoice
|
||||
LinkToTemplateInvoice=Link to template invoice
|
||||
LinkToSupplierOrder=Link to supplier order
|
||||
LinkToSupplierProposal=Link to supplier proposal
|
||||
LinkToSupplierInvoice=Link to supplier invoice
|
||||
|
||||
@ -32,3 +32,10 @@ DeleteArticle=Haga clic para quitar este artículo
|
||||
FilterRefOrLabelOrBC=Búsqueda (Ref/Etiq.)
|
||||
UserNeedPermissionToEditStockToUsePos=Ha configurado el decremento de stock en la creación de facturas, por lo que el usuario que utilice el TPV deberá tener permiso para editar stock.
|
||||
DolibarrReceiptPrinter=Impresora de tickets Dolibarr
|
||||
CloseBill=Cerrar venta
|
||||
Floors=Salones
|
||||
Floor=Salón
|
||||
AddTable=Añadir mesa
|
||||
Place=Puesto
|
||||
TakeboxNecesary=Aplicación 'TakeBOX' requerida
|
||||
OrderPrinters=Impresoras de pedido
|
||||
|
||||
@ -651,6 +651,7 @@ Permission32=Créer/modifier les produits
|
||||
Permission34=Supprimer les produits
|
||||
Permission36=Voir/gérer les produits cachés
|
||||
Permission38=Exporter les produits
|
||||
Permission39=Outrepasser le prix de vente minimum d'un produit
|
||||
Permission41=Lire les projets et tâches (partagés ou dont vous êtes un contact). Permet la saisie de temps passé, par vous et votre hiérarchie (vos subordonnés), sur les tâches assignées.
|
||||
Permission42=Créer/modifier les projets (projets partagés et projets pour lesquels je suis contact). Permet aussi de créer des tâches et d'assigner des utilisateurs aux projets et tâches.
|
||||
Permission44=Supprimer les projets et tâches (partagés ou dont je suis contact)
|
||||
|
||||
@ -32,3 +32,12 @@ DeleteArticle=Cliquez pour enlever cet article
|
||||
FilterRefOrLabelOrBC=Recherche (Ref/Lib.)
|
||||
UserNeedPermissionToEditStockToUsePos=Vous avez demandé de réduire le stock sur création de facture, aussi l'utilisateur qui utilise le Point De Vente doit avoir la permission d'éditer le stock.
|
||||
DolibarrReceiptPrinter=Imprimante reçu
|
||||
PointOfSale=Point de Vente
|
||||
CloseBill=Fermer Bill
|
||||
Floors=Étages
|
||||
Floor=Étage
|
||||
AddTable=Ajouter une table
|
||||
Place=Endroit
|
||||
TakeboxNecesary='TakeBOX' Application requise
|
||||
OrderPrinters=Commande imprimantes
|
||||
SearchProduct=Recherche produit
|
||||
|
||||
@ -50,7 +50,12 @@ class Loan extends CommonObject
|
||||
|
||||
public $datestart;
|
||||
public $dateend;
|
||||
public $label;
|
||||
|
||||
/**
|
||||
* @var string Loan label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
public $capital;
|
||||
public $nbterm;
|
||||
public $rate;
|
||||
@ -454,7 +459,7 @@ class Loan extends CommonObject
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialise an instance with random values.
|
||||
* Used to build previews or test instances.
|
||||
@ -465,9 +470,9 @@ class Loan extends CommonObject
|
||||
function initAsSpecimen()
|
||||
{
|
||||
global $user, $langs, $conf;
|
||||
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
|
||||
// Initialise parameters
|
||||
$this->id = 0;
|
||||
$this->fk_bank = 1;
|
||||
|
||||
@ -116,7 +116,11 @@ class MyObject extends CommonObject
|
||||
*/
|
||||
public $entity;
|
||||
|
||||
public $label;
|
||||
/**
|
||||
* @var string label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
public $amount;
|
||||
public $status;
|
||||
public $date_creation;
|
||||
|
||||
@ -1,225 +0,0 @@
|
||||
# Makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line.
|
||||
SPHINXOPTS =
|
||||
SPHINXBUILD = sphinx-build
|
||||
PAPER =
|
||||
BUILDDIR = build
|
||||
|
||||
# Internal variables.
|
||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
||||
PAPEROPT_letter = -D latex_paper_size=letter
|
||||
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
|
||||
# the i18n builder cannot share the environment and doctrees with the others
|
||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
|
||||
|
||||
.PHONY: help
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
@echo " html to make standalone HTML files"
|
||||
@echo " dirhtml to make HTML files named index.html in directories"
|
||||
@echo " singlehtml to make a single large HTML file"
|
||||
@echo " pickle to make pickle files"
|
||||
@echo " json to make JSON files"
|
||||
@echo " htmlhelp to make HTML files and a HTML help project"
|
||||
@echo " qthelp to make HTML files and a qthelp project"
|
||||
@echo " applehelp to make an Apple Help Book"
|
||||
@echo " devhelp to make HTML files and a Devhelp project"
|
||||
@echo " epub to make an epub"
|
||||
@echo " epub3 to make an epub3"
|
||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
||||
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
||||
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
|
||||
@echo " text to make text files"
|
||||
@echo " man to make manual pages"
|
||||
@echo " texinfo to make Texinfo files"
|
||||
@echo " info to make Texinfo files and run them through makeinfo"
|
||||
@echo " gettext to make PO message catalogs"
|
||||
@echo " changes to make an overview of all changed/added/deprecated items"
|
||||
@echo " xml to make Docutils-native XML files"
|
||||
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
|
||||
@echo " linkcheck to check all external links for integrity"
|
||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
||||
@echo " coverage to run coverage check of the documentation (if enabled)"
|
||||
@echo " dummy to check syntax errors of document sources"
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf $(BUILDDIR)/*
|
||||
|
||||
.PHONY: html
|
||||
html:
|
||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
||||
|
||||
.PHONY: dirhtml
|
||||
dirhtml:
|
||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
||||
|
||||
.PHONY: singlehtml
|
||||
singlehtml:
|
||||
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
||||
|
||||
.PHONY: pickle
|
||||
pickle:
|
||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
||||
@echo
|
||||
@echo "Build finished; now you can process the pickle files."
|
||||
|
||||
.PHONY: json
|
||||
json:
|
||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
||||
@echo
|
||||
@echo "Build finished; now you can process the JSON files."
|
||||
|
||||
.PHONY: htmlhelp
|
||||
htmlhelp:
|
||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
||||
".hhp project file in $(BUILDDIR)/htmlhelp."
|
||||
|
||||
.PHONY: qthelp
|
||||
qthelp:
|
||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Mymodule.qhcp"
|
||||
@echo "To view the help file:"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Mymodule.qhc"
|
||||
|
||||
.PHONY: applehelp
|
||||
applehelp:
|
||||
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
|
||||
@echo
|
||||
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
|
||||
@echo "N.B. You won't be able to view it unless you put it in" \
|
||||
"~/Library/Documentation/Help or install it in your application" \
|
||||
"bundle."
|
||||
|
||||
.PHONY: devhelp
|
||||
devhelp:
|
||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
||||
@echo
|
||||
@echo "Build finished."
|
||||
@echo "To view the help file:"
|
||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/Mymodule"
|
||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Mymodule"
|
||||
@echo "# devhelp"
|
||||
|
||||
.PHONY: epub
|
||||
epub:
|
||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
||||
@echo
|
||||
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
||||
|
||||
.PHONY: epub3
|
||||
epub3:
|
||||
$(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
|
||||
@echo
|
||||
@echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
|
||||
|
||||
.PHONY: latex
|
||||
latex:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo
|
||||
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
||||
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
||||
"(use \`make latexpdf' here to do that automatically)."
|
||||
|
||||
.PHONY: latexpdf
|
||||
latexpdf:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through pdflatex..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
.PHONY: latexpdfja
|
||||
latexpdfja:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through platex and dvipdfmx..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
.PHONY: text
|
||||
text:
|
||||
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
||||
@echo
|
||||
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
||||
|
||||
.PHONY: man
|
||||
man:
|
||||
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
||||
@echo
|
||||
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
||||
|
||||
.PHONY: texinfo
|
||||
texinfo:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo
|
||||
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
|
||||
@echo "Run \`make' in that directory to run these through makeinfo" \
|
||||
"(use \`make info' here to do that automatically)."
|
||||
|
||||
.PHONY: info
|
||||
info:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo "Running Texinfo files through makeinfo..."
|
||||
make -C $(BUILDDIR)/texinfo info
|
||||
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
||||
|
||||
.PHONY: gettext
|
||||
gettext:
|
||||
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
||||
@echo
|
||||
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
||||
|
||||
.PHONY: changes
|
||||
changes:
|
||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
||||
@echo
|
||||
@echo "The overview file is in $(BUILDDIR)/changes."
|
||||
|
||||
.PHONY: linkcheck
|
||||
linkcheck:
|
||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
||||
@echo
|
||||
@echo "Link check complete; look for any errors in the above output " \
|
||||
"or in $(BUILDDIR)/linkcheck/output.txt."
|
||||
|
||||
.PHONY: doctest
|
||||
doctest:
|
||||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
||||
@echo "Testing of doctests in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/doctest/output.txt."
|
||||
|
||||
.PHONY: coverage
|
||||
coverage:
|
||||
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
|
||||
@echo "Testing of coverage in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/coverage/python.txt."
|
||||
|
||||
.PHONY: xml
|
||||
xml:
|
||||
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
|
||||
@echo
|
||||
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
|
||||
|
||||
.PHONY: pseudoxml
|
||||
pseudoxml:
|
||||
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
|
||||
@echo
|
||||
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
|
||||
|
||||
.PHONY: dummy
|
||||
dummy:
|
||||
$(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy
|
||||
@echo
|
||||
@echo "Build finished. Dummy builder generates no files."
|
||||
@ -1,281 +0,0 @@
|
||||
@ECHO OFF
|
||||
|
||||
REM Command file for Sphinx documentation
|
||||
|
||||
if "%SPHINXBUILD%" == "" (
|
||||
set SPHINXBUILD=sphinx-build
|
||||
)
|
||||
set BUILDDIR=build
|
||||
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source
|
||||
set I18NSPHINXOPTS=%SPHINXOPTS% source
|
||||
if NOT "%PAPER%" == "" (
|
||||
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
|
||||
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
|
||||
)
|
||||
|
||||
if "%1" == "" goto help
|
||||
|
||||
if "%1" == "help" (
|
||||
:help
|
||||
echo.Please use `make ^<target^>` where ^<target^> is one of
|
||||
echo. html to make standalone HTML files
|
||||
echo. dirhtml to make HTML files named index.html in directories
|
||||
echo. singlehtml to make a single large HTML file
|
||||
echo. pickle to make pickle files
|
||||
echo. json to make JSON files
|
||||
echo. htmlhelp to make HTML files and a HTML help project
|
||||
echo. qthelp to make HTML files and a qthelp project
|
||||
echo. devhelp to make HTML files and a Devhelp project
|
||||
echo. epub to make an epub
|
||||
echo. epub3 to make an epub3
|
||||
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
|
||||
echo. text to make text files
|
||||
echo. man to make manual pages
|
||||
echo. texinfo to make Texinfo files
|
||||
echo. gettext to make PO message catalogs
|
||||
echo. changes to make an overview over all changed/added/deprecated items
|
||||
echo. xml to make Docutils-native XML files
|
||||
echo. pseudoxml to make pseudoxml-XML files for display purposes
|
||||
echo. linkcheck to check all external links for integrity
|
||||
echo. doctest to run all doctests embedded in the documentation if enabled
|
||||
echo. coverage to run coverage check of the documentation if enabled
|
||||
echo. dummy to check syntax errors of document sources
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "clean" (
|
||||
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
|
||||
del /q /s %BUILDDIR%\*
|
||||
goto end
|
||||
)
|
||||
|
||||
|
||||
REM Check if sphinx-build is available and fallback to Python version if any
|
||||
%SPHINXBUILD% 1>NUL 2>NUL
|
||||
if errorlevel 9009 goto sphinx_python
|
||||
goto sphinx_ok
|
||||
|
||||
:sphinx_python
|
||||
|
||||
set SPHINXBUILD=python -m sphinx.__init__
|
||||
%SPHINXBUILD% 2> nul
|
||||
if errorlevel 9009 (
|
||||
echo.
|
||||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
||||
echo.installed, then set the SPHINXBUILD environment variable to point
|
||||
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
||||
echo.may add the Sphinx directory to PATH.
|
||||
echo.
|
||||
echo.If you don't have Sphinx installed, grab it from
|
||||
echo.http://sphinx-doc.org/
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
:sphinx_ok
|
||||
|
||||
|
||||
if "%1" == "html" (
|
||||
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "dirhtml" (
|
||||
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "singlehtml" (
|
||||
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "pickle" (
|
||||
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can process the pickle files.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "json" (
|
||||
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can process the JSON files.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "htmlhelp" (
|
||||
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can run HTML Help Workshop with the ^
|
||||
.hhp project file in %BUILDDIR%/htmlhelp.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "qthelp" (
|
||||
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can run "qcollectiongenerator" with the ^
|
||||
.qhcp project file in %BUILDDIR%/qthelp, like this:
|
||||
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Mymodule.qhcp
|
||||
echo.To view the help file:
|
||||
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Mymodule.ghc
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "devhelp" (
|
||||
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "epub" (
|
||||
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The epub file is in %BUILDDIR%/epub.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "epub3" (
|
||||
%SPHINXBUILD% -b epub3 %ALLSPHINXOPTS% %BUILDDIR%/epub3
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The epub3 file is in %BUILDDIR%/epub3.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "latex" (
|
||||
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "latexpdf" (
|
||||
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
||||
cd %BUILDDIR%/latex
|
||||
make all-pdf
|
||||
cd %~dp0
|
||||
echo.
|
||||
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "latexpdfja" (
|
||||
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
||||
cd %BUILDDIR%/latex
|
||||
make all-pdf-ja
|
||||
cd %~dp0
|
||||
echo.
|
||||
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "text" (
|
||||
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The text files are in %BUILDDIR%/text.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "man" (
|
||||
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The manual pages are in %BUILDDIR%/man.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "texinfo" (
|
||||
%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "gettext" (
|
||||
%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "changes" (
|
||||
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.The overview file is in %BUILDDIR%/changes.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "linkcheck" (
|
||||
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Link check complete; look for any errors in the above output ^
|
||||
or in %BUILDDIR%/linkcheck/output.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "doctest" (
|
||||
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Testing of doctests in the sources finished, look at the ^
|
||||
results in %BUILDDIR%/doctest/output.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "coverage" (
|
||||
%SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Testing of coverage in the sources finished, look at the ^
|
||||
results in %BUILDDIR%/coverage/python.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "xml" (
|
||||
%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The XML files are in %BUILDDIR%/xml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "pseudoxml" (
|
||||
%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "dummy" (
|
||||
%SPHINXBUILD% -b dummy %ALLSPHINXOPTS% %BUILDDIR%/dummy
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. Dummy builder generates no files.
|
||||
goto end
|
||||
)
|
||||
|
||||
:end
|
||||
@ -1,428 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# My Module documentation build configuration file, created by
|
||||
# sphinx-quickstart on Mon Sep 26 17:54:17 2016.
|
||||
#
|
||||
# This file is execfile()d with the current directory set to its
|
||||
# containing dir.
|
||||
#
|
||||
# Note that not all possible configuration values are present in this
|
||||
# autogenerated file.
|
||||
#
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#
|
||||
# import os
|
||||
# import sys
|
||||
# sys.path.insert(0, os.path.abspath('.'))
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
#
|
||||
# needs_sphinx = '1.0'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = [
|
||||
'sphinx.ext.todo',
|
||||
'sphinx.ext.imgmath',
|
||||
'sphinx.ext.githubpages',
|
||||
]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# The suffix(es) of source filenames.
|
||||
# You can specify multiple suffix as a list of string:
|
||||
#
|
||||
# source_suffix = ['.rst', '.md']
|
||||
source_suffix = '.rst'
|
||||
|
||||
# The encoding of source files.
|
||||
#
|
||||
# source_encoding = 'utf-8-sig'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = 'My Module'
|
||||
copyright = '2016, Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>'
|
||||
author = 'Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = 'development'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = 'development'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#
|
||||
# This is also used if you do content translation via gettext catalogs.
|
||||
# Usually you set "language" from the command line for these cases.
|
||||
language = None
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
#
|
||||
# today = ''
|
||||
#
|
||||
# Else, today_fmt is used as the format for a strftime call.
|
||||
#
|
||||
# today_fmt = '%B %d, %Y'
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
# This patterns also effect to html_static_path and html_extra_path
|
||||
exclude_patterns = []
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all
|
||||
# documents.
|
||||
#
|
||||
# default_role = None
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
#
|
||||
# add_function_parentheses = True
|
||||
|
||||
# If true, the current module name will be prepended to all description
|
||||
# unit titles (such as .. function::).
|
||||
#
|
||||
# add_module_names = True
|
||||
|
||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||
# output. They are ignored by default.
|
||||
#
|
||||
# show_authors = False
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
|
||||
# A list of ignored prefixes for module index sorting.
|
||||
# modindex_common_prefix = []
|
||||
|
||||
# If true, keep warnings as "system message" paragraphs in the built documents.
|
||||
# keep_warnings = False
|
||||
|
||||
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
||||
todo_include_todos = True
|
||||
|
||||
|
||||
# -- Options for HTML output ----------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#
|
||||
html_theme = 'alabaster'
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
#
|
||||
# html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
# html_theme_path = []
|
||||
|
||||
# The name for this set of Sphinx documents.
|
||||
# "<project> v<release> documentation" by default.
|
||||
#
|
||||
# html_title = 'My Module vdevelopment'
|
||||
|
||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||
#
|
||||
# html_short_title = None
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
#
|
||||
# html_logo = None
|
||||
|
||||
# The name of an image file (relative to this directory) to use as a favicon of
|
||||
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
#
|
||||
# html_favicon = None
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
|
||||
# Add any extra paths that contain custom files (such as robots.txt or
|
||||
# .htaccess) here, relative to this directory. These files are copied
|
||||
# directly to the root of the documentation.
|
||||
#
|
||||
# html_extra_path = []
|
||||
|
||||
# If not None, a 'Last updated on:' timestamp is inserted at every page
|
||||
# bottom, using the given strftime format.
|
||||
# The empty string is equivalent to '%b %d, %Y'.
|
||||
#
|
||||
# html_last_updated_fmt = None
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
#
|
||||
# html_use_smartypants = True
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
#
|
||||
# html_sidebars = {}
|
||||
|
||||
# Additional templates that should be rendered to pages, maps page names to
|
||||
# template names.
|
||||
#
|
||||
# html_additional_pages = {}
|
||||
|
||||
# If false, no module index is generated.
|
||||
#
|
||||
# html_domain_indices = True
|
||||
|
||||
# If false, no index is generated.
|
||||
#
|
||||
# html_use_index = True
|
||||
|
||||
# If true, the index is split into individual pages for each letter.
|
||||
#
|
||||
# html_split_index = False
|
||||
|
||||
# If true, links to the reST sources are added to the pages.
|
||||
#
|
||||
# html_show_sourcelink = True
|
||||
|
||||
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
||||
#
|
||||
# html_show_sphinx = True
|
||||
|
||||
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
||||
#
|
||||
# html_show_copyright = True
|
||||
|
||||
# If true, an OpenSearch description file will be output, and all pages will
|
||||
# contain a <link> tag referring to it. The value of this option must be the
|
||||
# base URL from which the finished HTML is served.
|
||||
#
|
||||
# html_use_opensearch = ''
|
||||
|
||||
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
||||
# html_file_suffix = None
|
||||
|
||||
# Language to be used for generating the HTML full-text search index.
|
||||
# Sphinx supports the following languages:
|
||||
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
|
||||
# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr', 'zh'
|
||||
#
|
||||
# html_search_language = 'en'
|
||||
|
||||
# A dictionary with options for the search language support, empty by default.
|
||||
# 'ja' uses this config value.
|
||||
# 'zh' user can custom change `jieba` dictionary path.
|
||||
#
|
||||
# html_search_options = {'type': 'default'}
|
||||
|
||||
# The name of a javascript file (relative to the configuration directory) that
|
||||
# implements a search results scorer. If empty, the default will be used.
|
||||
#
|
||||
# html_search_scorer = 'scorer.js'
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'Mymoduledoc'
|
||||
|
||||
# -- Options for LaTeX output ---------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#
|
||||
# 'papersize': 'letterpaper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#
|
||||
# 'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#
|
||||
# 'preamble': '',
|
||||
|
||||
# Latex figure (float) alignment
|
||||
#
|
||||
# 'figure_align': 'htbp',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title,
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
latex_documents = [
|
||||
(master_doc, 'Mymodule.tex', 'My Module Documentation',
|
||||
'Raphaël Doursenaud \\textless{}rdoursenaud@gpcsolutions.fr\\textgreater{}', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
#
|
||||
# latex_logo = None
|
||||
|
||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||
# not chapters.
|
||||
#
|
||||
# latex_use_parts = False
|
||||
|
||||
# If true, show page references after internal links.
|
||||
#
|
||||
# latex_show_pagerefs = False
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#
|
||||
# latex_show_urls = False
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#
|
||||
# latex_appendices = []
|
||||
|
||||
# It false, will not define \strong, \code, itleref, \crossref ... but only
|
||||
# \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added
|
||||
# packages.
|
||||
#
|
||||
# latex_keep_old_macro_names = True
|
||||
|
||||
# If false, no module index is generated.
|
||||
#
|
||||
# latex_domain_indices = True
|
||||
|
||||
|
||||
# -- Options for manual page output ---------------------------------------
|
||||
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
(master_doc, 'mymodule', 'My Module Documentation',
|
||||
[author], 1)
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#
|
||||
# man_show_urls = False
|
||||
|
||||
|
||||
# -- Options for Texinfo output -------------------------------------------
|
||||
|
||||
# Grouping the document tree into Texinfo files. List of tuples
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
(master_doc, 'Mymodule', 'My Module Documentation',
|
||||
author, 'Mymodule', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#
|
||||
# texinfo_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#
|
||||
# texinfo_domain_indices = True
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
#
|
||||
# texinfo_show_urls = 'footnote'
|
||||
|
||||
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
||||
#
|
||||
# texinfo_no_detailmenu = False
|
||||
|
||||
|
||||
# -- Options for Epub output ----------------------------------------------
|
||||
|
||||
# Bibliographic Dublin Core info.
|
||||
epub_title = project
|
||||
epub_author = author
|
||||
epub_publisher = author
|
||||
epub_copyright = copyright
|
||||
|
||||
# The basename for the epub file. It defaults to the project name.
|
||||
# epub_basename = project
|
||||
|
||||
# The HTML theme for the epub output. Since the default themes are not
|
||||
# optimized for small screen space, using the same theme for HTML and epub
|
||||
# output is usually not wise. This defaults to 'epub', a theme designed to save
|
||||
# visual space.
|
||||
#
|
||||
# epub_theme = 'epub'
|
||||
|
||||
# The language of the text. It defaults to the language option
|
||||
# or 'en' if the language is not set.
|
||||
#
|
||||
# epub_language = ''
|
||||
|
||||
# The scheme of the identifier. Typical schemes are ISBN or URL.
|
||||
# epub_scheme = ''
|
||||
|
||||
# The unique identifier of the text. This can be a ISBN number
|
||||
# or the project homepage.
|
||||
#
|
||||
# epub_identifier = ''
|
||||
|
||||
# A unique identification for the text.
|
||||
#
|
||||
# epub_uid = ''
|
||||
|
||||
# A tuple containing the cover image and cover page html template filenames.
|
||||
#
|
||||
# epub_cover = ()
|
||||
|
||||
# A sequence of (type, uri, title) tuples for the guide element of content.opf.
|
||||
#
|
||||
# epub_guide = ()
|
||||
|
||||
# HTML files that should be inserted before the pages created by sphinx.
|
||||
# The format is a list of tuples containing the path and title.
|
||||
#
|
||||
# epub_pre_files = []
|
||||
|
||||
# HTML files that should be inserted after the pages created by sphinx.
|
||||
# The format is a list of tuples containing the path and title.
|
||||
#
|
||||
# epub_post_files = []
|
||||
|
||||
# A list of files that should not be packed into the epub file.
|
||||
epub_exclude_files = ['search.html']
|
||||
|
||||
# The depth of the table of contents in toc.ncx.
|
||||
#
|
||||
# epub_tocdepth = 3
|
||||
|
||||
# Allow duplicate toc entries.
|
||||
#
|
||||
# epub_tocdup = True
|
||||
|
||||
# Choose between 'default' and 'includehidden'.
|
||||
#
|
||||
# epub_tocscope = 'default'
|
||||
|
||||
# Fix unsupported image types using the Pillow.
|
||||
#
|
||||
# epub_fix_images = False
|
||||
|
||||
# Scale large images.
|
||||
#
|
||||
# epub_max_image_width = 0
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
#
|
||||
# epub_show_urls = 'inline'
|
||||
|
||||
# If false, no index is generated.
|
||||
#
|
||||
# epub_use_index = True
|
||||
@ -1,22 +0,0 @@
|
||||
.. My Module documentation master file, created by
|
||||
sphinx-quickstart on Mon Sep 26 17:54:17 2016.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
Welcome to My Module's documentation!
|
||||
=====================================
|
||||
|
||||
Contents:
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
|
||||
@ -336,7 +336,7 @@ $arrayofmassactions = array(
|
||||
//'builddoc'=>$langs->trans("PDFMerge"),
|
||||
);
|
||||
if ($user->rights->mymodule->delete) $arrayofmassactions['predelete']=$langs->trans("Delete");
|
||||
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
||||
if (GETPOST('nomassaction','int') || in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
||||
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
|
||||
@ -75,9 +75,9 @@ if (empty($search_year)) $search_year=$currentyear;
|
||||
|
||||
$form = new Form($db);
|
||||
$htmlother = new FormOther($db);
|
||||
|
||||
$object = new Product($db);
|
||||
if (! $id)
|
||||
|
||||
if (! $id && empty($ref))
|
||||
{
|
||||
llxHeader("",$langs->trans("ProductStatistics"));
|
||||
|
||||
|
||||
@ -50,7 +50,12 @@ class MouvementStock extends CommonObject
|
||||
public $datem = '';
|
||||
public $price;
|
||||
public $fk_user_author;
|
||||
public $label;
|
||||
|
||||
/**
|
||||
* @var string stock movements label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
public $fk_origin;
|
||||
public $origintype;
|
||||
public $inventorycode;
|
||||
|
||||
@ -190,6 +190,7 @@ if ($action == 'order' && isset($_POST['valid']))
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande_fournisseur";
|
||||
$sql.= " WHERE fk_soc = ".$suppliersid[$i];
|
||||
$sql.= " AND source = 42 AND fk_statut = 0";
|
||||
$sql.= " AND entity IN (".getEntity('commande_fournisseur').")";
|
||||
$sql.= " ORDER BY date_creation DESC";
|
||||
$resql = $db->query($sql);
|
||||
if($resql && $db->num_rows($resql) > 0) {
|
||||
|
||||
@ -277,8 +277,9 @@ if ($action == 'add')
|
||||
// Set output language
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
// Get email content fro mtemplae
|
||||
// Get email content from template
|
||||
$arraydefaultmessage=null;
|
||||
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER;
|
||||
|
||||
|
||||
@ -500,8 +500,9 @@ if ($ispaymentok)
|
||||
// Set output language
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
|
||||
// Load traductions files requiredby by page
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
// Get email content from templae
|
||||
// Get email content from template
|
||||
$arraydefaultmessage=null;
|
||||
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION;
|
||||
|
||||
|
||||
@ -39,7 +39,12 @@ class Address
|
||||
public $id;
|
||||
|
||||
public $type;
|
||||
public $label;
|
||||
|
||||
/**
|
||||
* @var string Address label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
public $socid;
|
||||
public $name;
|
||||
public $address;
|
||||
@ -510,7 +515,12 @@ class AddressLine
|
||||
|
||||
public $date_creation;
|
||||
public $date_modification;
|
||||
public $label;
|
||||
|
||||
/**
|
||||
* @var string stock movements label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
public $name;
|
||||
public $address;
|
||||
public $zip;
|
||||
|
||||
@ -1175,9 +1175,9 @@ class Thirdparties extends DolibarrApi
|
||||
/**
|
||||
* Generate a Document from a bank account record (like SEPA mandate)
|
||||
*
|
||||
* @param int $id thirdparty id
|
||||
* @param int $companybankid companybankid
|
||||
* @param string $model model of document to generate
|
||||
* @param int $id Thirdparty id
|
||||
* @param int $companybankid Companybank id
|
||||
* @param string $model Model of document to generate
|
||||
* @return void
|
||||
*
|
||||
* @url GET {id}/generateBankAccountDocument/{companybankid}/{model}
|
||||
@ -1186,19 +1186,7 @@ class Thirdparties extends DolibarrApi
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$this->langs->load("database");
|
||||
$this->langs->load("main");
|
||||
$this->langs->load("dict");
|
||||
$this->langs->load("agenda");
|
||||
$this->langs->load("margins");
|
||||
$this->langs->load("resource");
|
||||
$this->langs->load("commercial");
|
||||
$this->langs->load("ecm");
|
||||
$this->langs->load("products");
|
||||
$this->langs->load("companies");
|
||||
$this->langs->load("banks");
|
||||
$this->langs->load("bills");
|
||||
$this->langs->load("withdrawals");
|
||||
$this->langs->loadLangs(array("main","dict","commercial","products","companies","banks","bills","withdrawals"));
|
||||
|
||||
$this->company->fetch($id);
|
||||
|
||||
|
||||
@ -129,7 +129,11 @@ class CompanyPaymentMode extends CommonObject
|
||||
*/
|
||||
public $fk_soc;
|
||||
|
||||
public $label;
|
||||
/**
|
||||
* @var string company payment mode label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
public $bank;
|
||||
public $code_banque;
|
||||
public $code_guichet;
|
||||
|
||||
@ -338,6 +338,12 @@ class Societe extends CommonObject
|
||||
*/
|
||||
public $code_compta;
|
||||
|
||||
/**
|
||||
* Accounting code for client
|
||||
* @var string
|
||||
*/
|
||||
public $code_compta_client;
|
||||
|
||||
/**
|
||||
* Accounting code for suppliers
|
||||
* @var string
|
||||
|
||||
@ -534,7 +534,7 @@ $arrayofmassactions = array(
|
||||
);
|
||||
//if($user->rights->societe->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer");
|
||||
if ($user->rights->societe->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete");
|
||||
if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
||||
if (GETPOST('nomassaction','int') || in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
||||
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||
|
||||
$newcardbutton='';
|
||||
|
||||
@ -793,7 +793,7 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
// Mise a jour d'une ligne dans la demande de prix
|
||||
else if ($action == 'updateligne' && $user->rights->supplier_proposal->creer && GETPOST('save') == $langs->trans("Save")) {
|
||||
else if ($action == 'updateline' && $user->rights->supplier_proposal->creer && GETPOST('save') == $langs->trans("Save")) {
|
||||
|
||||
// Define info_bits
|
||||
$info_bits = 0;
|
||||
@ -919,7 +919,7 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
else if ($action == 'updateligne' && $user->rights->supplier_proposal->creer && GETPOST('cancel','alpha') == $langs->trans('Cancel')) {
|
||||
else if ($action == 'updateline' && $user->rights->supplier_proposal->creer && GETPOST('cancel','alpha') == $langs->trans('Cancel')) {
|
||||
header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition
|
||||
exit();
|
||||
}
|
||||
@ -1691,7 +1691,7 @@ if ($action == 'create')
|
||||
|
||||
print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#add' : '#line_' . GETPOST('lineid')) . '" method="POST">
|
||||
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">
|
||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateligne') . '">
|
||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
|
||||
<input type="hidden" name="mode" value="">
|
||||
<input type="hidden" name="id" value="' . $object->id . '">
|
||||
';
|
||||
|
||||
5
htdocs/takepos/ChangeLog.md
Normal file
5
htdocs/takepos/ChangeLog.md
Normal file
@ -0,0 +1,5 @@
|
||||
# CHANGELOG TAKEPOS FOR <a href="https://www.dolibarr.org">DOLIBARR ERP CRM</a>
|
||||
|
||||
## 1.0
|
||||
Initial version
|
||||
|
||||
100
htdocs/takepos/README.md
Normal file
100
htdocs/takepos/README.md
Normal file
@ -0,0 +1,100 @@
|
||||
# TAKEPOS FOR <a href="https://www.takepos.com">DOLIBARR ERP CRM</a>
|
||||
|
||||
## Features
|
||||
Touch Screen POS
|
||||
|
||||
<!--
|
||||
{imgmd}
|
||||
-->
|
||||
|
||||
Other modules are available on <a href="https://www.dolistore.com" target="_new">Dolistore.com</a>.
|
||||
|
||||
|
||||
|
||||
### Translations
|
||||
|
||||
Translations can be define manually by editing files into directories [langs](langs).
|
||||
|
||||
<!--
|
||||
This module contains also a sample configuration for Transifex, under the hidden directory [.tx](.tx), so it is possible to manage translation using this service.
|
||||
|
||||
For more informations, see the [translator's documentation](https://wiki.dolibarr.org/index.php/Translator_documentation).
|
||||
|
||||
There is a [Transifex project](https://transifex.com/projects/p/dolibarr-module-template) for this module.
|
||||
-->
|
||||
|
||||
|
||||
<!--
|
||||
|
||||
Install
|
||||
-------
|
||||
|
||||
### From the ZIP file and GUI interface
|
||||
|
||||
- If you get the module in a zip file (like when downloading it from the market place [Dolistore](https://www.dolistore.com)), go into
|
||||
menu ```Home - Setup - Modules - Deploy external module``` and upload the zip file.
|
||||
|
||||
|
||||
Note: If this screen tell you there is no custom directory, check your setup is correct:
|
||||
|
||||
- In your Dolibarr installation directory, edit the ```htdocs/conf/conf.php``` file and check that following lines are not commented:
|
||||
|
||||
```php
|
||||
//$dolibarr_main_url_root_alt ...
|
||||
//$dolibarr_main_document_root_alt ...
|
||||
```
|
||||
|
||||
- Uncomment them if necessary (delete the leading ```//```) and assign a sensible value according to your Dolibarr installation
|
||||
|
||||
For example :
|
||||
|
||||
- UNIX:
|
||||
```php
|
||||
$dolibarr_main_url_root_alt = '/custom';
|
||||
$dolibarr_main_document_root_alt = '/var/www/Dolibarr/htdocs/custom';
|
||||
```
|
||||
|
||||
- Windows:
|
||||
```php
|
||||
$dolibarr_main_url_root_alt = '/custom';
|
||||
$dolibarr_main_document_root_alt = 'C:/My Web Sites/Dolibarr/htdocs/custom';
|
||||
```
|
||||
|
||||
### From a GIT repository
|
||||
|
||||
- Clone the repository in ```$dolibarr_main_document_root_alt/takepos```
|
||||
|
||||
```sh
|
||||
cd ....../custom
|
||||
git clone git@github.com:gitlogin/takepos.git takepos
|
||||
```
|
||||
|
||||
### <a name="final_steps"></a>Final steps
|
||||
|
||||
From your browser:
|
||||
|
||||
- Log into Dolibarr as a super-administrator
|
||||
- Go to "Setup" -> "Modules"
|
||||
- You should now be able to find and enable the module
|
||||
|
||||
|
||||
|
||||
-->
|
||||
|
||||
|
||||
Licenses
|
||||
--------
|
||||
|
||||
### Main code
|
||||
|
||||

|
||||
|
||||
GPLv3 or (at your option) any later version.
|
||||
|
||||
See [COPYING](COPYING) for more information.
|
||||
|
||||
#### Documentation
|
||||
|
||||
All texts and readmes.
|
||||
|
||||

|
||||
75
htdocs/takepos/admin/about.php
Normal file
75
htdocs/takepos/admin/about.php
Normal file
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018 SuperAdmin
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file takepos/admin/about.php
|
||||
* \ingroup takepos
|
||||
* \brief About page of module TakePos.
|
||||
*/
|
||||
|
||||
require '../../main.inc.php'; // Load $user and permissions
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once '../lib/takepos.lib.php';
|
||||
|
||||
// Translations
|
||||
$langs->loadLangs(array("errors","admin","cashdesk"));
|
||||
|
||||
// Access control
|
||||
if (! $user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
// Parameters
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// None
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$page_name = "TakePosAbout";
|
||||
llxHeader('', $langs->trans($page_name));
|
||||
|
||||
// Subheader
|
||||
$linkback = '<a href="'.($backtopage?$backtopage:DOL_URL_ROOT.'/admin/modules.php').'">'.$langs->trans("BackToModuleList").'</a>';
|
||||
|
||||
print load_fiche_titre($langs->trans($page_name), $linkback, 'object_takepos@takepos');
|
||||
|
||||
// Configuration header
|
||||
$head = takeposAdminPrepareHead();
|
||||
dol_fiche_head($head, 'about', '', 0, 'takepos@takepos');
|
||||
|
||||
dol_include_once('/takepos/core/modules/modTakePos.class.php');
|
||||
$tmpmodule = new modTakePos($db);
|
||||
print $tmpmodule->getDescLong();
|
||||
|
||||
// Page end
|
||||
dol_fiche_end();
|
||||
llxFooter();
|
||||
$db->close();
|
||||
202
htdocs/takepos/admin/orderprinters.php
Normal file
202
htdocs/takepos/admin/orderprinters.php
Normal file
@ -0,0 +1,202 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
|
||||
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2006-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/takepos/admin/orderprinters.php
|
||||
* \ingroup takepos
|
||||
* \brief Home page of category area
|
||||
*/
|
||||
|
||||
require '../../main.inc.php'; // Load $user and permissions
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
|
||||
$langs->load("main");
|
||||
$langs->load("categories");
|
||||
$langs->load("takepos");
|
||||
$langs->load("printing");
|
||||
|
||||
if (! $user->rights->categorie->lire) accessforbidden();
|
||||
|
||||
$id=GETPOST('id','int');
|
||||
$type=(GETPOST('type','aZ09') ? GETPOST('type','aZ09') : Categorie::TYPE_PRODUCT);
|
||||
$catname=GETPOST('catname','alpha');
|
||||
$action=GETPOST('action','alpha');
|
||||
$printer1=GETPOST('printer1','alpha');
|
||||
$printer2=GETPOST('printer2','alpha');
|
||||
|
||||
if (is_numeric($type)) $type=Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
print $action;
|
||||
if ($action=="SavePrinter1"){
|
||||
$printedcategories=";";
|
||||
if (is_array($printer1)) foreach ($printer1 as $cat){
|
||||
$printedcategories=$printedcategories.$cat.";";
|
||||
}
|
||||
dolibarr_set_const($db,"TAKEPOS_PRINTED_CATEGORIES_1", $printedcategories,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
|
||||
if ($action=="SavePrinter2"){
|
||||
$printedcategories=";";
|
||||
if (is_array($printer2)) foreach ($printer2 as $cat){
|
||||
$printedcategories=$printedcategories.$cat.";";
|
||||
}
|
||||
dolibarr_set_const($db,"TAKEPOS_PRINTED_CATEGORIES_2", $printedcategories,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$categstatic = new Categorie($db);
|
||||
$form = new Form($db);
|
||||
|
||||
if ($type == Categorie::TYPE_PRODUCT) { $title=$langs->trans("ProductsCategoriesArea"); $typetext='product'; }
|
||||
elseif ($type == Categorie::TYPE_SUPPLIER) { $title=$langs->trans("SuppliersCategoriesArea"); $typetext='supplier'; }
|
||||
elseif ($type == Categorie::TYPE_CUSTOMER) { $title=$langs->trans("CustomersCategoriesArea"); $typetext='customer'; }
|
||||
elseif ($type == Categorie::TYPE_MEMBER) { $title=$langs->trans("MembersCategoriesArea"); $typetext='member'; }
|
||||
elseif ($type == Categorie::TYPE_CONTACT) { $title=$langs->trans("ContactsCategoriesArea"); $typetext='contact'; }
|
||||
elseif ($type == Categorie::TYPE_ACCOUNT) { $title=$langs->trans("AccountsCategoriesArea"); $typetext='bank_account'; }
|
||||
elseif ($type == Categorie::TYPE_PROJECT) { $title=$langs->trans("ProjectsCategoriesArea"); $typetext='project'; }
|
||||
elseif ($type == Categorie::TYPE_USER) { $title=$langs->trans("UsersCategoriesArea"); $typetext='user'; }
|
||||
else { $title=$langs->trans("CategoriesArea"); $typetext='unknown'; }
|
||||
|
||||
$arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
|
||||
$arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
|
||||
|
||||
llxHeader('',$title,'','',0,0,$arrayofjs,$arrayofcss);
|
||||
|
||||
|
||||
print load_fiche_titre($langs->trans("OrderPrinters"));
|
||||
|
||||
//print '<table border="0" width="100%" class="notopnoleftnoright">';
|
||||
//print '<tr><td valign="top" width="30%" class="notopnoleft">';
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
|
||||
//print '</td><td valign="top" width="70%">';
|
||||
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
//print '</td></tr></table>';
|
||||
print '</div></div></div>';
|
||||
|
||||
print '<div class="fichecenter"><br>';
|
||||
|
||||
|
||||
// Charge tableau des categories
|
||||
$cate_arbo = $categstatic->get_full_arbo($typetext);
|
||||
|
||||
// Define fulltree array
|
||||
$fulltree=$cate_arbo;
|
||||
|
||||
// Define data (format for treeview)
|
||||
$data=array();
|
||||
$data[] = array('rowid'=>0,'fk_menu'=>-1,'title'=>"racine",'mainmenu'=>'','leftmenu'=>'','fk_mainmenu'=>'','fk_leftmenu'=>'');
|
||||
foreach($fulltree as $key => $val)
|
||||
{
|
||||
$categstatic->id=$val['id'];
|
||||
$categstatic->ref=$val['label'];
|
||||
$categstatic->color=$val['color'];
|
||||
$categstatic->type=$type;
|
||||
$li=$categstatic->getNomUrl(1,'',60);
|
||||
$desc=dol_htmlcleanlastbr($val['description']);
|
||||
|
||||
$data[] = array(
|
||||
'rowid'=>$val['rowid'],
|
||||
'fk_menu'=>$val['fk_menu'],
|
||||
'fk_menu'=>$val['fk_parent'],
|
||||
'label'=>$val['label']
|
||||
);
|
||||
}
|
||||
|
||||
//Printer1
|
||||
print '<table class="liste nohover" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Printer").' 1</td><td></td><td align="right">';
|
||||
print '</td></tr>';
|
||||
$nbofentries=(count($data) - 1);
|
||||
print '<form action="orderprinters.php">';
|
||||
if ($nbofentries > 0)
|
||||
{
|
||||
print '<tr class="pair"><td colspan="3">';
|
||||
print '<input type="hidden" name="action" value="SavePrinter1">';
|
||||
foreach ($data as $row) {
|
||||
if (strpos($conf->global->TAKEPOS_PRINTED_CATEGORIES_1, ';'.$row["rowid"].';') !== false) $checked='checked'; else $checked='';
|
||||
if ($row["fk_menu"]==0) print '<input type="checkbox" name="printer1[]" value="'.$row["rowid"].'" '.$checked.'>'.$row["label"].'<br>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr class="pair">';
|
||||
print '<td colspan="3"><table class="nobordernopadding"><tr class="nobordernopadding"><td>'.img_picto_common('','treemenu/branchbottom.gif').'</td>';
|
||||
print '<td valign="middle">';
|
||||
print $langs->trans("NoCategoryYet");
|
||||
print '</td>';
|
||||
print '<td> </td>';
|
||||
print '</table></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print "</table>";
|
||||
print '<input type="submit" value="'.$langs->trans("Save").'"></form><br><br>';
|
||||
|
||||
//Printer2
|
||||
print '<table class="liste nohover" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Printer").' 2</td><td></td><td align="right">';
|
||||
print '</td></tr>';
|
||||
$nbofentries=(count($data) - 1);
|
||||
print '<form action="orderprinters.php">';
|
||||
if ($nbofentries > 0)
|
||||
{
|
||||
print '<tr class="pair"><td colspan="3">';
|
||||
print '<input type="hidden" name="action" value="SavePrinter2">';
|
||||
foreach ($data as $row) {
|
||||
if (strpos($conf->global->TAKEPOS_PRINTED_CATEGORIES_2, ';'.$row["rowid"].';') !== false) $checked='checked'; else $checked='';
|
||||
if ($row["fk_menu"]==0) print '<input type="checkbox" name="printer2[]" value="'.$row["rowid"].'" '.$checked.'>'.$row["label"].'<br>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr class="pair">';
|
||||
print '<td colspan="3"><table class="nobordernopadding"><tr class="nobordernopadding"><td>'.img_picto_common('','treemenu/branchbottom.gif').'</td>';
|
||||
print '<td valign="middle">';
|
||||
print $langs->trans("NoCategoryYet");
|
||||
print '</td>';
|
||||
print '<td> </td>';
|
||||
print '</table></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print "</table>";
|
||||
print '<input type="submit" value="'.$langs->trans("Save").'"></form>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
254
htdocs/takepos/admin/setup.php
Normal file
254
htdocs/takepos/admin/setup.php
Normal file
@ -0,0 +1,254 @@
|
||||
<?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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/takepos/admin/setup.php
|
||||
* \ingroup takepos
|
||||
* \brief Setup page for TakePos module
|
||||
*/
|
||||
|
||||
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';
|
||||
|
||||
// If socid provided by ajax company selector
|
||||
if (! empty($_REQUEST['CASHDESK_ID_THIRDPARTY_id']))
|
||||
{
|
||||
$_GET['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id','alpha');
|
||||
$_POST['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id','alpha');
|
||||
$_REQUEST['CASHDESK_ID_THIRDPARTY'] = GETPOST('CASHDESK_ID_THIRDPARTY_id','alpha');
|
||||
}
|
||||
|
||||
// Security check
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("cashdesk");
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
if (GETPOST('action','alpha') == 'set')
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
if (GETPOST('socid','int') < 0) $_POST["socid"]='';
|
||||
|
||||
$res = dolibarr_set_const($db,"CASHDESK_ID_THIRDPARTY",(GETPOST('socid','int') > 0 ? GETPOST('socid','int') : ''),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT_CASH",(GETPOST('CASHDESK_ID_BANKACCOUNT_CASH','alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CASH','alpha') : ''),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT_CHEQUE",(GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE','alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE','alpha') : ''),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT_CB",(GETPOST('CASHDESK_ID_BANKACCOUNT_CB','alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CB','alpha') : ''),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_ID_WAREHOUSE",(GETPOST('CASHDESK_ID_WAREHOUSE','alpha') > 0 ? GETPOST('CASHDESK_ID_WAREHOUSE','alpha') : ''),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_NO_DECREASE_STOCK",GETPOST('CASHDESK_NO_DECREASE_STOCK','alpha'),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"CASHDESK_SERVICES", GETPOST('CASHDESK_SERVICES','alpha'),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"TAKEBOX", GETPOST('TAKEBOX','alpha'),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"TAKEPOS_BAR_RESTAURANT", GETPOST('TAKEPOS_BAR_RESTAURANT','alpha'),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"TAKEPOS_PRINT_SERVER", GETPOST('TAKEPOS_PRINT_SERVER','alpha'),'chaine',0,'',$conf->entity);
|
||||
$res = dolibarr_set_const($db,"TAKEPOS_ORDER_PRINTERS", GETPOST('TAKEPOS_ORDER_PRINTERS','alpha'),'chaine',0,'',$conf->entity);
|
||||
|
||||
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"),$linkback,'title_setup');
|
||||
print '<br>';
|
||||
|
||||
|
||||
// Mode
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="set">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven"><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
|
||||
print '<td colspan="2">';
|
||||
print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3) AND s.status = 1',1,0,1,array(),0);
|
||||
print '</td></tr>';
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForSell").'</td>';
|
||||
print '<td colspan="2">';
|
||||
$form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CASH,'CASHDESK_ID_BANKACCOUNT_CASH',0,"courant=2",1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForCheque").'</td>';
|
||||
print '<td colspan="2">';
|
||||
$form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE,'CASHDESK_ID_BANKACCOUNT_CHEQUE',0,"courant=1",1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForCB").'</td>';
|
||||
print '<td colspan="2">';
|
||||
$form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CB,'CASHDESK_ID_BANKACCOUNT_CB',0,"courant=1",1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
if (! empty($conf->stock->enabled))
|
||||
{
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskDoNotDecreaseStock").'</td>'; // Force warehouse (this is not a default value)
|
||||
print '<td colspan="2">';
|
||||
if (empty($conf->productbatch->enabled)) {
|
||||
print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK',$conf->global->CASHDESK_NO_DECREASE_STOCK,1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!$conf->global->CASHDESK_NO_DECREASE_STOCK) {
|
||||
$res = dolibarr_set_const($db,"CASHDESK_NO_DECREASE_STOCK",1,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
print $langs->trans('StockDecreaseForPointOfSaleDisabledbyBatch');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
$disabled=$conf->global->CASHDESK_NO_DECREASE_STOCK;
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskIdWareHouse").'</td>'; // Force warehouse (this is not a default value)
|
||||
print '<td colspan="2">';
|
||||
if (! $disabled)
|
||||
{
|
||||
print $formproduct->selectWarehouses($conf->global->CASHDESK_ID_WAREHOUSE,'CASHDESK_ID_WAREHOUSE','',1,$disabled);
|
||||
print ' <a href="'.DOL_URL_ROOT.'/product/stock/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">('.$langs->trans("Create").')</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("StockDecreaseForPointOfSaleDisabled");
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
if (! empty($conf->service->enabled))
|
||||
{
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("CashdeskShowServices");
|
||||
print '<td colspan="2">';
|
||||
print $form->selectyesno("CASHDESK_SERVICES",$conf->global->CASHDESK_SERVICES,1);
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
// Use Takepos printing
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("DolibarrReceiptPrinter").' TakeBOX (<a href="http://en.takepos.com/takebox">'.$langs->trans("TakeboxNecesary").'</a>)';
|
||||
print '<td colspan="2">';
|
||||
print $form->selectyesno("TAKEBOX",$conf->global->TAKEBOX,1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
if ($conf->global->TAKEBOX){
|
||||
print '<tr class="oddeven value"><td>';
|
||||
print $langs->trans("IPAddress").' (<a href="http://en.takepos.com/takebox">'.$langs->trans("TakeboxNecesary").'</a>)';
|
||||
print '<td colspan="2">';
|
||||
print '<input type="text" size="20" id="TAKEPOS_PRINT_SERVER" name="TAKEPOS_PRINT_SERVER" value="'.$conf->global->TAKEPOS_PRINT_SERVER.'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Bar Restaurant mode
|
||||
print '<tr class="oddeven"><td>';
|
||||
print 'Bar Restaurant';
|
||||
print '<td colspan="2">';
|
||||
print $form->selectyesno("TAKEPOS_BAR_RESTAURANT",$conf->global->TAKEPOS_BAR_RESTAURANT,1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
if ($conf->global->TAKEPOS_BAR_RESTAURANT and $conf->global->TAKEBOX){
|
||||
print '<tr class="oddeven value"><td>';
|
||||
print $langs->trans("OrderPrinters").' (<a href="orderprinters.php?leftmenu=setup">'.$langs->trans("Setup").'</a>)';
|
||||
print '<td colspan="2">';
|
||||
print $form->selectyesno("TAKEPOS_ORDER_PRINTERS",$conf->global->TAKEPOS_ORDER_PRINTERS,1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
|
||||
|
||||
print "</form>\n";
|
||||
|
||||
|
||||
|
||||
// Marketplace
|
||||
print "<br><table summary=\"list_of_modules\" class=\"noborder\" width=\"100%\">\n";
|
||||
print "<tr class=\"liste_titre\">\n";
|
||||
print '<td colspan="2">TakePOS Marketplace</td>';
|
||||
print '<td>'.$langs->trans("URL").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print "<tr class=\"oddeven\">\n";
|
||||
$url='https://www.dolistore.com/en/modules/980-TakePOS-7-mobile.html';
|
||||
print '<td align="left"><a href="'.$url.'" target="_blank" rel="external"><img border="0" class="imgautosize imgmaxwidth180" src="../img/marketplace/takeposmobile.jpg"></a></td>';
|
||||
print '<td>TakePOS for mobile devices</td>';
|
||||
print '<td><a href="'.$url.'" target="_blank" rel="external">'.$url.'</a></td>';
|
||||
print '</tr>';
|
||||
|
||||
print "<tr class=\"oddeven\">\n";
|
||||
$url='https://www.dolistore.com/en/modules/949-Cash-Control-7.html';
|
||||
print '<td align="left"><a href="'.$url.'" target="_blank" rel="external"><img border="0" class="imgautosize imgmaxwidth180" src="../img/marketplace/cashcontrol.jpg"></a></td>';
|
||||
print '<td>TakePOS CashControl</td>';
|
||||
print '<td><a href="'.$url.'" target="_blank" rel="external">'.$url.'</a></td>';
|
||||
print '</tr>';
|
||||
|
||||
print "</table>\n";
|
||||
print '<br>';
|
||||
|
||||
// Support
|
||||
print "<br><table summary=\"list_of_modules\" class=\"noborder\" width=\"100%\">\n";
|
||||
print "<tr class=\"liste_titre\">\n";
|
||||
print '<td colspan="2">TakePOS Support</td>';
|
||||
print '<td>'.$langs->trans("URL").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print "<tr class=\"oddeven\">\n";
|
||||
$url='http://www.takepos.com';
|
||||
print '<td align="left"><a href="'.$url.'" target="_blank" rel="external"><img border="0" class="imgautosize imgmaxwidth180" src="../img/takepos.png"></a></td>';
|
||||
print '<td>TakePOS original developers</td>';
|
||||
print '<td><a href="'.$url.'" target="_blank" rel="external">'.$url.'</a></td>';
|
||||
print '</tr>';
|
||||
|
||||
print "</table>\n";
|
||||
print '<br>';
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
62
htdocs/takepos/ajax.php
Normal file
62
htdocs/takepos/ajax.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2004 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/takepos/ajax.php
|
||||
* \brief Ajax search component for TakePos. It search products of a category.
|
||||
*/
|
||||
|
||||
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
|
||||
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language
|
||||
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
|
||||
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','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_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
|
||||
$category = GETPOST('category','alpha');
|
||||
$action = GETPOST('action','alpha');
|
||||
$term = GETPOST('term','alpha');
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
if ($action=="getProducts"){
|
||||
$object = new Categorie($db);
|
||||
$result=$object->fetch($category);
|
||||
$prods = $object->getObjectsInCateg("product");
|
||||
echo json_encode($prods);
|
||||
}
|
||||
|
||||
if ($action=="search"){
|
||||
$sql = 'SELECT * FROM '.MAIN_DB_PREFIX.'product';
|
||||
$sql.= ' WHERE entity IN ('.getEntity('product').')';
|
||||
$sql .= natural_search(array('label','barcode'), $term);
|
||||
$resql = $db->query($sql);
|
||||
$rows = array();
|
||||
while($row = $db->fetch_array ($resql)){
|
||||
$rows[] = $row;
|
||||
}
|
||||
echo json_encode($rows);
|
||||
}
|
||||
219
htdocs/takepos/class/actions_takepos.class.php
Normal file
219
htdocs/takepos/class/actions_takepos.class.php
Normal file
@ -0,0 +1,219 @@
|
||||
<?php
|
||||
/* Copyright (C) 2018 SuperAdmin
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file takepos/class/actions_takepos.class.php
|
||||
* \ingroup takepos
|
||||
* \brief Hooks of takepos module
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class ActionsTakePos
|
||||
*/
|
||||
class ActionsTakePos
|
||||
{
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
/**
|
||||
* @var string Error
|
||||
*/
|
||||
public $error = '';
|
||||
/**
|
||||
* @var array Errors
|
||||
*/
|
||||
public $errors = array();
|
||||
|
||||
|
||||
/**
|
||||
* @var array Hook results. Propagated to $hookmanager->resArray for later reuse
|
||||
*/
|
||||
public $results = array();
|
||||
|
||||
/**
|
||||
* @var string String displayed by executeHook() immediately after return
|
||||
*/
|
||||
public $resprints;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
/**
|
||||
* Overloading the doActions function : replacing the parent's function with the one below
|
||||
*
|
||||
* @param array() $parameters Hook metadatas (context, etc...)
|
||||
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
|
||||
* @param string $action Current action (if set). Generally create or edit or null
|
||||
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
|
||||
* @return int < 0 on error, 0 on success, 1 to replace standard code
|
||||
*/
|
||||
public function doActions($parameters, &$object, &$action, $hookmanager)
|
||||
{
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$error = 0; // Error counter
|
||||
|
||||
/* print_r($parameters); print_r($object); echo "action: " . $action; */
|
||||
if (in_array($parameters['currentcontext'], array('somecontext1','somecontext2'))) // do something only for the context 'somecontext1' or 'somecontext2'
|
||||
{
|
||||
// Do what you want here...
|
||||
// You can for example call global vars like $fieldstosearchall to overwrite them, or update database depending on $action and $_POST values.
|
||||
}
|
||||
|
||||
if (! $error) {
|
||||
$this->results = array('myreturn' => 999);
|
||||
$this->resprints = 'A text to show';
|
||||
return 0; // or return 1 to replace standard code
|
||||
} else {
|
||||
$this->errors[] = 'Error message';
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Overloading the doActions function : replacing the parent's function with the one below
|
||||
*
|
||||
* @param array() $parameters Hook metadatas (context, etc...)
|
||||
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
|
||||
* @param string $action Current action (if set). Generally create or edit or null
|
||||
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
|
||||
* @return int < 0 on error, 0 on success, 1 to replace standard code
|
||||
*/
|
||||
public function addMoreActionsButtons($parameters, &$object, &$action, $hookmanager)
|
||||
{
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$error = 0; // Error counter
|
||||
|
||||
/* print_r($parameters); print_r($object); echo "action: " . $action; */
|
||||
if (in_array($parameters['currentcontext'], array('invoicecard'))) // do something only for the context 'somecontext1' or 'somecontext2'
|
||||
{
|
||||
|
||||
$receipt_url=DOL_URL_ROOT."/takepos/receipt.php";
|
||||
print '<div class="inline-block divButAction"><a target="_blank" class="butAction" href="' . $receipt_url . '?facid=' . $object->id.'">' . $langs->trans('Ticket') .'</a></div>';
|
||||
}
|
||||
|
||||
if (! $error) {
|
||||
$this->results = array('myreturn' => 999);
|
||||
$this->resprints = 'A text to show';
|
||||
return 0; // or return 1 to replace standard code
|
||||
} else {
|
||||
$this->errors[] = 'Error message';
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Overloading the addMoreMassActions function : replacing the parent's function with the one below
|
||||
*
|
||||
* @param array() $parameters Hook metadatas (context, etc...)
|
||||
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
|
||||
* @param string $action Current action (if set). Generally create or edit or null
|
||||
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
|
||||
* @return int < 0 on error, 0 on success, 1 to replace standard code
|
||||
*/
|
||||
public function addMoreMassActions($parameters, &$object, &$action, $hookmanager)
|
||||
{
|
||||
global $conf, $user, $langs;
|
||||
|
||||
$error = 0; // Error counter
|
||||
|
||||
/* print_r($parameters); print_r($object); echo "action: " . $action; */
|
||||
if (in_array($parameters['currentcontext'], array('somecontext1','somecontext2'))) // do something only for the context 'somecontext1' or 'somecontext2'
|
||||
{
|
||||
$this->resprints = '<option value="0"'.($disabled?' disabled="disabled"':'').'>'.$langs->trans("TakePosMassAction").'</option>';
|
||||
}
|
||||
|
||||
if (! $error) {
|
||||
return 0; // or return 1 to replace standard code
|
||||
} else {
|
||||
$this->errors[] = 'Error message';
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Execute action
|
||||
*
|
||||
* @param array $parameters Array of parameters
|
||||
* @param Object $object Object output on PDF
|
||||
* @param string $action 'add', 'update', 'view'
|
||||
* @return int <0 if KO,
|
||||
* =0 if OK but we want to process standard actions too,
|
||||
* >0 if OK and we want to replace standard actions.
|
||||
*/
|
||||
function beforePDFCreation($parameters, &$object, &$action)
|
||||
{
|
||||
global $langs,$conf;
|
||||
global $hookmanager;
|
||||
|
||||
$outputlangs=$langs;
|
||||
|
||||
$ret=0; $deltemp=array();
|
||||
dol_syslog(get_class($this).'::executeHooks action='.$action);
|
||||
|
||||
/* print_r($parameters); print_r($object); echo "action: " . $action; */
|
||||
if (in_array($parameters['currentcontext'], array('somecontext1','somecontext2'))) // do something only for the context 'somecontext1' or 'somecontext2'
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute action
|
||||
*
|
||||
* @param array $parameters Array of parameters
|
||||
* @param Object $pdfhandler PDF builder handler
|
||||
* @param string $action 'add', 'update', 'view'
|
||||
* @return int <0 if KO,
|
||||
* =0 if OK but we want to process standard actions too,
|
||||
* >0 if OK and we want to replace standard actions.
|
||||
*/
|
||||
function afterPDFCreation($parameters, &$pdfhandler, &$action)
|
||||
{
|
||||
global $langs,$conf;
|
||||
global $hookmanager;
|
||||
|
||||
$outputlangs=$langs;
|
||||
|
||||
$ret=0; $deltemp=array();
|
||||
dol_syslog(get_class($this).'::executeHooks action='.$action);
|
||||
|
||||
/* print_r($parameters); print_r($object); echo "action: " . $action; */
|
||||
if (in_array($parameters['currentcontext'], array('somecontext1','somecontext2'))) // do something only for the context 'somecontext1' or 'somecontext2'
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user