Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
This commit is contained in:
parent
0905b3a6b2
commit
e8083e2a65
@ -230,7 +230,7 @@ class Lettering extends BookKeeping
|
|||||||
*
|
*
|
||||||
* @param array $ids ids array
|
* @param array $ids ids array
|
||||||
* @param boolean $notrigger no trigger
|
* @param boolean $notrigger no trigger
|
||||||
* @return number
|
* @return number
|
||||||
*/
|
*/
|
||||||
public function updateLettering($ids = array(), $notrigger = false)
|
public function updateLettering($ids = array(), $notrigger = false)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -100,7 +100,7 @@ if ($action == 'create')
|
|||||||
print "<br>";
|
print "<br>";
|
||||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
@ -113,7 +113,7 @@ if ($action == 'edit' && ! empty($attrname))
|
|||||||
print "<br>";
|
print "<br>";
|
||||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -76,18 +76,18 @@ if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT')
|
|||||||
{
|
{
|
||||||
$freetext = GETPOST('BANK_CHEQUERECEIPT_FREE_TEXT', 'none'); // No alpha here, we want exact string
|
$freetext = GETPOST('BANK_CHEQUERECEIPT_FREE_TEXT', 'none'); // No alpha here, we want exact string
|
||||||
|
|
||||||
$res = dolibarr_set_const($db, "BANK_CHEQUERECEIPT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "BANK_CHEQUERECEIPT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
if (! $res > 0) $error++;
|
if (! $res > 0) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -258,13 +258,13 @@ print $form->textwithpicto($langs->trans("FreeLegalTextOnChequeReceipts"), $lang
|
|||||||
$variablename='BANK_CHEQUERECEIPT_FREE_TEXT';
|
$variablename='BANK_CHEQUERECEIPT_FREE_TEXT';
|
||||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
|
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
|
||||||
{
|
{
|
||||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
$doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
$doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||||
print $doleditor->Create();
|
print $doleditor->Create();
|
||||||
}
|
}
|
||||||
print '</td><td class="right">';
|
print '</td><td class="right">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
|
|||||||
@ -89,9 +89,9 @@ dol_fiche_end();
|
|||||||
// Buttons
|
// Buttons
|
||||||
if ($action != 'create' && $action != 'edit')
|
if ($action != 'create' && $action != 'edit')
|
||||||
{
|
{
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute")."</a>";
|
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute")."</a>";
|
||||||
print "</div>";
|
print "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -103,10 +103,10 @@ if ($action != 'create' && $action != 'edit')
|
|||||||
|
|
||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
print "<br>";
|
print "<br>";
|
||||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
@ -116,10 +116,10 @@ if ($action == 'create')
|
|||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
if ($action == 'edit' && ! empty($attrname))
|
if ($action == 'edit' && ! empty($attrname))
|
||||||
{
|
{
|
||||||
print "<br>";
|
print "<br>";
|
||||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -45,8 +45,8 @@ $action=GETPOST('action', 'alpha');
|
|||||||
// Shipment note
|
// Shipment note
|
||||||
if (! empty($conf->expedition->enabled) && empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
|
if (! empty($conf->expedition->enabled) && empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
|
||||||
{
|
{
|
||||||
// This option should always be set to on when module is on.
|
// This option should always be set to on when module is on.
|
||||||
dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
if ($action == 'activate_sending')
|
if ($action == 'activate_sending')
|
||||||
@ -66,16 +66,16 @@ if ($action == 'disable_sending')
|
|||||||
// Delivery note
|
// Delivery note
|
||||||
if ($action == 'activate_delivery')
|
if ($action == 'activate_delivery')
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); // We must also enable this
|
dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); // We must also enable this
|
||||||
dolibarr_set_const($db, "MAIN_SUBMODULE_LIVRAISON", "1", 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "MAIN_SUBMODULE_LIVRAISON", "1", 'chaine', 0, '', $conf->entity);
|
||||||
header("Location: confexped.php");
|
header("Location: confexped.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
elseif ($action == 'disable_delivery')
|
elseif ($action == 'disable_delivery')
|
||||||
{
|
{
|
||||||
dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON", $conf->entity);
|
dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON", $conf->entity);
|
||||||
header("Location: confexped.php");
|
header("Location: confexped.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -40,19 +40,19 @@ $id_image = GETPOST('id_image', 'int');
|
|||||||
$quality = GETPOST('quality', 'alpha');
|
$quality = GETPOST('quality', 'alpha');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$url = $conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'/api/images/products/'.$id_product.'/'.$id_image.'/'.$quality;
|
$url = $conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'/api/images/products/'.$id_product.'/'.$id_image.'/'.$quality;
|
||||||
$api = new PrestaShopWebservice(
|
$api = new PrestaShopWebservice(
|
||||||
$conf->global->MAIN_MODULE_DOLISTORE_API_SRV,
|
$conf->global->MAIN_MODULE_DOLISTORE_API_SRV,
|
||||||
$conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $dolistore->debug_api
|
$conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $dolistore->debug_api
|
||||||
);
|
);
|
||||||
//echo $url;
|
//echo $url;
|
||||||
$request = $api->executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'GET'));
|
$request = $api->executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'GET'));
|
||||||
header('Content-type:image');
|
header('Content-type:image');
|
||||||
print $request['response'];
|
print $request['response'];
|
||||||
} catch (PrestaShopWebserviceException $e) {
|
} catch (PrestaShopWebserviceException $e) {
|
||||||
// Here we are dealing with errors
|
// Here we are dealing with errors
|
||||||
$trace = $e->getTrace();
|
$trace = $e->getTrace();
|
||||||
if ($trace[0]['args'][0] == 404) die('Bad ID');
|
if ($trace[0]['args'][0] == 404) die('Bad ID');
|
||||||
elseif ($trace[0]['args'][0] == 401) die('Bad auth key');
|
elseif ($trace[0]['args'][0] == 401) die('Bad auth key');
|
||||||
else die('Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV);
|
else die('Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,30 +36,30 @@ if (! $user->admin) accessforbidden();
|
|||||||
*/
|
*/
|
||||||
if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
|
if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
|
||||||
{
|
{
|
||||||
$code=$reg[1];
|
$code=$reg[1];
|
||||||
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
|
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
|
||||||
{
|
{
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
|
if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
|
||||||
{
|
{
|
||||||
$code=$reg[1];
|
$code=$reg[1];
|
||||||
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
||||||
{
|
{
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -86,9 +86,9 @@ dol_fiche_end();
|
|||||||
// Buttons
|
// Buttons
|
||||||
if ($action != 'create' && $action != 'edit')
|
if ($action != 'create' && $action != 'edit')
|
||||||
{
|
{
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||||
print "</div>";
|
print "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -101,9 +101,9 @@ if ($action != 'create' && $action != 'edit')
|
|||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
print '<br><div id="newattrib"></div>';
|
print '<br><div id="newattrib"></div>';
|
||||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
@ -113,10 +113,10 @@ if ($action == 'create')
|
|||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
if ($action == 'edit' && ! empty($attrname))
|
if ($action == 'edit' && ! empty($attrname))
|
||||||
{
|
{
|
||||||
print "<br>";
|
print "<br>";
|
||||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -80,9 +80,9 @@ dol_fiche_end();
|
|||||||
// Buttons
|
// Buttons
|
||||||
if ($action != 'create' && $action != 'edit')
|
if ($action != 'create' && $action != 'edit')
|
||||||
{
|
{
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||||
print "</div>";
|
print "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -95,9 +95,9 @@ if ($action != 'create' && $action != 'edit')
|
|||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
print '<br><div id="newattrib"></div>';
|
print '<br><div id="newattrib"></div>';
|
||||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
@ -107,10 +107,10 @@ if ($action == 'create')
|
|||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
if ($action == 'edit' && ! empty($attrname))
|
if ($action == 'edit' && ! empty($attrname))
|
||||||
{
|
{
|
||||||
print "<br>";
|
print "<br>";
|
||||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -68,22 +68,22 @@ if ($action == 'setvalue' && $user->admin)
|
|||||||
if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_TOWN', GETPOST("fieldtown"), 'chaine', 0, '', $conf->entity)) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_TOWN', GETPOST("fieldtown"), 'chaine', 0, '', $conf->entity)) $error++;
|
||||||
if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_COUNTRY', GETPOST("fieldcountry"), 'chaine', 0, '', $conf->entity)) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_COUNTRY', GETPOST("fieldcountry"), 'chaine', 0, '', $conf->entity)) $error++;
|
||||||
|
|
||||||
// This one must be after the others
|
// This one must be after the others
|
||||||
$valkey='';
|
$valkey='';
|
||||||
$key=GETPOST("key");
|
$key=GETPOST("key");
|
||||||
if ($key) $valkey=$conf->global->$key;
|
if ($key) $valkey=$conf->global->$key;
|
||||||
if (! dolibarr_set_const($db, 'LDAP_KEY_CONTACTS', $valkey, 'chaine', 0, '', $conf->entity)) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_KEY_CONTACTS', $valkey, 'chaine', 0, '', $conf->entity)) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -86,9 +86,9 @@ dol_fiche_end();
|
|||||||
// Buttons
|
// Buttons
|
||||||
if ($action != 'create' && $action != 'edit')
|
if ($action != 'create' && $action != 'edit')
|
||||||
{
|
{
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||||
print "</div>";
|
print "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -101,9 +101,9 @@ if ($action != 'create' && $action != 'edit')
|
|||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
print '<br><div id="newattrib"></div>';
|
print '<br><div id="newattrib"></div>';
|
||||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
@ -113,10 +113,10 @@ if ($action == 'create')
|
|||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
if ($action == 'edit' && ! empty($attrname))
|
if ($action == 'edit' && ! empty($attrname))
|
||||||
{
|
{
|
||||||
print "<br>";
|
print "<br>";
|
||||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -48,7 +48,7 @@ if ($action == 'setvalue')
|
|||||||
$mailerror = GETPOST('MAILING_EMAIL_ERRORSTO', 'alpha');
|
$mailerror = GETPOST('MAILING_EMAIL_ERRORSTO', 'alpha');
|
||||||
$checkread = GETPOST('value', 'alpha');
|
$checkread = GETPOST('value', 'alpha');
|
||||||
$checkread_key = GETPOST('MAILING_EMAIL_UNSUBSCRIBE_KEY', 'alpha');
|
$checkread_key = GETPOST('MAILING_EMAIL_UNSUBSCRIBE_KEY', 'alpha');
|
||||||
$mailingdelay = GETPOST('MAILING_DELAY', 'int');
|
$mailingdelay = GETPOST('MAILING_DELAY', 'int');
|
||||||
|
|
||||||
$res=dolibarr_set_const($db, "MAILING_EMAIL_FROM", $mailfrom, 'chaine', 0, '', $conf->entity);
|
$res=dolibarr_set_const($db, "MAILING_EMAIL_FROM", $mailfrom, 'chaine', 0, '', $conf->entity);
|
||||||
if (! $res > 0) $error++;
|
if (! $res > 0) $error++;
|
||||||
@ -61,16 +61,16 @@ if ($action == 'setvalue')
|
|||||||
$res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE_KEY", $checkread_key, 'chaine', 0, '', $conf->entity);
|
$res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE_KEY", $checkread_key, 'chaine', 0, '', $conf->entity);
|
||||||
if (! $res > 0) $error++;
|
if (! $res > 0) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -41,8 +41,8 @@ $dirsmartphone = array();
|
|||||||
$dirmenus=array_merge(array("/core/menus/"), (array) $conf->modules_parts['menus']);
|
$dirmenus=array_merge(array("/core/menus/"), (array) $conf->modules_parts['menus']);
|
||||||
foreach($dirmenus as $dirmenu)
|
foreach($dirmenus as $dirmenu)
|
||||||
{
|
{
|
||||||
$dirstandard[]=$dirmenu.'standard';
|
$dirstandard[]=$dirmenu.'standard';
|
||||||
$dirsmartphone[]=$dirmenu.'smartphone';
|
$dirsmartphone[]=$dirmenu.'smartphone';
|
||||||
}
|
}
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
@ -85,8 +85,8 @@ if ($action == 'update' && ! $cancel)
|
|||||||
foreach($dirmenus as $dirmenu)
|
foreach($dirmenus as $dirmenu)
|
||||||
{
|
{
|
||||||
$file='init_menu_'.$key.'.sql';
|
$file='init_menu_'.$key.'.sql';
|
||||||
$fullpath=dol_buildpath($dirmenu.$file);
|
$fullpath=dol_buildpath($dirmenu.$file);
|
||||||
//print 'action='.$action.' Search menu into fullpath='.$fullpath.'<br>';exit;
|
//print 'action='.$action.' Search menu into fullpath='.$fullpath.'<br>';exit;
|
||||||
|
|
||||||
if (file_exists($fullpath))
|
if (file_exists($fullpath))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -46,15 +46,15 @@ $type = 'paymentorder';
|
|||||||
|
|
||||||
if ($action == "set")
|
if ($action == "set")
|
||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$id=GETPOST('PRELEVEMENT_ID_BANKACCOUNT', 'int');
|
$id=GETPOST('PRELEVEMENT_ID_BANKACCOUNT', 'int');
|
||||||
$account = new Account($db);
|
$account = new Account($db);
|
||||||
if($account->fetch($id)>0)
|
if($account->fetch($id)>0)
|
||||||
{
|
{
|
||||||
$res = dolibarr_set_const($db, "PRELEVEMENT_ID_BANKACCOUNT", $id, 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "PRELEVEMENT_ID_BANKACCOUNT", $id, 'chaine', 0, '', $conf->entity);
|
||||||
if (! $res > 0) $error++;
|
if (! $res > 0) $error++;
|
||||||
/*
|
/*
|
||||||
$res = dolibarr_set_const($db, "PRELEVEMENT_CODE_BANQUE", $account->code_banque,'chaine',0,'',$conf->entity);
|
$res = dolibarr_set_const($db, "PRELEVEMENT_CODE_BANQUE", $account->code_banque,'chaine',0,'',$conf->entity);
|
||||||
if (! $res > 0) $error++;
|
if (! $res > 0) $error++;
|
||||||
$res = dolibarr_set_const($db, "PRELEVEMENT_CODE_GUICHET", $account->code_guichet,'chaine',0,'',$conf->entity);
|
$res = dolibarr_set_const($db, "PRELEVEMENT_CODE_GUICHET", $account->code_guichet,'chaine',0,'',$conf->entity);
|
||||||
@ -70,33 +70,33 @@ if ($action == "set")
|
|||||||
$res = dolibarr_set_const($db, "PRELEVEMENT_RAISON_SOCIALE", $account->proprio,'chaine',0,'',$conf->entity);
|
$res = dolibarr_set_const($db, "PRELEVEMENT_RAISON_SOCIALE", $account->proprio,'chaine',0,'',$conf->entity);
|
||||||
if (! $res > 0) $error++;
|
if (! $res > 0) $error++;
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
else $error++;
|
else $error++;
|
||||||
|
|
||||||
$res = dolibarr_set_const($db, "PRELEVEMENT_ICS", GETPOST("PRELEVEMENT_ICS"), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "PRELEVEMENT_ICS", GETPOST("PRELEVEMENT_ICS"), 'chaine', 0, '', $conf->entity);
|
||||||
if (! $res > 0) $error++;
|
if (! $res > 0) $error++;
|
||||||
|
|
||||||
if (GETPOST("PRELEVEMENT_USER") > 0)
|
if (GETPOST("PRELEVEMENT_USER") > 0)
|
||||||
{
|
{
|
||||||
$res = dolibarr_set_const($db, "PRELEVEMENT_USER", GETPOST("PRELEVEMENT_USER"), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "PRELEVEMENT_USER", GETPOST("PRELEVEMENT_USER"), 'chaine', 0, '', $conf->entity);
|
||||||
if (! $res > 0) $error++;
|
if (! $res > 0) $error++;
|
||||||
}
|
}
|
||||||
if (GETPOST("PRELEVEMENT_END_TO_END") || GETPOST("PRELEVEMENT_END_TO_END")=="")
|
if (GETPOST("PRELEVEMENT_END_TO_END") || GETPOST("PRELEVEMENT_END_TO_END")=="")
|
||||||
{
|
{
|
||||||
$res = dolibarr_set_const($db, "PRELEVEMENT_END_TO_END", GETPOST("PRELEVEMENT_END_TO_END"), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "PRELEVEMENT_END_TO_END", GETPOST("PRELEVEMENT_END_TO_END"), 'chaine', 0, '', $conf->entity);
|
||||||
if (! $res > 0) $error++;
|
if (! $res > 0) $error++;
|
||||||
}
|
}
|
||||||
if (GETPOST("PRELEVEMENT_USTRD") || GETPOST("PRELEVEMENT_USTRD")=="")
|
if (GETPOST("PRELEVEMENT_USTRD") || GETPOST("PRELEVEMENT_USTRD")=="")
|
||||||
{
|
{
|
||||||
$res = dolibarr_set_const($db, "PRELEVEMENT_USTRD", GETPOST("PRELEVEMENT_USTRD"), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "PRELEVEMENT_USTRD", GETPOST("PRELEVEMENT_USTRD"), 'chaine', 0, '', $conf->entity);
|
||||||
if (! $res > 0) $error++;
|
if (! $res > 0) $error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST("PRELEVEMENT_ADDDAYS") || GETPOST("PRELEVEMENT_ADDDAYS")=="")
|
if (GETPOST("PRELEVEMENT_ADDDAYS") || GETPOST("PRELEVEMENT_ADDDAYS")=="")
|
||||||
{
|
{
|
||||||
$res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity);
|
||||||
if (! $res > 0) $error++;
|
if (! $res > 0) $error++;
|
||||||
} elseif (! $error)
|
} elseif (! $error)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
@ -110,20 +110,20 @@ if ($action == "set")
|
|||||||
|
|
||||||
if ($action == "addnotif")
|
if ($action == "addnotif")
|
||||||
{
|
{
|
||||||
$bon = new BonPrelevement($db);
|
$bon = new BonPrelevement($db);
|
||||||
$bon->AddNotification($db, GETPOST('user', 'int'), $action);
|
$bon->AddNotification($db, GETPOST('user', 'int'), $action);
|
||||||
|
|
||||||
header("Location: prelevement.php");
|
header("Location: prelevement.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == "deletenotif")
|
if ($action == "deletenotif")
|
||||||
{
|
{
|
||||||
$bon = new BonPrelevement($db);
|
$bon = new BonPrelevement($db);
|
||||||
$bon->DeleteNotificationById(GETPOST('notif', 'int'));
|
$bon->DeleteNotificationById(GETPOST('notif', 'int'));
|
||||||
|
|
||||||
header("Location: prelevement.php");
|
header("Location: prelevement.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -40,34 +40,34 @@ $upload_dir=$conf->admin->dir_temp;
|
|||||||
|
|
||||||
if (GETPOST('action', 'aZ09') == 'set_proxy')
|
if (GETPOST('action', 'aZ09') == 'set_proxy')
|
||||||
{
|
{
|
||||||
if (GETPOST("MAIN_USE_CONNECT_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_CONNECT_TIMEOUT")))
|
if (GETPOST("MAIN_USE_CONNECT_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_CONNECT_TIMEOUT")))
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors');
|
setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
if (GETPOST("MAIN_USE_RESPONSE_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_RESPONSE_TIMEOUT")))
|
if (GETPOST("MAIN_USE_RESPONSE_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_RESPONSE_TIMEOUT")))
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors');
|
setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$result=0;
|
$result=0;
|
||||||
$result+=dolibarr_set_const($db, 'MAIN_USE_CONNECT_TIMEOUT', GETPOST("MAIN_USE_CONNECT_TIMEOUT"), 'chaine', 0, '', $conf->entity);
|
$result+=dolibarr_set_const($db, 'MAIN_USE_CONNECT_TIMEOUT', GETPOST("MAIN_USE_CONNECT_TIMEOUT"), 'chaine', 0, '', $conf->entity);
|
||||||
$result+=dolibarr_set_const($db, 'MAIN_USE_RESPONSE_TIMEOUT', GETPOST("MAIN_USE_RESPONSE_TIMEOUT"), 'chaine', 0, '', $conf->entity);
|
$result+=dolibarr_set_const($db, 'MAIN_USE_RESPONSE_TIMEOUT', GETPOST("MAIN_USE_RESPONSE_TIMEOUT"), 'chaine', 0, '', $conf->entity);
|
||||||
$result+=dolibarr_set_const($db, 'MAIN_PROXY_USE', GETPOST("MAIN_PROXY_USE"), 'chaine', 0, '', $conf->entity);
|
$result+=dolibarr_set_const($db, 'MAIN_PROXY_USE', GETPOST("MAIN_PROXY_USE"), 'chaine', 0, '', $conf->entity);
|
||||||
$result+=dolibarr_set_const($db, 'MAIN_PROXY_HOST', GETPOST("MAIN_PROXY_HOST"), 'chaine', 0, '', $conf->entity);
|
$result+=dolibarr_set_const($db, 'MAIN_PROXY_HOST', GETPOST("MAIN_PROXY_HOST"), 'chaine', 0, '', $conf->entity);
|
||||||
$result+=dolibarr_set_const($db, 'MAIN_PROXY_PORT', GETPOST("MAIN_PROXY_PORT"), 'chaine', 0, '', $conf->entity);
|
$result+=dolibarr_set_const($db, 'MAIN_PROXY_PORT', GETPOST("MAIN_PROXY_PORT"), 'chaine', 0, '', $conf->entity);
|
||||||
$result+=dolibarr_set_const($db, 'MAIN_PROXY_USER', GETPOST("MAIN_PROXY_USER"), 'chaine', 0, '', $conf->entity);
|
$result+=dolibarr_set_const($db, 'MAIN_PROXY_USER', GETPOST("MAIN_PROXY_USER"), 'chaine', 0, '', $conf->entity);
|
||||||
$result+=dolibarr_set_const($db, 'MAIN_PROXY_PASS', GETPOST("MAIN_PROXY_PASS"), 'chaine', 0, '', $conf->entity);
|
$result+=dolibarr_set_const($db, 'MAIN_PROXY_PASS', GETPOST("MAIN_PROXY_PASS"), 'chaine', 0, '', $conf->entity);
|
||||||
if ($result < 5) dol_print_error($db);
|
if ($result < 5) dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -99,8 +99,8 @@ dol_fiche_head($head, 'proxy', $langs->trans("Security"), -1);
|
|||||||
|
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
print "\n".'<script type="text/javascript" language="javascript">';
|
print "\n".'<script type="text/javascript" language="javascript">';
|
||||||
print 'jQuery(document).ready(function () {
|
print 'jQuery(document).ready(function () {
|
||||||
function initfields()
|
function initfields()
|
||||||
{
|
{
|
||||||
if (jQuery("#MAIN_PROXY_USE").val()==\'1\')
|
if (jQuery("#MAIN_PROXY_USE").val()==\'1\')
|
||||||
@ -117,7 +117,7 @@ if ($conf->use_javascript_ajax)
|
|||||||
initfields();
|
initfields();
|
||||||
});
|
});
|
||||||
})';
|
})';
|
||||||
print '</script>'."\n";
|
print '</script>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -89,9 +89,9 @@ dol_fiche_end();
|
|||||||
// Buttons
|
// Buttons
|
||||||
if ($action != 'create' && $action != 'edit')
|
if ($action != 'create' && $action != 'edit')
|
||||||
{
|
{
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute")."</a>";
|
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute")."</a>";
|
||||||
print "</div>";
|
print "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -103,10 +103,10 @@ if ($action != 'create' && $action != 'edit')
|
|||||||
|
|
||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
print "<br>";
|
print "<br>";
|
||||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
@ -116,10 +116,10 @@ if ($action == 'create')
|
|||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
if ($action == 'edit' && ! empty($attrname))
|
if ($action == 'edit' && ! empty($attrname))
|
||||||
{
|
{
|
||||||
print "<br>";
|
print "<br>";
|
||||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -35,7 +35,7 @@ $langs->loadLangs(array("admin","resource"));
|
|||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (!$user->admin)
|
if (!$user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
|
|
||||||
|
|||||||
@ -86,9 +86,9 @@ dol_fiche_end();
|
|||||||
// Buttons
|
// Buttons
|
||||||
if ($action != 'create' && $action != 'edit')
|
if ($action != 'create' && $action != 'edit')
|
||||||
{
|
{
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||||
print "</div>";
|
print "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -101,9 +101,9 @@ if ($action != 'create' && $action != 'edit')
|
|||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
print '<br><div id="newattrib"></div>';
|
print '<br><div id="newattrib"></div>';
|
||||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
@ -113,10 +113,10 @@ if ($action == 'create')
|
|||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
if ($action == 'edit' && ! empty($attrname))
|
if ($action == 'edit' && ! empty($attrname))
|
||||||
{
|
{
|
||||||
print "<br>";
|
print "<br>";
|
||||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -84,9 +84,9 @@ dol_fiche_end();
|
|||||||
// Buttons
|
// Buttons
|
||||||
if ($action != 'create' && $action != 'edit')
|
if ($action != 'create' && $action != 'edit')
|
||||||
{
|
{
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||||
print "</div>";
|
print "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -99,9 +99,9 @@ if ($action != 'create' && $action != 'edit')
|
|||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
print '<br><div id="newattrib"></div>';
|
print '<br><div id="newattrib"></div>';
|
||||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
@ -111,10 +111,10 @@ if ($action == 'create')
|
|||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
if ($action == 'edit' && ! empty($attrname))
|
if ($action == 'edit' && ! empty($attrname))
|
||||||
{
|
{
|
||||||
print "<br>";
|
print "<br>";
|
||||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -70,27 +70,27 @@ $configfileparameters=array(
|
|||||||
'?dolibarr_main_auth_ldap_admin_login',
|
'?dolibarr_main_auth_ldap_admin_login',
|
||||||
'?dolibarr_main_auth_ldap_admin_pass',
|
'?dolibarr_main_auth_ldap_admin_pass',
|
||||||
'?dolibarr_main_auth_ldap_debug',
|
'?dolibarr_main_auth_ldap_debug',
|
||||||
'separator',
|
'separator',
|
||||||
'?dolibarr_lib_ADODB_PATH',
|
'?dolibarr_lib_ADODB_PATH',
|
||||||
'?dolibarr_lib_FPDF_PATH',
|
'?dolibarr_lib_FPDF_PATH',
|
||||||
'?dolibarr_lib_TCPDF_PATH',
|
'?dolibarr_lib_TCPDF_PATH',
|
||||||
'?dolibarr_lib_FPDI_PATH',
|
'?dolibarr_lib_FPDI_PATH',
|
||||||
'?dolibarr_lib_TCPDI_PATH',
|
'?dolibarr_lib_TCPDI_PATH',
|
||||||
'?dolibarr_lib_NUSOAP_PATH',
|
'?dolibarr_lib_NUSOAP_PATH',
|
||||||
'?dolibarr_lib_PHPEXCEL_PATH',
|
'?dolibarr_lib_PHPEXCEL_PATH',
|
||||||
'?dolibarr_lib_GEOIP_PATH',
|
'?dolibarr_lib_GEOIP_PATH',
|
||||||
'?dolibarr_lib_ODTPHP_PATH',
|
'?dolibarr_lib_ODTPHP_PATH',
|
||||||
'?dolibarr_lib_ODTPHP_PATHTOPCLZIP',
|
'?dolibarr_lib_ODTPHP_PATHTOPCLZIP',
|
||||||
'?dolibarr_js_CKEDITOR',
|
'?dolibarr_js_CKEDITOR',
|
||||||
'?dolibarr_js_JQUERY',
|
'?dolibarr_js_JQUERY',
|
||||||
'?dolibarr_js_JQUERY_UI',
|
'?dolibarr_js_JQUERY_UI',
|
||||||
'?dolibarr_js_JQUERY_FLOT',
|
'?dolibarr_js_JQUERY_FLOT',
|
||||||
'?dolibarr_font_DOL_DEFAULT_TTF',
|
'?dolibarr_font_DOL_DEFAULT_TTF',
|
||||||
'?dolibarr_font_DOL_DEFAULT_TTF_BOLD',
|
'?dolibarr_font_DOL_DEFAULT_TTF_BOLD',
|
||||||
'separator',
|
'separator',
|
||||||
'?dolibarr_mailing_limit_sendbyweb',
|
'?dolibarr_mailing_limit_sendbyweb',
|
||||||
'?dolibarr_mailing_limit_sendbycli',
|
'?dolibarr_mailing_limit_sendbycli',
|
||||||
'?dolibarr_strict_mode'
|
'?dolibarr_strict_mode'
|
||||||
);
|
);
|
||||||
$configfilelib=array(
|
$configfilelib=array(
|
||||||
// 'separator',
|
// 'separator',
|
||||||
@ -121,20 +121,20 @@ $configfilelib=array(
|
|||||||
'dolibarr_main_auth_ldap_admin_pass',
|
'dolibarr_main_auth_ldap_admin_pass',
|
||||||
'dolibarr_main_auth_ldap_debug',
|
'dolibarr_main_auth_ldap_debug',
|
||||||
'separator',
|
'separator',
|
||||||
'dolibarr_lib_ADODB_PATH',
|
'dolibarr_lib_ADODB_PATH',
|
||||||
'dolibarr_lib_TCPDF_PATH',
|
'dolibarr_lib_TCPDF_PATH',
|
||||||
'dolibarr_lib_FPDI_PATH',
|
'dolibarr_lib_FPDI_PATH',
|
||||||
'dolibarr_lib_NUSOAP_PATH',
|
'dolibarr_lib_NUSOAP_PATH',
|
||||||
'dolibarr_lib_PHPEXCEL_PATH',
|
'dolibarr_lib_PHPEXCEL_PATH',
|
||||||
'dolibarr_lib_GEOIP_PATH',
|
'dolibarr_lib_GEOIP_PATH',
|
||||||
'dolibarr_lib_ODTPHP_PATH',
|
'dolibarr_lib_ODTPHP_PATH',
|
||||||
'dolibarr_lib_ODTPHP_PATHTOPCLZIP',
|
'dolibarr_lib_ODTPHP_PATHTOPCLZIP',
|
||||||
'dolibarr_js_CKEDITOR',
|
'dolibarr_js_CKEDITOR',
|
||||||
'dolibarr_js_JQUERY',
|
'dolibarr_js_JQUERY',
|
||||||
'dolibarr_js_JQUERY_UI',
|
'dolibarr_js_JQUERY_UI',
|
||||||
'dolibarr_js_JQUERY_FLOT',
|
'dolibarr_js_JQUERY_FLOT',
|
||||||
'dolibarr_font_DOL_DEFAULT_TTF',
|
'dolibarr_font_DOL_DEFAULT_TTF',
|
||||||
'dolibarr_font_DOL_DEFAULT_TTF_BOLD',
|
'dolibarr_font_DOL_DEFAULT_TTF_BOLD',
|
||||||
'separator',
|
'separator',
|
||||||
'Limit nb of email sent by page',
|
'Limit nb of email sent by page',
|
||||||
'Strict mode is on/off'
|
'Strict mode is on/off'
|
||||||
@ -155,19 +155,19 @@ foreach($configfileparameters as $key)
|
|||||||
|
|
||||||
if (empty($ignore))
|
if (empty($ignore))
|
||||||
{
|
{
|
||||||
$newkey = preg_replace('/^\?/', '', $key);
|
$newkey = preg_replace('/^\?/', '', $key);
|
||||||
|
|
||||||
if (preg_match('/^\?/', $key) && empty(${$newkey}))
|
if (preg_match('/^\?/', $key) && empty(${$newkey}))
|
||||||
{
|
{
|
||||||
$i++;
|
$i++;
|
||||||
continue; // We discard parametes starting with ?
|
continue; // We discard parametes starting with ?
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($newkey == 'separator' && $lastkeyshown == 'separator')
|
if ($newkey == 'separator' && $lastkeyshown == 'separator')
|
||||||
{
|
{
|
||||||
$i++;
|
$i++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
if ($newkey == 'separator')
|
if ($newkey == 'separator')
|
||||||
@ -233,17 +233,17 @@ if ($resql)
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$obj->name.'</td>'."\n";
|
print '<td>'.$obj->name.'</td>'."\n";
|
||||||
print '<td>'.$obj->value.'</td>'."\n";
|
print '<td>'.$obj->value.'</td>'."\n";
|
||||||
if (empty($conf->multicompany->enabled) || !$user->entity) print '<td>'.$obj->entity.'</td>'."\n"; // If superadmin or multicompany disabled
|
if (empty($conf->multicompany->enabled) || !$user->entity) print '<td>'.$obj->entity.'</td>'."\n"; // If superadmin or multicompany disabled
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
@ -54,17 +54,17 @@ $i=0;
|
|||||||
foreach($modulesdir as $dir)
|
foreach($modulesdir as $dir)
|
||||||
{
|
{
|
||||||
$handle=@opendir(dol_osencode($dir));
|
$handle=@opendir(dol_osencode($dir));
|
||||||
if (is_resource($handle))
|
if (is_resource($handle))
|
||||||
{
|
{
|
||||||
while (($file = readdir($handle))!==false)
|
while (($file = readdir($handle))!==false)
|
||||||
{
|
{
|
||||||
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php')
|
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php')
|
||||||
{
|
{
|
||||||
$modName = substr($file, 0, dol_strlen($file) - 10);
|
$modName = substr($file, 0, dol_strlen($file) - 10);
|
||||||
|
|
||||||
if ($modName)
|
if ($modName)
|
||||||
{
|
{
|
||||||
//print 'xx'.$dir.$file.'<br>';
|
//print 'xx'.$dir.$file.'<br>';
|
||||||
if (in_array($file, $modules_files))
|
if (in_array($file, $modules_files))
|
||||||
{
|
{
|
||||||
// File duplicate
|
// File duplicate
|
||||||
@ -77,13 +77,13 @@ foreach($modulesdir as $dir)
|
|||||||
if (class_exists($modName))
|
if (class_exists($modName))
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$objMod = new $modName($db);
|
$objMod = new $modName($db);
|
||||||
|
|
||||||
$modules[$objMod->numero]=$objMod;
|
$modules[$objMod->numero]=$objMod;
|
||||||
$modules_names[$objMod->numero]=$objMod->name;
|
$modules_names[$objMod->numero]=$objMod->name;
|
||||||
$modules_files[$objMod->numero]=$file;
|
$modules_files[$objMod->numero]=$file;
|
||||||
$modules_fullpath[$file]=$dir.$file;
|
$modules_fullpath[$file]=$dir.$file;
|
||||||
$picto[$objMod->numero]=(isset($objMod->picto) && $objMod->picto)?$objMod->picto:'generic';
|
$picto[$objMod->numero]=(isset($objMod->picto) && $objMod->picto)?$objMod->picto:'generic';
|
||||||
}
|
}
|
||||||
catch(Exception $e)
|
catch(Exception $e)
|
||||||
{
|
{
|
||||||
@ -95,11 +95,11 @@ foreach($modulesdir as $dir)
|
|||||||
print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)<br>";
|
print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)<br>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir($handle);
|
closedir($handle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
@ -120,15 +120,15 @@ foreach($sortorder as $numero=>$name)
|
|||||||
// Module
|
// Module
|
||||||
print '<tr class="oddeven"><td width="300" class="nowrap">';
|
print '<tr class="oddeven"><td width="300" class="nowrap">';
|
||||||
$alt=$name.' - '.$modules_files[$numero];
|
$alt=$name.' - '.$modules_files[$numero];
|
||||||
if (! empty($picto[$numero]))
|
if (! empty($picto[$numero]))
|
||||||
{
|
{
|
||||||
if (preg_match('/^\//', $picto[$numero])) print img_picto($alt, $picto[$numero], 'width="14px"', 1);
|
if (preg_match('/^\//', $picto[$numero])) print img_picto($alt, $picto[$numero], 'width="14px"', 1);
|
||||||
else print img_object($alt, $picto[$numero], 'width="14px"');
|
else print img_object($alt, $picto[$numero], 'width="14px"');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print img_object($alt, $picto[$numero], 'width="14px"');
|
print img_object($alt, $picto[$numero], 'width="14px"');
|
||||||
}
|
}
|
||||||
print ' '.$modules[$numero]->getName();
|
print ' '.$modules[$numero]->getName();
|
||||||
print "</td>";
|
print "</td>";
|
||||||
// Version
|
// Version
|
||||||
|
|||||||
@ -41,54 +41,54 @@ print "<br>\n";
|
|||||||
|
|
||||||
if (!function_exists('xdebug_is_enabled'))
|
if (!function_exists('xdebug_is_enabled'))
|
||||||
{
|
{
|
||||||
print 'XDebug seems to be not installed. Function xdebug_is_enabled not found.';
|
print 'XDebug seems to be not installed. Function xdebug_is_enabled not found.';
|
||||||
llxFooter();
|
llxFooter();
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (function_exists('socket_create'))
|
if (function_exists('socket_create'))
|
||||||
{
|
{
|
||||||
$address = ini_get('xdebug.remote_host')?ini_get('xdebug.remote_host'):'127.0.0.1';
|
$address = ini_get('xdebug.remote_host')?ini_get('xdebug.remote_host'):'127.0.0.1';
|
||||||
$port = ini_get('xdebug.remote_port')?ini_get('xdebug.remote_port'):9000;
|
$port = ini_get('xdebug.remote_port')?ini_get('xdebug.remote_port'):9000;
|
||||||
|
|
||||||
print "<strong>Current xdebug setup:</strong><br>\n";
|
print "<strong>Current xdebug setup:</strong><br>\n";
|
||||||
print "* Remote debug setup:<br>\n";
|
print "* Remote debug setup:<br>\n";
|
||||||
print 'xdebug.remote_enable = '.ini_get('xdebug.remote_enable')."<br>\n";
|
print 'xdebug.remote_enable = '.ini_get('xdebug.remote_enable')."<br>\n";
|
||||||
print 'xdebug.remote_host = '.$address."<br>\n";
|
print 'xdebug.remote_host = '.$address."<br>\n";
|
||||||
print 'xdebug.remote_port = '.$port."<br>\n";
|
print 'xdebug.remote_port = '.$port."<br>\n";
|
||||||
print "* Profiler setup ";
|
print "* Profiler setup ";
|
||||||
if (function_exists('xdebug_get_profiler_filename')) print xdebug_get_profiler_filename()?"(currently on into file ".xdebug_get_profiler_filename().")":"(currently off)";
|
if (function_exists('xdebug_get_profiler_filename')) print xdebug_get_profiler_filename()?"(currently on into file ".xdebug_get_profiler_filename().")":"(currently off)";
|
||||||
else print "(currenlty not available)";
|
else print "(currenlty not available)";
|
||||||
print ":<br>\n";
|
print ":<br>\n";
|
||||||
print 'xdebug.profiler_enable = '.ini_get('xdebug.profiler_enable')."<br>\n";
|
print 'xdebug.profiler_enable = '.ini_get('xdebug.profiler_enable')."<br>\n";
|
||||||
print 'xdebug.profiler_enable_trigger = '.ini_get('xdebug.profiler_enable_trigger')."<br>\n";
|
print 'xdebug.profiler_enable_trigger = '.ini_get('xdebug.profiler_enable_trigger')."<br>\n";
|
||||||
print 'xdebug.profiler_output_dir = '.ini_get('xdebug.profiler_output_dir')."<br>\n";
|
print 'xdebug.profiler_output_dir = '.ini_get('xdebug.profiler_output_dir')."<br>\n";
|
||||||
print 'xdebug.profiler_output_name = '.ini_get('xdebug.profiler_output_name')."<br>\n";
|
print 'xdebug.profiler_output_name = '.ini_get('xdebug.profiler_output_name')."<br>\n";
|
||||||
print 'xdebug.profiler_append = '.ini_get('xdebug.profiler_append')."<br>\n";
|
print 'xdebug.profiler_append = '.ini_get('xdebug.profiler_append')."<br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
echo "To run a debug session, add parameter<br>";
|
echo "To run a debug session, add parameter<br>";
|
||||||
echo "* XDEBUG_SESSION_START=aname on your URL. To stop, remove cookie XDEBUG_SESSION_START.<br>\n";
|
echo "* XDEBUG_SESSION_START=aname on your URL. To stop, remove cookie XDEBUG_SESSION_START.<br>\n";
|
||||||
echo "To run a profiler session (when xdebug.profiler_enable_trigger=1), add parameter<br>\n";
|
echo "To run a profiler session (when xdebug.profiler_enable_trigger=1), add parameter<br>\n";
|
||||||
echo "* XDEBUG_PROFILE=aname on each URL.<br>";
|
echo "* XDEBUG_PROFILE=aname on each URL.<br>";
|
||||||
print "<br>";
|
print "<br>";
|
||||||
|
|
||||||
print "<strong>Test debugger server (Eclipse for example):</strong><br>\n";
|
print "<strong>Test debugger server (Eclipse for example):</strong><br>\n";
|
||||||
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
|
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
|
||||||
if (empty($socket)) die('Unable to prepare a socket');
|
if (empty($socket)) die('Unable to prepare a socket');
|
||||||
//socket_bind($sock, $address, $port) or die('Unable to bind on address='.$address.' port='.$port);
|
//socket_bind($sock, $address, $port) or die('Unable to bind on address='.$address.' port='.$port);
|
||||||
//socket_listen($sock);
|
//socket_listen($sock);
|
||||||
//$client = socket_accept($sock);
|
//$client = socket_accept($sock);
|
||||||
$client=socket_connect($socket, $address, $port);
|
$client=socket_connect($socket, $address, $port);
|
||||||
if ($client)
|
if ($client)
|
||||||
{
|
{
|
||||||
echo "Connection established: ".$client." - address=".$address." port=".$port."<br>\n";
|
echo "Connection established: ".$client." - address=".$address." port=".$port."<br>\n";
|
||||||
echo "There is a Remote debug server at this address.<br>\n";
|
echo "There is a Remote debug server at this address.<br>\n";
|
||||||
echo "<br>\n";
|
echo "<br>\n";
|
||||||
echo "To be sure this debugger accepts input from your PHP server and xdebug, be sure to have\n";
|
echo "To be sure this debugger accepts input from your PHP server and xdebug, be sure to have\n";
|
||||||
echo "your php.ini file with this :<br>\n";
|
echo "your php.ini file with this :<br>\n";
|
||||||
echo '<textarea cols="80" rows="16">'."xdebug.remote_enable=on
|
echo '<textarea cols="80" rows="16">'."xdebug.remote_enable=on
|
||||||
xdebug.remote_handle=dbgp
|
xdebug.remote_handle=dbgp
|
||||||
xdebug.remote_host=localhost
|
xdebug.remote_host=localhost
|
||||||
xdebug.remote_port=9000
|
xdebug.remote_port=9000
|
||||||
@ -103,23 +103,23 @@ xdebug.show_mem_delta=1
|
|||||||
xdebug.trace_output_dir=/tmp/trace
|
xdebug.trace_output_dir=/tmp/trace
|
||||||
xdebug.auto_trace=0
|
xdebug.auto_trace=0
|
||||||
</textarea>\n";
|
</textarea>\n";
|
||||||
print "<br><br>\n";
|
print "<br><br>\n";
|
||||||
echo 'Then check in your debug server (Eclipse), you have setup:<br>
|
echo 'Then check in your debug server (Eclipse), you have setup:<br>
|
||||||
XDebug with same port than in php.ini<br>
|
XDebug with same port than in php.ini<br>
|
||||||
Allow Remote debug=yes or prompt<br>'."\n";
|
Allow Remote debug=yes or prompt<br>'."\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print socket_strerror(socket_last_error());
|
print socket_strerror(socket_last_error());
|
||||||
echo "Failed to connect to address=".$address." port=".$port."<br>\n";
|
echo "Failed to connect to address=".$address." port=".$port."<br>\n";
|
||||||
echo "There is no Remote debug server at this address.\n";
|
echo "There is no Remote debug server at this address.\n";
|
||||||
}
|
}
|
||||||
socket_close($socket);
|
socket_close($socket);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "Can't test if PHPDebug is OK as PHP socket functions are not enabled.";
|
print "Can't test if PHPDebug is OK as PHP socket functions are not enabled.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ $form = new Form($db);
|
|||||||
$tmptype2label = ExtraFields::$type2label;
|
$tmptype2label = ExtraFields::$type2label;
|
||||||
$type2label = array('');
|
$type2label = array('');
|
||||||
foreach ($tmptype2label as $key => $val) {
|
foreach ($tmptype2label as $key => $val) {
|
||||||
$type2label[$key] = $langs->trans($val);
|
$type2label[$key] = $langs->trans($val);
|
||||||
}
|
}
|
||||||
|
|
||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
@ -44,7 +44,7 @@ $attrname = GETPOST('attrname', 'alpha');
|
|||||||
$elementtype = 'ticket'; //Must be the $table_element of the class that manage extrafield
|
$elementtype = 'ticket'; //Must be the $table_element of the class that manage extrafield
|
||||||
|
|
||||||
if (!$user->admin) {
|
if (!$user->admin) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -79,9 +79,9 @@ dol_fiche_end();
|
|||||||
|
|
||||||
// Buttons
|
// Buttons
|
||||||
if ($action != 'create' && $action != 'edit') {
|
if ($action != 'create' && $action != 'edit') {
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . "?action=create\">" . $langs->trans("NewAttribute") . '</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . "?action=create\">" . $langs->trans("NewAttribute") . '</a></div>';
|
||||||
print "</div>";
|
print "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
@ -91,10 +91,10 @@ if ($action != 'create' && $action != 'edit') {
|
|||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
if ($action == 'create') {
|
if ($action == 'create') {
|
||||||
print "<br>";
|
print "<br>";
|
||||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||||
|
|
||||||
include DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_add.tpl.php';
|
include DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_add.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
@ -103,10 +103,10 @@ if ($action == 'create') {
|
|||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
if ($action == 'edit' && !empty($attrname)) {
|
if ($action == 'edit' && !empty($attrname)) {
|
||||||
print "<br>";
|
print "<br>";
|
||||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||||
|
|
||||||
include DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_edit.tpl.php';
|
include DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_edit.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -54,9 +54,9 @@ $version='0.0';
|
|||||||
|
|
||||||
if ($action == 'getlastversion')
|
if ($action == 'getlastversion')
|
||||||
{
|
{
|
||||||
$result = getURLContent('http://sourceforge.net/projects/dolibarr/rss');
|
$result = getURLContent('http://sourceforge.net/projects/dolibarr/rss');
|
||||||
//var_dump($result['content']);
|
//var_dump($result['content']);
|
||||||
$sfurl = simplexml_load_string($result['content']);
|
$sfurl = simplexml_load_string($result['content']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -75,39 +75,39 @@ print $langs->trans("CurrentVersion").' : <strong>'.DOL_VERSION.'</strong><br>';
|
|||||||
|
|
||||||
if (function_exists('curl_init'))
|
if (function_exists('curl_init'))
|
||||||
{
|
{
|
||||||
$conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10;
|
$conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10;
|
||||||
|
|
||||||
if ($action == 'getlastversion')
|
if ($action == 'getlastversion')
|
||||||
{
|
{
|
||||||
if ($sfurl)
|
if ($sfurl)
|
||||||
{
|
{
|
||||||
$i=0;
|
$i=0;
|
||||||
while (! empty($sfurl->channel[0]->item[$i]->title) && $i < 10000)
|
while (! empty($sfurl->channel[0]->item[$i]->title) && $i < 10000)
|
||||||
{
|
{
|
||||||
$title=$sfurl->channel[0]->item[$i]->title;
|
$title=$sfurl->channel[0]->item[$i]->title;
|
||||||
if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg))
|
if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg))
|
||||||
{
|
{
|
||||||
$newversion=$reg[1];
|
$newversion=$reg[1];
|
||||||
$newversionarray=explode('.', $newversion);
|
$newversionarray=explode('.', $newversion);
|
||||||
$versionarray=explode('.', $version);
|
$versionarray=explode('.', $version);
|
||||||
//var_dump($newversionarray);var_dump($versionarray);
|
//var_dump($newversionarray);var_dump($versionarray);
|
||||||
if (versioncompare($newversionarray, $versionarray) > 0) $version=$newversion;
|
if (versioncompare($newversionarray, $versionarray) > 0) $version=$newversion;
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show version
|
// Show version
|
||||||
print $langs->trans("LastStableVersion").' : <b>'. (($version != '0.0')?$version:$langs->trans("Unknown")) .'</b><br>';
|
print $langs->trans("LastStableVersion").' : <b>'. (($version != '0.0')?$version:$langs->trans("Unknown")) .'</b><br>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $langs->trans("LastStableVersion").' : <b>' .$langs->trans("UpdateServerOffline").'</b><br>';
|
print $langs->trans("LastStableVersion").' : <b>' .$langs->trans("UpdateServerOffline").'</b><br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $langs->trans("LastStableVersion").' : <a href="'.$_SERVER["PHP_SELF"].'?action=getlastversion" class="button">' .$langs->trans("Check").'</a><br>';
|
print $langs->trans("LastStableVersion").' : <a href="'.$_SERVER["PHP_SELF"].'?action=getlastversion" class="button">' .$langs->trans("Check").'</a><br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|||||||
@ -76,9 +76,9 @@ dol_fiche_end();
|
|||||||
// Buttons
|
// Buttons
|
||||||
if ($action != 'create' && $action != 'edit')
|
if ($action != 'create' && $action != 'edit')
|
||||||
{
|
{
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a></div>';
|
||||||
print "</div>";
|
print "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -90,10 +90,10 @@ if ($action != 'create' && $action != 'edit')
|
|||||||
|
|
||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
print "<br>";
|
print "<br>";
|
||||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
@ -103,10 +103,10 @@ if ($action == 'create')
|
|||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
if ($action == 'edit' && ! empty($attrname))
|
if ($action == 'edit' && ! empty($attrname))
|
||||||
{
|
{
|
||||||
print "<br>";
|
print "<br>";
|
||||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -61,28 +61,28 @@ if (! empty($conf->global->BARCODE_PRODUCT_ADDON_NUM))
|
|||||||
$dir = dol_buildpath($dirroot, 0);
|
$dir = dol_buildpath($dirroot, 0);
|
||||||
|
|
||||||
$handle = @opendir($dir);
|
$handle = @opendir($dir);
|
||||||
if (is_resource($handle))
|
if (is_resource($handle))
|
||||||
{
|
{
|
||||||
while (($file = readdir($handle))!==false)
|
while (($file = readdir($handle))!==false)
|
||||||
{
|
{
|
||||||
if (preg_match('/^mod_barcode_product_.*php$/', $file))
|
if (preg_match('/^mod_barcode_product_.*php$/', $file))
|
||||||
{
|
{
|
||||||
$file = substr($file, 0, dol_strlen($file)-4);
|
$file = substr($file, 0, dol_strlen($file)-4);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
dol_include_once($dirroot.$file.'.php');
|
dol_include_once($dirroot.$file.'.php');
|
||||||
}
|
}
|
||||||
catch(Exception $e)
|
catch(Exception $e)
|
||||||
{
|
{
|
||||||
dol_syslog($e->getMessage(), LOG_ERR);
|
dol_syslog($e->getMessage(), LOG_ERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
$modBarCodeProduct = new $file();
|
$modBarCodeProduct = new $file();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir($handle);
|
closedir($handle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -37,8 +37,8 @@ $element = GETPOST('element', 'alpha');
|
|||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
|
|
||||||
if ($element === 'facture') {
|
if ($element === 'facture') {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
|
|
||||||
$facture = new Facture($db);
|
$facture = new Facture($db);
|
||||||
if($facture->fetch($id)>0) {
|
if($facture->fetch($id)>0) {
|
||||||
|
|||||||
@ -53,13 +53,13 @@ function blockedlogadmin_prepare_head()
|
|||||||
|
|
||||||
$object=new stdClass();
|
$object=new stdClass();
|
||||||
|
|
||||||
// Show more tabs from modules
|
// Show more tabs from modules
|
||||||
// Entries must be declared in modules descriptor with line
|
// Entries must be declared in modules descriptor with line
|
||||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'blockedlog');
|
complete_head_from_modules($conf, $langs, $object, $head, $h, 'blockedlog');
|
||||||
|
|
||||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'blockedlog', 'remove');
|
complete_head_from_modules($conf, $langs, $object, $head, $h, 'blockedlog', 'remove');
|
||||||
|
|
||||||
return $head;
|
return $head;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -74,11 +74,11 @@ if (is_array($hookmanager->resArray) && ! empty($hookmanager->resArray)) {
|
|||||||
<?php
|
<?php
|
||||||
if (! empty($mysoc->logo_small))
|
if (! empty($mysoc->logo_small))
|
||||||
{
|
{
|
||||||
print '<img class="logopos" alt="Logo company" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small).'">';
|
print '<img class="logopos" alt="Logo company" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small).'">';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<div class="logopos">'.$mysoc->name.'</div>';
|
print '<div class="logopos">'.$mysoc->name.'</div>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -143,19 +143,19 @@ if ($object->id > 0)
|
|||||||
// Project
|
// Project
|
||||||
if (! empty($conf->projet->enabled))
|
if (! empty($conf->projet->enabled))
|
||||||
{
|
{
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
//$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
//$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||||
$morehtmlref.=$langs->trans('Project') . ': ';
|
$morehtmlref.=$langs->trans('Project') . ': ';
|
||||||
if (! empty($object->fk_project)) {
|
if (! empty($object->fk_project)) {
|
||||||
$proj = new Project($db);
|
$proj = new Project($db);
|
||||||
$proj->fetch($object->fk_project);
|
$proj->fetch($object->fk_project);
|
||||||
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
||||||
$morehtmlref.=$proj->ref;
|
$morehtmlref.=$proj->ref;
|
||||||
$morehtmlref.='</a>';
|
$morehtmlref.='</a>';
|
||||||
if ($proj->title) $morehtmlref.=' - '.$proj->title;
|
if ($proj->title) $morehtmlref.=' - '.$proj->title;
|
||||||
} else {
|
} else {
|
||||||
$morehtmlref.='';
|
$morehtmlref.='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$morehtmlref.='</div>';
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
@ -253,9 +253,9 @@ if ($object->id > 0)
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
$modulepart = 'actions';
|
$modulepart = 'actions';
|
||||||
|
|||||||
@ -85,9 +85,9 @@ dol_fiche_end();
|
|||||||
// Buttons
|
// Buttons
|
||||||
if ($action != 'create' && $action != 'edit')
|
if ($action != 'create' && $action != 'edit')
|
||||||
{
|
{
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||||
print "</div>";
|
print "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -100,9 +100,9 @@ if ($action != 'create' && $action != 'edit')
|
|||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
print '<br><div id="newattrib"></div>';
|
print '<br><div id="newattrib"></div>';
|
||||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
@ -112,10 +112,10 @@ if ($action == 'create')
|
|||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
if ($action == 'edit' && ! empty($attrname))
|
if ($action == 'edit' && ! empty($attrname))
|
||||||
{
|
{
|
||||||
print "<br>";
|
print "<br>";
|
||||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -162,13 +162,13 @@ if ($resql)
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|
||||||
$result='';
|
$result='';
|
||||||
$link=$linkend='';
|
$link=$linkend='';
|
||||||
$link = '<a href="'.dol_buildpath('/commande/orderstoinvoice.php', 1).'?socid='.$obj->rowid.'">';
|
$link = '<a href="'.dol_buildpath('/commande/orderstoinvoice.php', 1).'?socid='.$obj->rowid.'">';
|
||||||
$linkend='</a>';
|
$linkend='</a>';
|
||||||
$name=$obj->name;
|
$name=$obj->name;
|
||||||
$result.=($link.img_object($langs->trans("ShowCompany").': '.$name, 'company').$linkend);
|
$result.=($link.img_object($langs->trans("ShowCompany").': '.$name, 'company').$linkend);
|
||||||
$result.=$link.(dol_trunc($name, $maxlen)).$linkend;
|
$result.=$link.(dol_trunc($name, $maxlen)).$linkend;
|
||||||
|
|
||||||
print $result;
|
print $result;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -54,15 +54,15 @@ $sql.= " AND pb.entity = ".$conf->entity;
|
|||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
if ( $num > 0 )
|
if ( $num > 0 )
|
||||||
{
|
{
|
||||||
$row = $db->fetch_row($resql);
|
$row = $db->fetch_row($resql);
|
||||||
$total = $row[0];
|
$total = $row[0];
|
||||||
$nbtotal = $row[1];
|
$nbtotal = $row[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -150,15 +150,15 @@ $sql.= " AND pl.statut = 3";
|
|||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
if ( $num > 0 )
|
if ( $num > 0 )
|
||||||
{
|
{
|
||||||
$row = $db->fetch_row($resql);
|
$row = $db->fetch_row($resql);
|
||||||
$total = $row[0];
|
$total = $row[0];
|
||||||
$nbtotal = $row[1];
|
$nbtotal = $row[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -27,8 +27,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
if (! empty($conf->projet->enabled))
|
if (! empty($conf->projet->enabled))
|
||||||
{
|
{
|
||||||
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
@ -51,10 +51,10 @@ $object = new ChargeSociales($db);
|
|||||||
|
|
||||||
if ($action == 'setlib' && $user->rights->tax->charges->creer)
|
if ($action == 'setlib' && $user->rights->tax->charges->creer)
|
||||||
{
|
{
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$result = $object->setValueFrom('libelle', GETPOST('lib'), '', '', 'text', '', $user, 'TAX_MODIFY');
|
$result = $object->setValueFrom('libelle', GETPOST('lib'), '', '', 'text', '', $user, 'TAX_MODIFY');
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -84,17 +84,17 @@ $morehtmlref.=$form->editfieldval("Label", 'lib', $object->label, $object, $user
|
|||||||
// Project
|
// Project
|
||||||
if (! empty($conf->projet->enabled))
|
if (! empty($conf->projet->enabled))
|
||||||
{
|
{
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' : ';
|
$morehtmlref.='<br>'.$langs->trans('Project') . ' : ';
|
||||||
if (! empty($object->fk_project)) {
|
if (! empty($object->fk_project)) {
|
||||||
$proj = new Project($db);
|
$proj = new Project($db);
|
||||||
$proj->fetch($object->fk_project);
|
$proj->fetch($object->fk_project);
|
||||||
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
||||||
$morehtmlref.=$proj->ref;
|
$morehtmlref.=$proj->ref;
|
||||||
$morehtmlref.='</a>';
|
$morehtmlref.='</a>';
|
||||||
} else {
|
} else {
|
||||||
$morehtmlref.='';
|
$morehtmlref.='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$morehtmlref.='</div>';
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
|
|||||||
@ -80,9 +80,9 @@ dol_fiche_end();
|
|||||||
// Buttons
|
// Buttons
|
||||||
if ($action != 'create' && $action != 'edit')
|
if ($action != 'create' && $action != 'edit')
|
||||||
{
|
{
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||||
print "</div>";
|
print "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -95,9 +95,9 @@ if ($action != 'create' && $action != 'edit')
|
|||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
print '<br><div name="topofform" id="newattrib"></div>';
|
print '<br><div name="topofform" id="newattrib"></div>';
|
||||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
@ -108,9 +108,9 @@ if ($action == 'create')
|
|||||||
if ($action == 'edit' && ! empty($attrname))
|
if ($action == 'edit' && ! empty($attrname))
|
||||||
{
|
{
|
||||||
print '<div name="topofform"></div><br>';
|
print '<div name="topofform"></div><br>';
|
||||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -80,9 +80,9 @@ dol_fiche_end();
|
|||||||
// Buttons
|
// Buttons
|
||||||
if ($action != 'create' && $action != 'edit')
|
if ($action != 'create' && $action != 'edit')
|
||||||
{
|
{
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||||
print "</div>";
|
print "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ if ($action == 'create')
|
|||||||
print '<br><div id="newattrib"></div>';
|
print '<br><div id="newattrib"></div>';
|
||||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
@ -107,10 +107,10 @@ if ($action == 'create')
|
|||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
if ($action == 'edit' && ! empty($attrname))
|
if ($action == 'edit' && ! empty($attrname))
|
||||||
{
|
{
|
||||||
print "<br>";
|
print "<br>";
|
||||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -32,9 +32,9 @@ $addlinkid = GETPOST('idtolinkto', 'int');
|
|||||||
// Link invoice to order
|
// Link invoice to order
|
||||||
if ($action == 'addlink' && ! empty($permissiondellink) && ! GETPOST('cancel', 'alpha') && $id > 0 && $addlinkid > 0)
|
if ($action == 'addlink' && ! empty($permissiondellink) && ! GETPOST('cancel', 'alpha') && $id > 0 && $addlinkid > 0)
|
||||||
{
|
{
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
$result = $object->add_object_linked(GETPOST('addlink', 'alpha'), $addlinkid);
|
$result = $object->add_object_linked(GETPOST('addlink', 'alpha'), $addlinkid);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete link
|
// Delete link
|
||||||
|
|||||||
@ -29,63 +29,63 @@
|
|||||||
|
|
||||||
// Print file
|
// Print file
|
||||||
if ($action == 'print_file' && $user->rights->printing->read) {
|
if ($action == 'print_file' && $user->rights->printing->read) {
|
||||||
$langs->load("printing");
|
$langs->load("printing");
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/modules/printing/modules_printing.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/modules/printing/modules_printing.php';
|
||||||
$objectprint = new PrintingDriver($db);
|
$objectprint = new PrintingDriver($db);
|
||||||
$list = $objectprint->listDrivers($db, 10);
|
$list = $objectprint->listDrivers($db, 10);
|
||||||
if (! empty($list)) {
|
if (! empty($list)) {
|
||||||
$errorprint=0;
|
$errorprint=0;
|
||||||
$printerfound=0;
|
$printerfound=0;
|
||||||
foreach ($list as $driver) {
|
foreach ($list as $driver) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php';
|
||||||
$langs->load($driver);
|
$langs->load($driver);
|
||||||
$classname = 'printing_'.$driver;
|
$classname = 'printing_'.$driver;
|
||||||
$printer = new $classname($db);
|
$printer = new $classname($db);
|
||||||
//print '<pre>'.print_r($printer, true).'</pre>';
|
//print '<pre>'.print_r($printer, true).'</pre>';
|
||||||
|
|
||||||
if (! empty($conf->global->{$printer->active}))
|
if (! empty($conf->global->{$printer->active}))
|
||||||
{
|
{
|
||||||
$printerfound++;
|
$printerfound++;
|
||||||
|
|
||||||
$subdir='';
|
$subdir='';
|
||||||
$module = GETPOST('printer', 'alpha');
|
$module = GETPOST('printer', 'alpha');
|
||||||
switch ($module )
|
switch ($module )
|
||||||
{
|
{
|
||||||
case 'livraison' :
|
case 'livraison' :
|
||||||
$subdir = 'receipt';
|
$subdir = 'receipt';
|
||||||
$module = 'expedition';
|
$module = 'expedition';
|
||||||
break;
|
break;
|
||||||
case 'expedition' :
|
case 'expedition' :
|
||||||
$subdir = 'sending';
|
$subdir = 'sending';
|
||||||
break;
|
break;
|
||||||
case 'commande_fournisseur' :
|
case 'commande_fournisseur' :
|
||||||
$module = 'fournisseur';
|
$module = 'fournisseur';
|
||||||
$subdir = 'commande';
|
$subdir = 'commande';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
$ret = $printer->printFile(GETPOST('file', 'alpha'), $module, $subdir);
|
$ret = $printer->printFile(GETPOST('file', 'alpha'), $module, $subdir);
|
||||||
if ($ret > 0) {
|
if ($ret > 0) {
|
||||||
//print '<pre>'.print_r($printer->errors, true).'</pre>';
|
//print '<pre>'.print_r($printer->errors, true).'</pre>';
|
||||||
setEventMessages($printer->error, $printer->errors, 'errors');
|
setEventMessages($printer->error, $printer->errors, 'errors');
|
||||||
}
|
}
|
||||||
if ($ret==0)
|
if ($ret==0)
|
||||||
{
|
{
|
||||||
//print '<pre>'.print_r($printer->errors, true).'</pre>';
|
//print '<pre>'.print_r($printer->errors, true).'</pre>';
|
||||||
setEventMessages($printer->error, $printer->errors);
|
setEventMessages($printer->error, $printer->errors);
|
||||||
setEventMessages($langs->transnoentitiesnoconv("FileWasSentToPrinter", basename(GETPOST('file', 'alpha'))).' '.$langs->transnoentitiesnoconv("ViaModule").' '.$printer->name, null);
|
setEventMessages($langs->transnoentitiesnoconv("FileWasSentToPrinter", basename(GETPOST('file', 'alpha'))).' '.$langs->transnoentitiesnoconv("ViaModule").' '.$printer->name, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(Exception $e)
|
catch(Exception $e)
|
||||||
{
|
{
|
||||||
$ret = 1;
|
$ret = 1;
|
||||||
setEventMessages($e->getMessage(), null, 'errors');
|
setEventMessages($e->getMessage(), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($printerfound==0) setEventMessages($langs->trans("NoActivePrintingModuleFound", $langs->transnoentities("Module64000Name")), null, 'warnings');
|
if ($printerfound==0) setEventMessages($langs->trans("NoActivePrintingModuleFound", $langs->transnoentities("Module64000Name")), null, 'warnings');
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($langs->trans("NoModuleFound"), null, 'warnings');
|
setEventMessages($langs->trans("NoModuleFound"), null, 'warnings');
|
||||||
}
|
}
|
||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -60,8 +60,8 @@ if ($action == 'setnote_public' && ! empty($permissionnote) && ! GETPOST('cancel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif ($action == 'setnote_private' && ! empty($permissionnote) && ! GETPOST('cancel', 'alpha')) {
|
} elseif ($action == 'setnote_private' && ! empty($permissionnote) && ! GETPOST('cancel', 'alpha')) {
|
||||||
// Set public note
|
// Set public note
|
||||||
if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('', 'Include of actions_setnotes.inc.php was done but required variable was not set before');
|
if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('', 'Include of actions_setnotes.inc.php was done but required variable was not set before');
|
||||||
if (empty($object->id)) $object->fetch($id); // Fetch may not be already done
|
if (empty($object->id)) $object->fetch($id); // Fetch may not be already done
|
||||||
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private', 'none'), ENT_QUOTES), '_private');
|
$result=$object->update_note(dol_html_entity_decode(GETPOST('note_private', 'none'), ENT_QUOTES), '_private');
|
||||||
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
|||||||
@ -51,46 +51,46 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $
|
|||||||
{
|
{
|
||||||
// Increase date
|
// Increase date
|
||||||
$al = new AccountLine($db);
|
$al = new AccountLine($db);
|
||||||
$al->datev_next(GETPOST('rowid', 'int'));
|
$al->datev_next(GETPOST('rowid', 'int'));
|
||||||
$al->fetch(GETPOST('rowid', 'int'));
|
$al->fetch(GETPOST('rowid', 'int'));
|
||||||
|
|
||||||
print '<span>'.dol_print_date($db->jdate($al->datev), "day").'</span>';
|
print '<span>'.dol_print_date($db->jdate($al->datev), "day").'</span>';
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'dvprev')
|
if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'dvprev')
|
||||||
{
|
{
|
||||||
// Decrease date
|
// Decrease date
|
||||||
$al =new AccountLine($db);
|
$al =new AccountLine($db);
|
||||||
$al->datev_previous(GETPOST('rowid', 'int'));
|
$al->datev_previous(GETPOST('rowid', 'int'));
|
||||||
$al->fetch(GETPOST('rowid', 'int'));
|
$al->fetch(GETPOST('rowid', 'int'));
|
||||||
|
|
||||||
print '<span>'.dol_print_date($db->jdate($al->datev), "day").'</span>';
|
print '<span>'.dol_print_date($db->jdate($al->datev), "day").'</span>';
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'donext')
|
if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'donext')
|
||||||
{
|
{
|
||||||
// Increase date
|
// Increase date
|
||||||
$al = new AccountLine($db);
|
$al = new AccountLine($db);
|
||||||
$al->dateo_next(GETPOST('rowid', 'int'));
|
$al->dateo_next(GETPOST('rowid', 'int'));
|
||||||
$al->fetch(GETPOST('rowid', 'int'));
|
$al->fetch(GETPOST('rowid', 'int'));
|
||||||
|
|
||||||
print '<span>'.dol_print_date($db->jdate($al->dateo), "day").'</span>';
|
print '<span>'.dol_print_date($db->jdate($al->dateo), "day").'</span>';
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'doprev')
|
if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'doprev')
|
||||||
{
|
{
|
||||||
// Decrease date
|
// Decrease date
|
||||||
$al =new AccountLine($db);
|
$al =new AccountLine($db);
|
||||||
$al->dateo_previous(GETPOST('rowid', 'int'));
|
$al->dateo_previous(GETPOST('rowid', 'int'));
|
||||||
$al->fetch(GETPOST('rowid', 'int'));
|
$al->fetch(GETPOST('rowid', 'int'));
|
||||||
|
|
||||||
print '<span>'.dol_print_date($db->jdate($al->dateo), "day").'</span>';
|
print '<span>'.dol_print_date($db->jdate($al->dateo), "day").'</span>';
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,23 +53,23 @@ header('Access-Control-Allow-Headers: X-File-Name, X-File-Type, X-File-Size');
|
|||||||
switch ($_SERVER['REQUEST_METHOD']) {
|
switch ($_SERVER['REQUEST_METHOD']) {
|
||||||
case 'OPTIONS':
|
case 'OPTIONS':
|
||||||
break;
|
break;
|
||||||
case 'HEAD':
|
case 'HEAD':
|
||||||
case 'GET':
|
case 'GET':
|
||||||
$upload_handler->get();
|
$upload_handler->get();
|
||||||
break;
|
break;
|
||||||
case 'POST':
|
case 'POST':
|
||||||
if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') {
|
if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') {
|
||||||
$upload_handler->delete();
|
$upload_handler->delete();
|
||||||
} else {
|
} else {
|
||||||
$upload_handler->post();
|
$upload_handler->post();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'DELETE':
|
case 'DELETE':
|
||||||
$upload_handler->delete();
|
$upload_handler->delete();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
header('HTTP/1.0 405 Method Not Allowed');
|
header('HTTP/1.0 405 Method Not Allowed');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -68,4 +68,4 @@ else
|
|||||||
|
|
||||||
// Registering new values
|
// Registering new values
|
||||||
if (($action == 'set') && ! empty($id))
|
if (($action == 'set') && ! empty($id))
|
||||||
$object->setValueFrom($field, $value, $element, $id);
|
$object->setValueFrom($field, $value, $element, $id);
|
||||||
|
|||||||
@ -44,8 +44,8 @@ if (isset($_GET['action']) && ! empty($_GET['action']))
|
|||||||
{
|
{
|
||||||
if ($_GET['action'] == 'getrandompassword' && $user->admin)
|
if ($_GET['action'] == 'getrandompassword' && $user->admin)
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
||||||
$generic = $_GET['generic'] ? true : false;
|
$generic = $_GET['generic'] ? true : false;
|
||||||
echo getRandomPassword($generic);
|
echo getRandomPassword($generic);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,36 +62,36 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town']))
|
|||||||
|
|
||||||
if (! empty($conf->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) // Use zip-town table
|
if (! empty($conf->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) // Use zip-town table
|
||||||
{
|
{
|
||||||
$sql = "SELECT z.rowid, z.zip, z.town, z.fk_county, z.fk_pays as fk_country";
|
$sql = "SELECT z.rowid, z.zip, z.town, z.fk_county, z.fk_pays as fk_country";
|
||||||
$sql.= ", c.rowid as fk_country, c.code as country_code, c.label as country";
|
$sql.= ", c.rowid as fk_country, c.code as country_code, c.label as country";
|
||||||
$sql.= ", d.rowid as fk_county, d.code_departement as county_code, d.nom as county";
|
$sql.= ", d.rowid as fk_county, d.code_departement as county_code, d.nom as county";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_ziptown as z";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_ziptown as z";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON z.fk_county = d.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON z.fk_county = d.rowid";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r ON d.fk_region = r.code_region,";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r ON d.fk_region = r.code_region,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX."c_country as c";
|
$sql.= " ".MAIN_DB_PREFIX."c_country as c";
|
||||||
$sql.= " WHERE z.fk_pays = c.rowid";
|
$sql.= " WHERE z.fk_pays = c.rowid";
|
||||||
$sql.= " AND z.active = 1 AND c.active = 1";
|
$sql.= " AND z.active = 1 AND c.active = 1";
|
||||||
if ($zipcode) $sql.=" AND z.zip LIKE '" . $db->escape($zipcode) . "%'";
|
if ($zipcode) $sql.=" AND z.zip LIKE '" . $db->escape($zipcode) . "%'";
|
||||||
if ($town) $sql.=" AND z.town LIKE '%" . $db->escape($town) . "%'";
|
if ($town) $sql.=" AND z.town LIKE '%" . $db->escape($town) . "%'";
|
||||||
$sql.= " ORDER BY z.zip, z.town";
|
$sql.= " ORDER BY z.zip, z.town";
|
||||||
$sql.= $db->plimit(100); // Avoid pb with bad criteria
|
$sql.= $db->plimit(100); // Avoid pb with bad criteria
|
||||||
}
|
}
|
||||||
else // Use table of third parties
|
else // Use table of third parties
|
||||||
{
|
{
|
||||||
$sql = "SELECT DISTINCT s.zip, s.town, s.fk_departement as fk_county, s.fk_pays as fk_country";
|
$sql = "SELECT DISTINCT s.zip, s.town, s.fk_departement as fk_county, s.fk_pays as fk_country";
|
||||||
$sql.= ", c.code as country_code, c.label as country";
|
$sql.= ", c.code as country_code, c.label as country";
|
||||||
$sql.= ", d.code_departement as county_code , d.nom as county";
|
$sql.= ", d.code_departement as county_code , d.nom as county";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.'societe as s';
|
$sql.= " FROM ".MAIN_DB_PREFIX.'societe as s';
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON s.fk_departement = d.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON s.fk_departement = d.rowid";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid';
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid';
|
||||||
$sql.= " WHERE";
|
$sql.= " WHERE";
|
||||||
if ($zipcode) $sql.= " s.zip LIKE '".$db->escape($zipcode)."%'";
|
if ($zipcode) $sql.= " s.zip LIKE '".$db->escape($zipcode)."%'";
|
||||||
if ($town) $sql.= " s.town LIKE '%" . $db->escape($town) . "%'";
|
if ($town) $sql.= " s.town LIKE '%" . $db->escape($town) . "%'";
|
||||||
$sql.= " ORDER BY s.fk_pays, s.zip, s.town";
|
$sql.= " ORDER BY s.fk_pays, s.zip, s.town";
|
||||||
$sql.= $db->plimit(100); // Avoid pb with bad criteria
|
$sql.= $db->plimit(100); // Avoid pb with bad criteria
|
||||||
}
|
}
|
||||||
|
|
||||||
//print $sql;
|
//print $sql;
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
//var_dump($db);
|
//var_dump($db);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
@ -103,11 +103,11 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town']))
|
|||||||
|
|
||||||
$row_array['label'] = $row['zip'].' '.$row['town'];
|
$row_array['label'] = $row['zip'].' '.$row['town'];
|
||||||
$row_array['label'] .= ($county || $country)?' (':'';
|
$row_array['label'] .= ($county || $country)?' (':'';
|
||||||
$row_array['label'] .= $county;
|
$row_array['label'] .= $county;
|
||||||
$row_array['label'] .= ($county && $country?' - ':'');
|
$row_array['label'] .= ($county && $country?' - ':'');
|
||||||
$row_array['label'] .= $country;
|
$row_array['label'] .= $country;
|
||||||
$row_array['label'] .= ($county || $country)?')':'';
|
$row_array['label'] .= ($county || $country)?')':'';
|
||||||
if ($zipcode)
|
if ($zipcode)
|
||||||
{
|
{
|
||||||
$row_array['value'] = $row['zip'];
|
$row_array['value'] = $row['zip'];
|
||||||
$row_array['town'] = $row['town'];
|
$row_array['town'] = $row['town'];
|
||||||
|
|||||||
@ -43,7 +43,7 @@ $number = strlen($letters);
|
|||||||
$string = '';
|
$string = '';
|
||||||
for($i = 0; $i < $length; $i++)
|
for($i = 0; $i < $length; $i++)
|
||||||
{
|
{
|
||||||
$string .= $letters{mt_rand(0, $number - 1)};
|
$string .= $letters{mt_rand(0, $number - 1)};
|
||||||
}
|
}
|
||||||
//print $string;
|
//print $string;
|
||||||
|
|
||||||
@ -54,8 +54,8 @@ $_SESSION[$sessionkey]=$string;
|
|||||||
$img = imagecreate(80, 32);
|
$img = imagecreate(80, 32);
|
||||||
if (empty($img))
|
if (empty($img))
|
||||||
{
|
{
|
||||||
dol_print_error('', "Problem with GD creation");
|
dol_print_error('', "Problem with GD creation");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define mime type
|
// Define mime type
|
||||||
|
|||||||
@ -50,13 +50,13 @@ abstract class CommonObjectLine extends CommonObject
|
|||||||
public $fk_unit;
|
public $fk_unit;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the translation key from units dictionary.
|
* Returns the translation key from units dictionary.
|
||||||
* A langs->trans() must be called on result to get translated value.
|
* A langs->trans() must be called on result to get translated value.
|
||||||
*
|
*
|
||||||
* @param string $type Label type (long or short)
|
* @param string $type Label type (long or short)
|
||||||
* @return string|int <0 if ko, label if ok
|
* @return string|int <0 if ko, label if ok
|
||||||
*/
|
*/
|
||||||
public function getLabelOfUnit($type = 'long')
|
public function getLabelOfUnit($type = 'long')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|||||||
@ -67,18 +67,18 @@ else
|
|||||||
|
|
||||||
// Define tradMonths javascript array (we define this in datapicker AND in parent page to avoid errors with IE8)
|
// Define tradMonths javascript array (we define this in datapicker AND in parent page to avoid errors with IE8)
|
||||||
$tradTemp=array(
|
$tradTemp=array(
|
||||||
$langs->trans("January"),
|
$langs->trans("January"),
|
||||||
$langs->trans("February"),
|
$langs->trans("February"),
|
||||||
$langs->trans("March"),
|
$langs->trans("March"),
|
||||||
$langs->trans("April"),
|
$langs->trans("April"),
|
||||||
$langs->trans("May"),
|
$langs->trans("May"),
|
||||||
$langs->trans("June"),
|
$langs->trans("June"),
|
||||||
$langs->trans("July"),
|
$langs->trans("July"),
|
||||||
$langs->trans("August"),
|
$langs->trans("August"),
|
||||||
$langs->trans("September"),
|
$langs->trans("September"),
|
||||||
$langs->trans("October"),
|
$langs->trans("October"),
|
||||||
$langs->trans("November"),
|
$langs->trans("November"),
|
||||||
$langs->trans("December")
|
$langs->trans("December")
|
||||||
);
|
);
|
||||||
print '<script type="text/javascript">';
|
print '<script type="text/javascript">';
|
||||||
print 'var tradMonths = [';
|
print 'var tradMonths = [';
|
||||||
@ -236,8 +236,8 @@ function displayBox($selectedDate, $month, $year)
|
|||||||
|
|
||||||
if ($langs->trans("FormatDateShortJavaInput")=="FormatDateShortJavaInput")
|
if ($langs->trans("FormatDateShortJavaInput")=="FormatDateShortJavaInput")
|
||||||
{
|
{
|
||||||
print "ERROR FormatDateShortJavaInput not defined for language ".$langs->defaultlang;
|
print "ERROR FormatDateShortJavaInput not defined for language ".$langs->defaultlang;
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sur click dans calendrier, appelle fonction dpClickDay
|
// Sur click dans calendrier, appelle fonction dpClickDay
|
||||||
|
|||||||
@ -57,7 +57,7 @@ if (! IsAllowedCommand($sCommand))
|
|||||||
|
|
||||||
// Check if it is an allowed type.
|
// Check if it is an allowed type.
|
||||||
if (! IsAllowedType($sType))
|
if (! IsAllowedType($sType))
|
||||||
SendUploadResults(1, '', '', 'Invalid type specified');
|
SendUploadResults(1, '', '', 'Invalid type specified');
|
||||||
|
|
||||||
|
|
||||||
// @CHANGE
|
// @CHANGE
|
||||||
|
|||||||
@ -209,24 +209,24 @@ function IsImageValid($filePath, $extension)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$imageCheckExtensions = array(
|
$imageCheckExtensions = array(
|
||||||
'gif',
|
'gif',
|
||||||
'jpeg',
|
'jpeg',
|
||||||
'jpg',
|
'jpg',
|
||||||
'png',
|
'png',
|
||||||
'swf',
|
'swf',
|
||||||
'psd',
|
'psd',
|
||||||
'bmp',
|
'bmp',
|
||||||
'iff',
|
'iff',
|
||||||
'tiff',
|
'tiff',
|
||||||
'tif',
|
'tif',
|
||||||
'swc',
|
'swc',
|
||||||
'jpc',
|
'jpc',
|
||||||
'jp2',
|
'jp2',
|
||||||
'jpx',
|
'jpx',
|
||||||
'jb2',
|
'jb2',
|
||||||
'xbm',
|
'xbm',
|
||||||
'wbmp'
|
'wbmp'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!in_array($extension, $imageCheckExtensions) ) {
|
if (!in_array($extension, $imageCheckExtensions) ) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -74,10 +74,10 @@ if (! ($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/' || $_SERVER['H
|
|||||||
if (arr.length > 0) {
|
if (arr.length > 0) {
|
||||||
var audio = null;
|
var audio = null;
|
||||||
<?php
|
<?php
|
||||||
if (! empty($conf->global->AGENDA_REMINDER_BROWSER_SOUND)) {
|
if (! empty($conf->global->AGENDA_REMINDER_BROWSER_SOUND)) {
|
||||||
print 'audio = new Audio(\''.DOL_URL_ROOT.'/theme/common/sound/notification_agenda.wav'.'\');';
|
print 'audio = new Audio(\''.DOL_URL_ROOT.'/theme/common/sound/notification_agenda.wav'.'\');';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
$.each(arr, function (index, value) {
|
$.each(arr, function (index, value) {
|
||||||
var url="notdefined";
|
var url="notdefined";
|
||||||
|
|||||||
@ -34,7 +34,7 @@ function categories_prepare_head($object, $type)
|
|||||||
global $langs, $conf, $user;
|
global $langs, $conf, $user;
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('categories', 'products'));
|
$langs->loadLangs(array('categories', 'products'));
|
||||||
|
|
||||||
$h = 0;
|
$h = 0;
|
||||||
$head = array();
|
$head = array();
|
||||||
@ -51,19 +51,19 @@ function categories_prepare_head($object, $type)
|
|||||||
|
|
||||||
if (! empty($conf->global->MAIN_MULTILANGS))
|
if (! empty($conf->global->MAIN_MULTILANGS))
|
||||||
{
|
{
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/categories/traduction.php?id='.$object->id.'&type='.$type;
|
$head[$h][0] = DOL_URL_ROOT.'/categories/traduction.php?id='.$object->id.'&type='.$type;
|
||||||
$head[$h][1] = $langs->trans("Translation");
|
$head[$h][1] = $langs->trans("Translation");
|
||||||
$head[$h][2] = 'translation';
|
$head[$h][2] = 'translation';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show more tabs from modules
|
// Show more tabs from modules
|
||||||
// Entries must be declared in modules descriptor with line
|
// Entries must be declared in modules descriptor with line
|
||||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'categories_'.$type);
|
complete_head_from_modules($conf, $langs, $object, $head, $h, 'categories_'.$type);
|
||||||
|
|
||||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'categories_'.$type, 'remove');
|
complete_head_from_modules($conf, $langs, $object, $head, $h, 'categories_'.$type, 'remove');
|
||||||
|
|
||||||
return $head;
|
return $head;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -78,12 +78,12 @@ function doc_getlinedesc($line, $outputlangs, $hideref = 0, $hidedesc = 0, $issu
|
|||||||
}
|
}
|
||||||
elseif ($desc == '(DEPOSIT)' && $line->fk_remise_except)
|
elseif ($desc == '(DEPOSIT)' && $line->fk_remise_except)
|
||||||
{
|
{
|
||||||
$discount=new DiscountAbsolute($db);
|
$discount=new DiscountAbsolute($db);
|
||||||
$discount->fetch($line->fk_remise_except);
|
$discount->fetch($line->fk_remise_except);
|
||||||
$sourceref=!empty($discount->discount_type)?$discount->ref_invoive_supplier_source:$discount->ref_facture_source;
|
$sourceref=!empty($discount->discount_type)?$discount->ref_invoive_supplier_source:$discount->ref_facture_source;
|
||||||
$libelleproduitservice=$outputlangs->transnoentitiesnoconv("DiscountFromDeposit", $sourceref);
|
$libelleproduitservice=$outputlangs->transnoentitiesnoconv("DiscountFromDeposit", $sourceref);
|
||||||
// Add date of deposit
|
// Add date of deposit
|
||||||
if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) $libelleproduitservice.=' ('.dol_print_date($discount->datec, 'day', '', $outputlangs).')';
|
if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) $libelleproduitservice.=' ('.dol_print_date($discount->datec, 'day', '', $outputlangs).')';
|
||||||
}
|
}
|
||||||
elseif ($desc == '(EXCESS RECEIVED)' && $line->fk_remise_except)
|
elseif ($desc == '(EXCESS RECEIVED)' && $line->fk_remise_except)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -36,8 +36,8 @@ function ecm_prepare_dasboard_head($object)
|
|||||||
|
|
||||||
$h = 0;
|
$h = 0;
|
||||||
$head = array();
|
$head = array();
|
||||||
$helptext =$langs->trans("ECMAreaDesc").'<br>';
|
$helptext =$langs->trans("ECMAreaDesc").'<br>';
|
||||||
$helptext.=$langs->trans("ECMAreaDesc2");
|
$helptext.=$langs->trans("ECMAreaDesc2");
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/ecm/index.php';
|
$head[$h][0] = DOL_URL_ROOT.'/ecm/index.php';
|
||||||
$head[$h][1] = $langs->trans("ECMSectionsManual").$form->textwithpicto('', $helptext, 1, 'info', '', 0, 3);
|
$head[$h][1] = $langs->trans("ECMSectionsManual").$form->textwithpicto('', $helptext, 1, 'info', '', 0, 3);
|
||||||
@ -52,13 +52,13 @@ function ecm_prepare_dasboard_head($object)
|
|||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show more tabs from modules
|
// Show more tabs from modules
|
||||||
// Entries must be declared in modules descriptor with line
|
// Entries must be declared in modules descriptor with line
|
||||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||||
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
|
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
|
||||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'ecm');
|
complete_head_from_modules($conf, $langs, $object, $head, $h, 'ecm');
|
||||||
|
|
||||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'ecm', 'remove');
|
complete_head_from_modules($conf, $langs, $object, $head, $h, 'ecm', 'remove');
|
||||||
|
|
||||||
return $head;
|
return $head;
|
||||||
}
|
}
|
||||||
@ -104,16 +104,16 @@ function ecm_prepare_head($object, $module = 'ecm', $section = '')
|
|||||||
*/
|
*/
|
||||||
function ecm_file_prepare_head($object)
|
function ecm_file_prepare_head($object)
|
||||||
{
|
{
|
||||||
global $langs, $conf, $user;
|
global $langs, $conf, $user;
|
||||||
$h = 0;
|
$h = 0;
|
||||||
$head = array();
|
$head = array();
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/ecm/file_card.php?section='.$object->section_id.'&urlfile='.urlencode($object->label);
|
$head[$h][0] = DOL_URL_ROOT.'/ecm/file_card.php?section='.$object->section_id.'&urlfile='.urlencode($object->label);
|
||||||
$head[$h][1] = $langs->trans("Card");
|
$head[$h][1] = $langs->trans("Card");
|
||||||
$head[$h][2] = 'card';
|
$head[$h][2] = 'card';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
return $head;
|
return $head;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -43,11 +43,11 @@ function import_prepare_head($param, $maxstep = 0)
|
|||||||
$i=1;
|
$i=1;
|
||||||
while($i <= $maxstep)
|
while($i <= $maxstep)
|
||||||
{
|
{
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step='.$i.$param;
|
$head[$h][0] = DOL_URL_ROOT.'/imports/import.php?step='.$i.$param;
|
||||||
$head[$h][1] = $langs->trans("Step")." ".$i;
|
$head[$h][1] = $langs->trans("Step")." ".$i;
|
||||||
$head[$h][2] = 'step'.$i;
|
$head[$h][2] = 'step'.$i;
|
||||||
$h++;
|
$h++;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $head;
|
return $head;
|
||||||
|
|||||||
@ -97,33 +97,33 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte
|
|||||||
}
|
}
|
||||||
if (in_array('nodeposit', $filter))
|
if (in_array('nodeposit', $filter))
|
||||||
{
|
{
|
||||||
if (empty($sqlwhere)) $sqlwhere=' WHERE ';
|
if (empty($sqlwhere)) $sqlwhere=' WHERE ';
|
||||||
else $sqlwhere.=" AND";
|
else $sqlwhere.=" AND";
|
||||||
$sqlwhere.=' type <> 3';
|
$sqlwhere.=' type <> 3';
|
||||||
}
|
}
|
||||||
if (in_array('noreplacement', $filter))
|
if (in_array('noreplacement', $filter))
|
||||||
{
|
{
|
||||||
if (empty($sqlwhere)) $sqlwhere=' WHERE ';
|
if (empty($sqlwhere)) $sqlwhere=' WHERE ';
|
||||||
else $sqlwhere.=" AND";
|
else $sqlwhere.=" AND";
|
||||||
$sqlwhere.=' type <> 1';
|
$sqlwhere.=' type <> 1';
|
||||||
}
|
}
|
||||||
if (in_array('nocreditnote', $filter))
|
if (in_array('nocreditnote', $filter))
|
||||||
{
|
{
|
||||||
if (empty($sqlwhere)) $sqlwhere=' WHERE ';
|
if (empty($sqlwhere)) $sqlwhere=' WHERE ';
|
||||||
else $sqlwhere.=" AND";
|
else $sqlwhere.=" AND";
|
||||||
$sqlwhere.=' type <> 2';
|
$sqlwhere.=' type <> 2';
|
||||||
}
|
}
|
||||||
if (in_array('excludethirdparties', $filter) && is_array($thirdpartiesid))
|
if (in_array('excludethirdparties', $filter) && is_array($thirdpartiesid))
|
||||||
{
|
{
|
||||||
if (empty($sqlwhere)) $sqlwhere=' WHERE ';
|
if (empty($sqlwhere)) $sqlwhere=' WHERE ';
|
||||||
else $sqlwhere.=" AND";
|
else $sqlwhere.=" AND";
|
||||||
$sqlwhere.=' f.fk_soc NOT IN ('.join(',', $thirdpartiesid).')';
|
$sqlwhere.=' f.fk_soc NOT IN ('.join(',', $thirdpartiesid).')';
|
||||||
}
|
}
|
||||||
if (in_array('onlythirdparties', $filter) && is_array($thirdpartiesid))
|
if (in_array('onlythirdparties', $filter) && is_array($thirdpartiesid))
|
||||||
{
|
{
|
||||||
if (empty($sqlwhere)) $sqlwhere=' WHERE ';
|
if (empty($sqlwhere)) $sqlwhere=' WHERE ';
|
||||||
else $sqlwhere.=" AND";
|
else $sqlwhere.=" AND";
|
||||||
$sqlwhere.=' f.fk_soc IN ('.join(',', $thirdpartiesid).')';
|
$sqlwhere.=' f.fk_soc IN ('.join(',', $thirdpartiesid).')';
|
||||||
}
|
}
|
||||||
if ($sqlwhere) $sql.=$sqlwhere;
|
if ($sqlwhere) $sql.=$sqlwhere;
|
||||||
if ($sqlorder) $sql.=$sqlorder;
|
if ($sqlorder) $sql.=$sqlorder;
|
||||||
@ -143,20 +143,20 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte
|
|||||||
dol_syslog("scripts/invoices/rebuild_merge.php", LOG_DEBUG);
|
dol_syslog("scripts/invoices/rebuild_merge.php", LOG_DEBUG);
|
||||||
if ( $resql=$db->query($sql) )
|
if ( $resql=$db->query($sql) )
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$cpt = 0;
|
$cpt = 0;
|
||||||
$oldemail = '';
|
$oldemail = '';
|
||||||
$message = '';
|
$message = '';
|
||||||
$total = '';
|
$total = '';
|
||||||
|
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
// First loop on each resultset to build PDF
|
// First loop on each resultset to build PDF
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
|
|
||||||
while ($cpt < $num)
|
while ($cpt < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
$fac = new Facture($db);
|
$fac = new Facture($db);
|
||||||
$result=$fac->fetch($obj->rowid);
|
$result=$fac->fetch($obj->rowid);
|
||||||
@ -174,11 +174,11 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte
|
|||||||
$filename=$conf->facture->dir_output.'/'.$fac->ref.'/'.$fac->ref.'.pdf';
|
$filename=$conf->facture->dir_output.'/'.$fac->ref.'/'.$fac->ref.'.pdf';
|
||||||
if ($regenerate || ! dol_is_file($filename))
|
if ($regenerate || ! dol_is_file($filename))
|
||||||
{
|
{
|
||||||
if ($usestdout) print "Build PDF for invoice ".$obj->ref." - Lang = ".$outputlangs->defaultlang."\n";
|
if ($usestdout) print "Build PDF for invoice ".$obj->ref." - Lang = ".$outputlangs->defaultlang."\n";
|
||||||
$result= $fac->generateDocument($regenerate?$regenerate:$fac->modelpdf, $outputlangs);
|
$result= $fac->generateDocument($regenerate?$regenerate:$fac->modelpdf, $outputlangs);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ($usestdout) print "PDF for invoice ".$obj->ref." already exists\n";
|
if ($usestdout) print "PDF for invoice ".$obj->ref." already exists\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add file into files array
|
// Add file into files array
|
||||||
@ -192,50 +192,50 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte
|
|||||||
else dol_syslog("Failed to build PDF for invoice ".($fac->ref?$fac->ref:' id '.$obj->rowid), LOG_ERR);
|
else dol_syslog("Failed to build PDF for invoice ".($fac->ref?$fac->ref:' id '.$obj->rowid), LOG_ERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
$cpt++;
|
$cpt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Define format of output PDF
|
// Define format of output PDF
|
||||||
$formatarray=pdf_getFormat($langs);
|
$formatarray=pdf_getFormat($langs);
|
||||||
$page_largeur = $formatarray['width'];
|
$page_largeur = $formatarray['width'];
|
||||||
$page_hauteur = $formatarray['height'];
|
$page_hauteur = $formatarray['height'];
|
||||||
$format = array($page_largeur,$page_hauteur);
|
$format = array($page_largeur,$page_hauteur);
|
||||||
|
|
||||||
if ($usestdout) print "Using output PDF format ".join('x', $format)."\n";
|
if ($usestdout) print "Using output PDF format ".join('x', $format)."\n";
|
||||||
else dol_syslog("Using output PDF format ".join('x', $format), LOG_ERR);
|
else dol_syslog("Using output PDF format ".join('x', $format), LOG_ERR);
|
||||||
|
|
||||||
|
|
||||||
// Now, build a merged files with all files in $files array
|
// Now, build a merged files with all files in $files array
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
|
|
||||||
// Create empty PDF
|
// Create empty PDF
|
||||||
$pdf=pdf_getInstance($format);
|
$pdf=pdf_getInstance($format);
|
||||||
if (class_exists('TCPDF'))
|
if (class_exists('TCPDF'))
|
||||||
{
|
{
|
||||||
$pdf->setPrintHeader(false);
|
$pdf->setPrintHeader(false);
|
||||||
$pdf->setPrintFooter(false);
|
$pdf->setPrintFooter(false);
|
||||||
}
|
}
|
||||||
$pdf->SetFont(pdf_getPDFFont($langs));
|
$pdf->SetFont(pdf_getPDFFont($langs));
|
||||||
|
|
||||||
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
|
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
|
||||||
//$pdf->SetCompression(false);
|
//$pdf->SetCompression(false);
|
||||||
|
|
||||||
// Add all others
|
// Add all others
|
||||||
foreach($files as $file)
|
foreach($files as $file)
|
||||||
{
|
{
|
||||||
if ($usestdout) print "Merge PDF file for invoice ".$file."\n";
|
if ($usestdout) print "Merge PDF file for invoice ".$file."\n";
|
||||||
else dol_syslog("Merge PDF file for invoice ".$file);
|
else dol_syslog("Merge PDF file for invoice ".$file);
|
||||||
|
|
||||||
// Charge un document PDF depuis un fichier.
|
// Charge un document PDF depuis un fichier.
|
||||||
$pagecount = $pdf->setSourceFile($file);
|
$pagecount = $pdf->setSourceFile($file);
|
||||||
for ($i = 1; $i <= $pagecount; $i++)
|
for ($i = 1; $i <= $pagecount; $i++)
|
||||||
{
|
{
|
||||||
$tplidx = $pdf->importPage($i);
|
$tplidx = $pdf->importPage($i);
|
||||||
$s = $pdf->getTemplatesize($tplidx);
|
$s = $pdf->getTemplatesize($tplidx);
|
||||||
$pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L');
|
$pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L');
|
||||||
$pdf->useTemplate($tplidx);
|
$pdf->useTemplate($tplidx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create output dir if not exists
|
// Create output dir if not exists
|
||||||
@ -261,19 +261,19 @@ function rebuild_merge_pdf($db, $langs, $conf, $diroutputpdf, $newlangid, $filte
|
|||||||
}
|
}
|
||||||
|
|
||||||
$result = 1;
|
$result = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($usestdout) print "No invoices found for criteria.\n";
|
if ($usestdout) print "No invoices found for criteria.\n";
|
||||||
else dol_syslog("No invoices found for criteria");
|
else dol_syslog("No invoices found for criteria");
|
||||||
$result = 0;
|
$result = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
dol_syslog("scripts/invoices/rebuild_merge.php: Error");
|
dol_syslog("scripts/invoices/rebuild_merge.php: Error");
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($error) return -1;
|
if ($error) return -1;
|
||||||
|
|||||||
@ -28,18 +28,18 @@
|
|||||||
*/
|
*/
|
||||||
function mailmanspip_admin_prepare_head()
|
function mailmanspip_admin_prepare_head()
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
array(
|
array(
|
||||||
DOL_URL_ROOT.'/admin/mailman.php',
|
DOL_URL_ROOT.'/admin/mailman.php',
|
||||||
$langs->trans('Mailman'),
|
$langs->trans('Mailman'),
|
||||||
'mailman'
|
'mailman'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
DOL_URL_ROOT.'/admin/spip.php',
|
DOL_URL_ROOT.'/admin/spip.php',
|
||||||
$langs->trans('SPIP'),
|
$langs->trans('SPIP'),
|
||||||
'spip'
|
'spip'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -59,15 +59,15 @@ function prelevement_prepare_head(BonPrelevement $object)
|
|||||||
$head[$h][2] = 'statistics';
|
$head[$h][2] = 'statistics';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
// Show more tabs from modules
|
// Show more tabs from modules
|
||||||
// Entries must be declared in modules descriptor with line
|
// Entries must be declared in modules descriptor with line
|
||||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'prelevement');
|
complete_head_from_modules($conf, $langs, $object, $head, $h, 'prelevement');
|
||||||
|
|
||||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'prelevement', 'remove');
|
complete_head_from_modules($conf, $langs, $object, $head, $h, 'prelevement', 'remove');
|
||||||
|
|
||||||
return $head;
|
return $head;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -80,6 +80,6 @@ function prelevement_check_config()
|
|||||||
global $conf;
|
global $conf;
|
||||||
if(empty($conf->global->PRELEVEMENT_ID_BANKACCOUNT)) return -1;
|
if(empty($conf->global->PRELEVEMENT_ID_BANKACCOUNT)) return -1;
|
||||||
if(empty($conf->global->PRELEVEMENT_ICS)) return -1;
|
if(empty($conf->global->PRELEVEMENT_ICS)) return -1;
|
||||||
if(empty($conf->global->PRELEVEMENT_USER)) return -1;
|
if(empty($conf->global->PRELEVEMENT_USER)) return -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,39 +32,39 @@
|
|||||||
*/
|
*/
|
||||||
function receiptprinteradmin_prepare_head($mode)
|
function receiptprinteradmin_prepare_head($mode)
|
||||||
{
|
{
|
||||||
global $langs, $conf;
|
global $langs, $conf;
|
||||||
|
|
||||||
$h = 0;
|
$h = 0;
|
||||||
$head = array();
|
$head = array();
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/admin/receiptprinter.php?mode=config";
|
$head[$h][0] = DOL_URL_ROOT."/admin/receiptprinter.php?mode=config";
|
||||||
$head[$h][1] = $langs->trans("ListPrinters");
|
$head[$h][1] = $langs->trans("ListPrinters");
|
||||||
$head[$h][2] = 'config';
|
$head[$h][2] = 'config';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/admin/receiptprinter.php?mode=template";
|
$head[$h][0] = DOL_URL_ROOT."/admin/receiptprinter.php?mode=template";
|
||||||
$head[$h][1] = $langs->trans("SetupReceiptTemplate");
|
$head[$h][1] = $langs->trans("SetupReceiptTemplate");
|
||||||
$head[$h][2] = 'template';
|
$head[$h][2] = 'template';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
if ($mode == 'test')
|
if ($mode == 'test')
|
||||||
{
|
{
|
||||||
$head[$h][0] = DOL_URL_ROOT."/admin/receiptprinter.php?mode=test";
|
$head[$h][0] = DOL_URL_ROOT."/admin/receiptprinter.php?mode=test";
|
||||||
$head[$h][1] = $langs->trans("TargetedPrinter");
|
$head[$h][1] = $langs->trans("TargetedPrinter");
|
||||||
$head[$h][2] = 'test';
|
$head[$h][2] = 'test';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//$object=new stdClass();
|
//$object=new stdClass();
|
||||||
|
|
||||||
// Show more tabs from modules
|
// Show more tabs from modules
|
||||||
// Entries must be declared in modules descriptor with line
|
// Entries must be declared in modules descriptor with line
|
||||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||||
//complete_head_from_modules($conf,$langs,$object,$head,$h,'printingadmin');
|
//complete_head_from_modules($conf,$langs,$object,$head,$h,'printingadmin');
|
||||||
|
|
||||||
//complete_head_from_modules($conf,$langs,$object,$head,$h,'printing','remove');
|
//complete_head_from_modules($conf,$langs,$object,$head,$h,'printing','remove');
|
||||||
|
|
||||||
return $head;
|
return $head;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,8 +41,8 @@ function trip_prepare_head(Deplacement $object)
|
|||||||
|
|
||||||
// Show more tabs from modules
|
// Show more tabs from modules
|
||||||
// Entries must be declared in modules descriptor with line
|
// Entries must be declared in modules descriptor with line
|
||||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'trip');
|
complete_head_from_modules($conf, $langs, $object, $head, $h, 'trip');
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/deplacement/document.php?id='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/compta/deplacement/document.php?id='.$object->id;
|
||||||
|
|||||||
@ -38,9 +38,9 @@ class modDav extends DolibarrModules
|
|||||||
*/
|
*/
|
||||||
public function __construct($db)
|
public function __construct($db)
|
||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
|
||||||
// Id for module (must be unique).
|
// Id for module (must be unique).
|
||||||
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
|
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
|
||||||
@ -116,13 +116,13 @@ class modDav extends DolibarrModules
|
|||||||
|
|
||||||
|
|
||||||
// Array to add new pages in new tabs
|
// Array to add new pages in new tabs
|
||||||
$this->tabs = array();
|
$this->tabs = array();
|
||||||
// Example:
|
// Example:
|
||||||
// $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@dav:$user->rights->dav->read:/dav/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1
|
// $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@dav:$user->rights->dav->read:/dav/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1
|
||||||
// $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@dav:$user->rights->othermodule->read:/dav/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:+tabname2:SUBSTITUTION_Title2:mylangfile@dav:$user->rights->othermodule->read:/dav/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
|
// $this->tabs[] = array('data'=>'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname
|
||||||
//
|
//
|
||||||
// Where objecttype can be
|
// 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)
|
// '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
|
// 'contact' to add a tab in contact view
|
||||||
// 'contract' to add a tab in contract view
|
// 'contract' to add a tab in contract view
|
||||||
@ -144,9 +144,9 @@ class modDav extends DolibarrModules
|
|||||||
// 'user' to add a tab in user view
|
// 'user' to add a tab in user view
|
||||||
|
|
||||||
|
|
||||||
// Dictionaries
|
// Dictionaries
|
||||||
$this->dictionaries=array();
|
$this->dictionaries=array();
|
||||||
/* Example:
|
/* Example:
|
||||||
$this->dictionaries=array(
|
$this->dictionaries=array(
|
||||||
'langs'=>'mylangfile@dav',
|
'langs'=>'mylangfile@dav',
|
||||||
'tabname'=>array(MAIN_DB_PREFIX."table1",MAIN_DB_PREFIX."table2",MAIN_DB_PREFIX."table3"), // List of tables we want to see into dictonnary editor
|
'tabname'=>array(MAIN_DB_PREFIX."table1",MAIN_DB_PREFIX."table2",MAIN_DB_PREFIX."table3"), // List of tables we want to see into dictonnary editor
|
||||||
@ -162,13 +162,13 @@ class modDav extends DolibarrModules
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
// Boxes/Widgets
|
// Boxes/Widgets
|
||||||
// Add here list of php file(s) stored in dav/core/boxes that contains class to show a widget.
|
// Add here list of php file(s) stored in dav/core/boxes that contains class to show a widget.
|
||||||
$this->boxes = array(
|
$this->boxes = array(
|
||||||
//0=>array('file'=>'davwidget1.php@dav','note'=>'Widget provided by dav','enabledbydefaulton'=>'Home'),
|
//0=>array('file'=>'davwidget1.php@dav','note'=>'Widget provided by dav','enabledbydefaulton'=>'Home'),
|
||||||
//1=>array('file'=>'davwidget2.php@dav','note'=>'Widget provided by dav'),
|
//1=>array('file'=>'davwidget2.php@dav','note'=>'Widget provided by dav'),
|
||||||
//2=>array('file'=>'davwidget3.php@dav','note'=>'Widget provided by dav')
|
//2=>array('file'=>'davwidget3.php@dav','note'=>'Widget provided by dav')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// Cronjobs (List of cron jobs entries to add when module is enabled)
|
// Cronjobs (List of cron jobs entries to add when module is enabled)
|
||||||
@ -262,7 +262,7 @@ class modDav extends DolibarrModules
|
|||||||
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
|
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
|
||||||
* It also creates data directories
|
* It also creates data directories
|
||||||
*
|
*
|
||||||
* @param string $options Options when enabling module ('', 'noboxes')
|
* @param string $options Options when enabling module ('', 'noboxes')
|
||||||
* @return int 1 if OK, 0 if KO
|
* @return int 1 if OK, 0 if KO
|
||||||
*/
|
*/
|
||||||
public function init($options = '')
|
public function init($options = '')
|
||||||
|
|||||||
@ -45,7 +45,7 @@ class modExport extends DolibarrModules
|
|||||||
|
|
||||||
$this->family = "technic";
|
$this->family = "technic";
|
||||||
$this->module_position = '72';
|
$this->module_position = '72';
|
||||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
||||||
$this->description = "Outils d'exports de donnees Dolibarr (via un assistant)";
|
$this->description = "Outils d'exports de donnees Dolibarr (via un assistant)";
|
||||||
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
|
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
|
||||||
|
|||||||
@ -51,7 +51,7 @@ class modHRM extends DolibarrModules
|
|||||||
$this->version = 'development';
|
$this->version = 'development';
|
||||||
|
|
||||||
$this->const_name = 'MAIN_MODULE_' . strtoupper($this->name);
|
$this->const_name = 'MAIN_MODULE_' . strtoupper($this->name);
|
||||||
// Name of image file used for this module.
|
// 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 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'
|
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
|
||||||
$this->picto='generic';
|
$this->picto='generic';
|
||||||
|
|||||||
@ -44,8 +44,8 @@ class modImport extends DolibarrModules
|
|||||||
$this->numero = 250;
|
$this->numero = 250;
|
||||||
|
|
||||||
$this->family = "technic";
|
$this->family = "technic";
|
||||||
$this->module_position = '70';
|
$this->module_position = '70';
|
||||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
||||||
$this->description = "Outils d'imports de donnees Dolibarr (via un assistant)";
|
$this->description = "Outils d'imports de donnees Dolibarr (via un assistant)";
|
||||||
// Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
|
// Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
|
||||||
|
|||||||
@ -105,17 +105,17 @@ class modMargin extends DolibarrModules
|
|||||||
// left menu entry
|
// left menu entry
|
||||||
$this->menu[$r]=array(
|
$this->menu[$r]=array(
|
||||||
'fk_menu'=>'fk_mainmenu=billing', // Put 0 if this is a top menu
|
'fk_menu'=>'fk_mainmenu=billing', // Put 0 if this is a top menu
|
||||||
'type'=>'left', // This is a Top menu entry
|
'type'=>'left', // This is a Top menu entry
|
||||||
'titre'=>'Margins',
|
'titre'=>'Margins',
|
||||||
'mainmenu'=>'billing',
|
'mainmenu'=>'billing',
|
||||||
'leftmenu'=>'margins',
|
'leftmenu'=>'margins',
|
||||||
'url'=>'/margin/index.php',
|
'url'=>'/margin/index.php',
|
||||||
'langs'=>'margins', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
'langs'=>'margins', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||||
'position'=>100,
|
'position'=>100,
|
||||||
'enabled'=>'$conf->margin->enabled', // Define condition to show or hide menu entry. Use '$conf->monmodule->enabled' if entry must be visible if module is enabled.
|
'enabled'=>'$conf->margin->enabled', // Define condition to show or hide menu entry. Use '$conf->monmodule->enabled' if entry must be visible if module is enabled.
|
||||||
'perms'=>'$user->rights->margins->liretous', // Use 'perms'=>'$user->rights->monmodule->level1->level2' if you want your menu with a permission rules
|
'perms'=>'$user->rights->margins->liretous', // Use 'perms'=>'$user->rights->monmodule->level1->level2' if you want your menu with a permission rules
|
||||||
'target'=>'',
|
'target'=>'',
|
||||||
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||||
$r++;
|
$r++;
|
||||||
|
|
||||||
// Permissions
|
// Permissions
|
||||||
|
|||||||
@ -65,9 +65,9 @@ $storage = new DoliStorage($db, $conf);
|
|||||||
|
|
||||||
// Setup the credentials for the requests
|
// Setup the credentials for the requests
|
||||||
$credentials = new Credentials(
|
$credentials = new Credentials(
|
||||||
$conf->global->OAUTH_STRIPE_TEST_ID,
|
$conf->global->OAUTH_STRIPE_TEST_ID,
|
||||||
$conf->global->STRIPE_TEST_SECRET_KEY,
|
$conf->global->STRIPE_TEST_SECRET_KEY,
|
||||||
$currentUri->getAbsoluteUri()
|
$currentUri->getAbsoluteUri()
|
||||||
);
|
);
|
||||||
|
|
||||||
$requestedpermissionsarray=array();
|
$requestedpermissionsarray=array();
|
||||||
@ -99,12 +99,12 @@ $langs->load("oauth");
|
|||||||
|
|
||||||
if ($action == 'delete')
|
if ($action == 'delete')
|
||||||
{
|
{
|
||||||
$storage->clearToken('StripeTest');
|
$storage->clearToken('StripeTest');
|
||||||
|
|
||||||
setEventMessages($langs->trans('TokenDeleted'), null, 'mesgs');
|
setEventMessages($langs->trans('TokenDeleted'), null, 'mesgs');
|
||||||
|
|
||||||
header('Location: ' . $backtourl);
|
header('Location: ' . $backtourl);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($_GET['code'])) // We are coming from oauth provider page
|
if (! empty($_GET['code'])) // We are coming from oauth provider page
|
||||||
@ -113,60 +113,60 @@ if (! empty($_GET['code'])) // We are coming from oauth provider page
|
|||||||
//$_GET=array('code' => string 'aaaaaaaaaaaaaa' (length=20), 'state' => string 'user,public_repo' (length=16))
|
//$_GET=array('code' => string 'aaaaaaaaaaaaaa' (length=20), 'state' => string 'user,public_repo' (length=16))
|
||||||
|
|
||||||
dol_syslog("We are coming from the oauth provider page");
|
dol_syslog("We are coming from the oauth provider page");
|
||||||
//llxHeader('',$langs->trans("OAuthSetup"));
|
//llxHeader('',$langs->trans("OAuthSetup"));
|
||||||
|
|
||||||
//$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
//$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
//print load_fiche_titre($langs->trans("OAuthSetup"),$linkback,'title_setup');
|
//print load_fiche_titre($langs->trans("OAuthSetup"),$linkback,'title_setup');
|
||||||
|
|
||||||
//dol_fiche_head();
|
//dol_fiche_head();
|
||||||
// retrieve the CSRF state parameter
|
// retrieve the CSRF state parameter
|
||||||
$state = isset($_GET['state']) ? $_GET['state'] : null;
|
$state = isset($_GET['state']) ? $_GET['state'] : null;
|
||||||
//print '<table>';
|
//print '<table>';
|
||||||
|
|
||||||
// This was a callback request from service, get the token
|
// This was a callback request from service, get the token
|
||||||
try {
|
try {
|
||||||
//var_dump($_GET['code']);
|
//var_dump($_GET['code']);
|
||||||
//var_dump($state);
|
//var_dump($state);
|
||||||
//var_dump($apiService); // OAuth\OAuth2\Service\GitHub
|
//var_dump($apiService); // OAuth\OAuth2\Service\GitHub
|
||||||
|
|
||||||
//$token = $apiService->requestAccessToken($_GET['code'], $state);
|
//$token = $apiService->requestAccessToken($_GET['code'], $state);
|
||||||
$token = $apiService->requestAccessToken($_GET['code']);
|
$token = $apiService->requestAccessToken($_GET['code']);
|
||||||
// Github is a service that does not need state to be stored.
|
// Github is a service that does not need state to be stored.
|
||||||
// Into constructor of GitHub, the call
|
// Into constructor of GitHub, the call
|
||||||
// parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri)
|
// parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri)
|
||||||
// has not the ending parameter to true like the Google class constructor.
|
// has not the ending parameter to true like the Google class constructor.
|
||||||
|
|
||||||
setEventMessages($langs->trans('NewTokenStored'), null, 'mesgs'); // Stored into object managed by class DoliStorage so into table oauth_token
|
setEventMessages($langs->trans('NewTokenStored'), null, 'mesgs'); // Stored into object managed by class DoliStorage so into table oauth_token
|
||||||
|
|
||||||
$backtourl = $_SESSION["backtourlsavedbeforeoauthjump"];
|
$backtourl = $_SESSION["backtourlsavedbeforeoauthjump"];
|
||||||
unset($_SESSION["backtourlsavedbeforeoauthjump"]);
|
unset($_SESSION["backtourlsavedbeforeoauthjump"]);
|
||||||
|
|
||||||
header('Location: ' . $backtourl);
|
header('Location: ' . $backtourl);
|
||||||
exit();
|
exit();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
print $e->getMessage();
|
print $e->getMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // If entry on page with no parameter, we arrive here
|
else // If entry on page with no parameter, we arrive here
|
||||||
{
|
{
|
||||||
$_SESSION["backtourlsavedbeforeoauthjump"]=$backtourl;
|
$_SESSION["backtourlsavedbeforeoauthjump"]=$backtourl;
|
||||||
|
|
||||||
// This may create record into oauth_state before the header redirect.
|
// This may create record into oauth_state before the header redirect.
|
||||||
// Creation of record with state in this tables depend on the Provider used (see its constructor).
|
// Creation of record with state in this tables depend on the Provider used (see its constructor).
|
||||||
if (GETPOST('state'))
|
if (GETPOST('state'))
|
||||||
{
|
{
|
||||||
$url = $apiService->getAuthorizationUri(array('state'=>GETPOST('state')));
|
$url = $apiService->getAuthorizationUri(array('state'=>GETPOST('state')));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//$url = $apiService->getAuthorizationUri(); // Parameter state will be randomly generated
|
//$url = $apiService->getAuthorizationUri(); // Parameter state will be randomly generated
|
||||||
//https://connect.stripe.com/oauth/authorize?response_type=code&client_id=ca_AX27ut70tJ1j6eyFCV3ObEXhNOo2jY6V&scope=read_write
|
//https://connect.stripe.com/oauth/authorize?response_type=code&client_id=ca_AX27ut70tJ1j6eyFCV3ObEXhNOo2jY6V&scope=read_write
|
||||||
$url = 'https://connect.stripe.com/oauth/authorize?response_type=code&client_id='.$conf->global->OAUTH_STRIPE_TEST_ID.'&scope=read_write';
|
$url = 'https://connect.stripe.com/oauth/authorize?response_type=code&client_id='.$conf->global->OAUTH_STRIPE_TEST_ID.'&scope=read_write';
|
||||||
}
|
}
|
||||||
|
|
||||||
// we go on oauth provider authorization page
|
// we go on oauth provider authorization page
|
||||||
header('Location: ' . $url);
|
header('Location: ' . $url);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -90,7 +90,7 @@ class LogHandler
|
|||||||
/**
|
/**
|
||||||
* Set current ident.
|
* Set current ident.
|
||||||
*
|
*
|
||||||
* @param int $ident 1=Increase ident of 1, -1=Decrease ident of 1
|
* @param int $ident 1=Increase ident of 1, -1=Decrease ident of 1
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setIdent($ident)
|
public function setIdent($ident)
|
||||||
|
|||||||
@ -125,19 +125,19 @@ if (GETPOST('search_project') != '')
|
|||||||
}
|
}
|
||||||
if (GETPOST('search_task') != '')
|
if (GETPOST('search_task') != '')
|
||||||
{
|
{
|
||||||
header("Location: ".DOL_URL_ROOT.'/projet/tasks/list.php?mode=search&search_all='.urlencode(GETPOST('search_task')));
|
header("Location: ".DOL_URL_ROOT.'/projet/tasks/list.php?mode=search&search_all='.urlencode(GETPOST('search_task')));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST('search_user') != '')
|
if (GETPOST('search_user') != '')
|
||||||
{
|
{
|
||||||
header("Location: ".DOL_URL_ROOT.'/user/list.php?mode=search&sall='.urlencode(GETPOST('search_user')));
|
header("Location: ".DOL_URL_ROOT.'/user/list.php?mode=search&sall='.urlencode(GETPOST('search_user')));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
if (GETPOST('search_group') != '')
|
if (GETPOST('search_group') != '')
|
||||||
{
|
{
|
||||||
header("Location: ".DOL_URL_ROOT.'/user/group/list.php?mode=search&sall='.urlencode(GETPOST('search_group')));
|
header("Location: ".DOL_URL_ROOT.'/user/group/list.php?mode=search&sall='.urlencode(GETPOST('search_group')));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -71,34 +71,34 @@ $searchform = '';
|
|||||||
|
|
||||||
if ($conf->use_javascript_ajax && 1 == 2) // select2 is ko with jmobile
|
if ($conf->use_javascript_ajax && 1 == 2) // select2 is ko with jmobile
|
||||||
{
|
{
|
||||||
if (! is_object($form)) $form=new Form($db);
|
if (! is_object($form)) $form=new Form($db);
|
||||||
$selected=-1;
|
$selected=-1;
|
||||||
$searchform.='<br><br>'.$form->selectArrayAjax('searchselectcombo', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, '', '', 0, 1, 'minwidth300', 1, $langs->trans("Search"), 0);
|
$searchform.='<br><br>'.$form->selectArrayAjax('searchselectcombo', DOL_URL_ROOT.'/core/ajax/selectsearchbox.php', $selected, '', '', 0, 1, 'minwidth300', 1, $langs->trans("Search"), 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$usedbyinclude = 1; // Used into next include
|
$usedbyinclude = 1; // Used into next include
|
||||||
$showtitlebefore = GETPOST('showtitlebefore', 'int');
|
$showtitlebefore = GETPOST('showtitlebefore', 'int');
|
||||||
include DOL_DOCUMENT_ROOT.'/core/ajax/selectsearchbox.php';
|
include DOL_DOCUMENT_ROOT.'/core/ajax/selectsearchbox.php';
|
||||||
|
|
||||||
$i=0;
|
$i=0;
|
||||||
$accesskeyalreadyassigned=array();
|
$accesskeyalreadyassigned=array();
|
||||||
foreach($arrayresult as $key => $val)
|
foreach($arrayresult as $key => $val)
|
||||||
{
|
{
|
||||||
$tmp=explode('?', $val['url']);
|
$tmp=explode('?', $val['url']);
|
||||||
$urlaction=$tmp[0];
|
$urlaction=$tmp[0];
|
||||||
$keysearch='search_all';
|
$keysearch='search_all';
|
||||||
|
|
||||||
$accesskey='';
|
$accesskey='';
|
||||||
if (! $accesskeyalreadyassigned[$val['label'][0]])
|
if (! $accesskeyalreadyassigned[$val['label'][0]])
|
||||||
{
|
{
|
||||||
$accesskey=$val['label'][0];
|
$accesskey=$val['label'][0];
|
||||||
$accesskeyalreadyassigned[$accesskey]=$accesskey;
|
$accesskeyalreadyassigned[$accesskey]=$accesskey;
|
||||||
}
|
}
|
||||||
$searchform.=printSearchForm($urlaction, $urlaction, $val['label'], 'minwidth200', $keysearch, $accesskey, $key, img_picto('', $val['img'], '', 0, 1), $showtitlebefore, ($i>0?0:1));
|
$searchform.=printSearchForm($urlaction, $urlaction, $val['label'], 'minwidth200', $keysearch, $accesskey, $key, img_picto('', $val['img'], '', 0, 1), $showtitlebefore, ($i>0?0:1));
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute hook printSearchForm
|
// Execute hook printSearchForm
|
||||||
|
|||||||
@ -34,13 +34,13 @@ $backtopage = GETPOST('backtopage', 'alpha');
|
|||||||
$formadmin = new FormAdmin($db);
|
$formadmin = new FormAdmin($db);
|
||||||
|
|
||||||
if (GETPOST('l')) {
|
if (GETPOST('l')) {
|
||||||
$l = GETPOST('l');
|
$l = GETPOST('l');
|
||||||
} else {
|
} else {
|
||||||
$l = $langs->defaultlang;
|
$l = $langs->defaultlang;
|
||||||
}
|
}
|
||||||
// Access control
|
// Access control
|
||||||
if (!$user->admin)
|
if (!$user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -49,28 +49,28 @@ if (!$user->admin)
|
|||||||
include DOL_DOCUMENT_ROOT . '/core/actions_setmoduleoptions.inc.php';
|
include DOL_DOCUMENT_ROOT . '/core/actions_setmoduleoptions.inc.php';
|
||||||
|
|
||||||
if ($action == 'setvalue' && $user->admin) {
|
if ($action == 'setvalue' && $user->admin) {
|
||||||
$db->begin();
|
$db->begin();
|
||||||
$sub = "DATAPOLICIESSUBJECT_" . $l;
|
$sub = "DATAPOLICIESSUBJECT_" . $l;
|
||||||
$result = dolibarr_set_const($db, $sub, GETPOST($sub), 'chaine', 0, '', $conf->entity);
|
$result = dolibarr_set_const($db, $sub, GETPOST($sub), 'chaine', 0, '', $conf->entity);
|
||||||
$cont = "DATAPOLICIESCONTENT_" . $l;
|
$cont = "DATAPOLICIESCONTENT_" . $l;
|
||||||
$result = dolibarr_set_const($db, $cont, GETPOST($cont), 'chaine', 0, '', $conf->entity);
|
$result = dolibarr_set_const($db, $cont, GETPOST($cont), 'chaine', 0, '', $conf->entity);
|
||||||
$cont = "TXTLINKDATAPOLICIESACCEPT_" . $l;
|
$cont = "TXTLINKDATAPOLICIESACCEPT_" . $l;
|
||||||
$result = dolibarr_set_const($db, $cont, GETPOST($cont), 'chaine', 0, '', $conf->entity);
|
$result = dolibarr_set_const($db, $cont, GETPOST($cont), 'chaine', 0, '', $conf->entity);
|
||||||
$cont = "TXTLINKDATAPOLICIESREFUSE_" . $l;
|
$cont = "TXTLINKDATAPOLICIESREFUSE_" . $l;
|
||||||
$result = dolibarr_set_const($db, $cont, GETPOST($cont), 'chaine', 0, '', $conf->entity);
|
$result = dolibarr_set_const($db, $cont, GETPOST($cont), 'chaine', 0, '', $conf->entity);
|
||||||
$sub = "DATAPOLICIESACCEPT_" . $l;
|
$sub = "DATAPOLICIESACCEPT_" . $l;
|
||||||
$result = dolibarr_set_const($db, $sub, GETPOST($sub), 'chaine', 0, '', $conf->entity);
|
$result = dolibarr_set_const($db, $sub, GETPOST($sub), 'chaine', 0, '', $conf->entity);
|
||||||
$sub = "DATAPOLICIESREFUSE_" . $l;
|
$sub = "DATAPOLICIESREFUSE_" . $l;
|
||||||
$result = dolibarr_set_const($db, $sub, GETPOST($sub), 'chaine', 0, '', $conf->entity);
|
$result = dolibarr_set_const($db, $sub, GETPOST($sub), 'chaine', 0, '', $conf->entity);
|
||||||
if (!$result > 0)
|
if (!$result > 0)
|
||||||
$error++;
|
$error++;
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessage($langs->trans("SetupSaved"));
|
setEventMessage($langs->trans("SetupSaved"));
|
||||||
} else {
|
} else {
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -105,9 +105,9 @@ print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'
|
|||||||
print '<input type="hidden" name="action" value="setvalue">';
|
print '<input type="hidden" name="action" value="setvalue">';
|
||||||
print '<table>';
|
print '<table>';
|
||||||
if ($conf->global->MAIN_MULTILANGS) {
|
if ($conf->global->MAIN_MULTILANGS) {
|
||||||
print '<tr><td>' . $form->editfieldkey('DefaultLang', 'default_lang', '', null, 0) . '</td><td colspan="3" class="maxwidthonsmartphone">' . "\n";
|
print '<tr><td>' . $form->editfieldkey('DefaultLang', 'default_lang', '', null, 0) . '</td><td colspan="3" class="maxwidthonsmartphone">' . "\n";
|
||||||
print $formadmin->select_language((GETPOST('l') ? GETPOST('l') : $langs->defaultlang), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone');
|
print $formadmin->select_language((GETPOST('l') ? GETPOST('l') : $langs->defaultlang), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone');
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
$subject = 'DATAPOLICIESSUBJECT_' . $l;
|
$subject = 'DATAPOLICIESSUBJECT_' . $l;
|
||||||
$linka = 'TXTLINKDATAPOLICIESACCEPT_' . $l;
|
$linka = 'TXTLINKDATAPOLICIESACCEPT_' . $l;
|
||||||
|
|||||||
@ -76,9 +76,9 @@ dol_fiche_end();
|
|||||||
// Buttons
|
// Buttons
|
||||||
if ($action != 'create' && $action != 'edit')
|
if ($action != 'create' && $action != 'edit')
|
||||||
{
|
{
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a></div>';
|
||||||
print "</div>";
|
print "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -90,10 +90,10 @@ if ($action != 'create' && $action != 'edit')
|
|||||||
|
|
||||||
if ($action == 'create')
|
if ($action == 'create')
|
||||||
{
|
{
|
||||||
print "<br>";
|
print "<br>";
|
||||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
@ -103,10 +103,10 @@ if ($action == 'create')
|
|||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
if ($action == 'edit' && ! empty($attrname))
|
if ($action == 'edit' && ! empty($attrname))
|
||||||
{
|
{
|
||||||
print "<br>";
|
print "<br>";
|
||||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -162,10 +162,10 @@ if (isset($action) && ! empty($action))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loop now on each sql tree to check if dir exists
|
// Loop now on each sql tree to check if dir exists
|
||||||
foreach($sqltree as $dirdesc) // Loop on each sqltree to check dir is on disk
|
foreach($sqltree as $dirdesc) // Loop on each sqltree to check dir is on disk
|
||||||
{
|
{
|
||||||
$dirtotest=$conf->$element->dir_output.'/'.$dirdesc['fullrelativename'];
|
$dirtotest=$conf->$element->dir_output.'/'.$dirdesc['fullrelativename'];
|
||||||
if (! dol_is_dir($dirtotest))
|
if (! dol_is_dir($dirtotest))
|
||||||
{
|
{
|
||||||
$mesg.=$dirtotest." not found onto disk. We delete from database dir with id=".$dirdesc['id']."<br>\n";
|
$mesg.=$dirtotest." not found onto disk. We delete from database dir with id=".$dirdesc['id']."<br>\n";
|
||||||
@ -173,7 +173,7 @@ if (isset($action) && ! empty($action))
|
|||||||
$ecmdirtmp->delete($user, 'databaseonly');
|
$ecmdirtmp->delete($user, 'databaseonly');
|
||||||
//exit;
|
//exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql="UPDATE ".MAIN_DB_PREFIX."ecm_directories set cachenbofdoc = -1 WHERE cachenbofdoc < 0"; // If pb into cahce counting, we set to value -1 = "unknown"
|
$sql="UPDATE ".MAIN_DB_PREFIX."ecm_directories set cachenbofdoc = -1 WHERE cachenbofdoc < 0"; // If pb into cahce counting, we set to value -1 = "unknown"
|
||||||
dol_syslog("sql = ".$sql);
|
dol_syslog("sql = ".$sql);
|
||||||
|
|||||||
@ -108,27 +108,27 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
|||||||
$resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']), 0, 0, $_FILES['userfile']['error']);
|
$resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . dol_unescapefile($_FILES['userfile']['name']), 0, 0, $_FILES['userfile']['error']);
|
||||||
if (is_numeric($resupload) && $resupload > 0)
|
if (is_numeric($resupload) && $resupload > 0)
|
||||||
{
|
{
|
||||||
$result=$ecmdir->changeNbOfFiles('+');
|
$result=$ecmdir->changeNbOfFiles('+');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
if ($resupload < 0) // Unknown error
|
if ($resupload < 0) // Unknown error
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("ErrorFileNotUploaded"), null, 'errors');
|
setEventMessages($langs->trans("ErrorFileNotUploaded"), null, 'errors');
|
||||||
} elseif (preg_match('/ErrorFileIsInfectedWithAVirus/', $resupload)) {
|
} elseif (preg_match('/ErrorFileIsInfectedWithAVirus/', $resupload)) {
|
||||||
// Files infected by a virus
|
// Files infected by a virus
|
||||||
setEventMessages($langs->trans("ErrorFileIsInfectedWithAVirus"), null, 'errors');
|
setEventMessages($langs->trans("ErrorFileIsInfectedWithAVirus"), null, 'errors');
|
||||||
}
|
}
|
||||||
else // Known error
|
else // Known error
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans($resupload), null, 'errors');
|
setEventMessages($langs->trans($resupload), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Failed transfer (exceeding the limit file?)
|
// Failed transfer (exceeding the limit file?)
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
setEventMessages($langs->trans("ErrorFailToCreateDir", $upload_dir), null, 'errors');
|
setEventMessages($langs->trans("ErrorFailToCreateDir", $upload_dir), null, 'errors');
|
||||||
}
|
}
|
||||||
@ -137,13 +137,13 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
|||||||
// Remove file
|
// Remove file
|
||||||
if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
if ($action == 'confirm_deletefile' && $confirm == 'yes')
|
||||||
{
|
{
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
$file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||||
$ret=dol_delete_file($file);
|
$ret=dol_delete_file($file);
|
||||||
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
|
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
|
||||||
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
|
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
|
||||||
|
|
||||||
$result=$ecmdir->changeNbOfFiles('-');
|
$result=$ecmdir->changeNbOfFiles('-');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove dir
|
// Remove dir
|
||||||
@ -197,21 +197,21 @@ if ($action == 'update' && ! GETPOST('cancel', 'alpha'))
|
|||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
if ($module == 'ecm')
|
if ($module == 'ecm')
|
||||||
{
|
{
|
||||||
$oldlabel=$ecmdir->label;
|
$oldlabel=$ecmdir->label;
|
||||||
$olddir=$ecmdir->getRelativePath(0);
|
$olddir=$ecmdir->getRelativePath(0);
|
||||||
$olddir=$conf->ecm->dir_output.'/'.$olddir;
|
$olddir=$conf->ecm->dir_output.'/'.$olddir;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$olddir=GETPOST('section', 'alpha');
|
$olddir=GETPOST('section', 'alpha');
|
||||||
$olddir=$conf->medias->multidir_output[$conf->entity].'/'.$relativepath;
|
$olddir=$conf->medias->multidir_output[$conf->entity].'/'.$relativepath;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($module == 'ecm')
|
if ($module == 'ecm')
|
||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
// Fetch was already done
|
// Fetch was already done
|
||||||
$ecmdir->label = dol_sanitizeFileName(GETPOST("label"));
|
$ecmdir->label = dol_sanitizeFileName(GETPOST("label"));
|
||||||
@ -252,27 +252,27 @@ if ($action == 'update' && ! GETPOST('cancel', 'alpha'))
|
|||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessages($ecmdir->error, $ecmdir->errors, 'errors');
|
setEventMessages($ecmdir->error, $ecmdir->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$newdir = $conf->medias->multidir_output[$conf->entity].'/'.GETPOST('oldrelparentdir', 'alpha').'/'.GETPOST('label', 'alpha');
|
$newdir = $conf->medias->multidir_output[$conf->entity].'/'.GETPOST('oldrelparentdir', 'alpha').'/'.GETPOST('label', 'alpha');
|
||||||
|
|
||||||
$result=@rename($olddir, $newdir);
|
$result=@rename($olddir, $newdir);
|
||||||
if (! $result)
|
if (! $result)
|
||||||
{
|
{
|
||||||
$langs->load('errors');
|
$langs->load('errors');
|
||||||
setEventMessages($langs->trans('ErrorFailToRenameDir', $olddir, $newdir), null, 'errors');
|
setEventMessages($langs->trans('ErrorFailToRenameDir', $olddir, $newdir), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
// Set new value after renaming
|
// Set new value after renaming
|
||||||
$relativepath=GETPOST('oldrelparentdir', 'alpha').'/'.GETPOST('label', 'alpha');
|
$relativepath=GETPOST('oldrelparentdir', 'alpha').'/'.GETPOST('label', 'alpha');
|
||||||
$upload_dir = $conf->medias->multidir_output[$conf->entity].'/'.$relativepath;
|
$upload_dir = $conf->medias->multidir_output[$conf->entity].'/'.$relativepath;
|
||||||
$section = $relativepath;
|
$section = $relativepath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -435,7 +435,7 @@ if ($ecmdir->id > 0)
|
|||||||
// Test if nb is same than in cache
|
// Test if nb is same than in cache
|
||||||
if ($nbofiles != $ecmdir->cachenbofdoc)
|
if ($nbofiles != $ecmdir->cachenbofdoc)
|
||||||
{
|
{
|
||||||
$ecmdir->changeNbOfFiles((string) $nbofiles);
|
$ecmdir->changeNbOfFiles((string) $nbofiles);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -60,7 +60,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
$morehtmlref='<div class="refidno">';
|
$morehtmlref='<div class="refidno">';
|
||||||
$morehtmlref.='</div>';
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||||
@ -71,12 +71,12 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<table width="100%"><tr><td>';
|
print '<table width="100%"><tr><td>';
|
||||||
dol_print_object_info($object);
|
dol_print_object_info($object);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -81,13 +81,13 @@ if ($id > 0 || ! empty($ref))
|
|||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
$morehtmlref='<div class="refidno">';
|
$morehtmlref='<div class="refidno">';
|
||||||
$morehtmlref.='</div>';
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
$cssclass="titlefield";
|
$cssclass="titlefield";
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
||||||
|
|||||||
@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
|||||||
|
|
||||||
|
|
||||||
if (!$user->admin)
|
if (!$user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('admin', 'other', 'externalsite'));
|
$langs->loadLangs(array('admin', 'other', 'externalsite'));
|
||||||
@ -45,26 +45,26 @@ $action = GETPOST('action', 'alpha');
|
|||||||
// Sauvegardes parametres
|
// Sauvegardes parametres
|
||||||
if ($action == 'update')
|
if ($action == 'update')
|
||||||
{
|
{
|
||||||
$i=0;
|
$i=0;
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$label = GETPOST('EXTERNALSITE_LABEL', 'alpha');
|
$label = GETPOST('EXTERNALSITE_LABEL', 'alpha');
|
||||||
$exturl = GETPOST('EXTERNALSITE_URL', 'none');
|
$exturl = GETPOST('EXTERNALSITE_URL', 'none');
|
||||||
|
|
||||||
$i+=dolibarr_set_const($db, 'EXTERNALSITE_LABEL', trim($label), 'chaine', 0, '', $conf->entity);
|
$i+=dolibarr_set_const($db, 'EXTERNALSITE_LABEL', trim($label), 'chaine', 0, '', $conf->entity);
|
||||||
$i+=dolibarr_set_const($db, 'EXTERNALSITE_URL', trim($exturl), 'chaine', 0, '', $conf->entity);
|
$i+=dolibarr_set_const($db, 'EXTERNALSITE_URL', trim($exturl), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
if ($i >= 2)
|
if ($i >= 2)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessages($db->lasterror(), null, 'errors');
|
setEventMessages($db->lasterror(), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -129,7 +129,7 @@ else
|
|||||||
<frame name=\"barre\" src=\"frametop.php?mainmenu=".$mainmenu."&leftmenu=".$leftmenu."&idmenu=".$idmenu.($theme?'&theme='.$theme:'').($codelang?'&lang='.$codelang:'')."&nobackground=1\" noresize scrolling=\"NO\" noborder>
|
<frame name=\"barre\" src=\"frametop.php?mainmenu=".$mainmenu."&leftmenu=".$leftmenu."&idmenu=".$idmenu.($theme?'&theme='.$theme:'').($codelang?'&lang='.$codelang:'')."&nobackground=1\" noresize scrolling=\"NO\" noborder>
|
||||||
";
|
";
|
||||||
print '<frame name="main" src="';
|
print '<frame name="main" src="';
|
||||||
print $conf->global->EXTERNALSITE_URL;
|
print $conf->global->EXTERNALSITE_URL;
|
||||||
print '">';
|
print '">';
|
||||||
print "
|
print "
|
||||||
<noframes>
|
<noframes>
|
||||||
|
|||||||
@ -79,9 +79,9 @@ dol_fiche_end();
|
|||||||
// Buttons
|
// Buttons
|
||||||
if ($action != 'create' && $action != 'edit')
|
if ($action != 'create' && $action != 'edit')
|
||||||
{
|
{
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
|
||||||
print "</div>";
|
print "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ if ($action == 'create')
|
|||||||
print '<br><div id="newattrib"></div>';
|
print '<br><div id="newattrib"></div>';
|
||||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
@ -106,10 +106,10 @@ if ($action == 'create')
|
|||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
if ($action == 'edit' && ! empty($attrname))
|
if ($action == 'edit' && ! empty($attrname))
|
||||||
{
|
{
|
||||||
print "<br>";
|
print "<br>";
|
||||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||||
|
|
||||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -47,8 +47,8 @@ $object = new Fichinter($db);
|
|||||||
|
|
||||||
if (! $object->fetch($id, $ref) > 0)
|
if (! $object->fetch($id, $ref) > 0)
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -47,18 +47,18 @@ $sql.=" WHERE name like 'FTP_SERVER_%'";
|
|||||||
$result=$db->query($sql);
|
$result=$db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
preg_match('/([0-9]+)$/i', $obj->name, $reg);
|
preg_match('/([0-9]+)$/i', $obj->name, $reg);
|
||||||
if ($reg[1]) $lastftpentry = $reg[1];
|
if ($reg[1]) $lastftpentry = $reg[1];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'add' || GETPOST('modify', 'alpha'))
|
if ($action == 'add' || GETPOST('modify', 'alpha'))
|
||||||
{
|
{
|
||||||
$ftp_name = "FTP_NAME_" . $entry;// $_POST["numero_entry"];
|
$ftp_name = "FTP_NAME_" . $entry;// $_POST["numero_entry"];
|
||||||
$ftp_server = "FTP_SERVER_" . $entry; //$_POST["numero_entry"];
|
$ftp_server = "FTP_SERVER_" . $entry; //$_POST["numero_entry"];
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
@ -75,14 +75,14 @@ if ($action == 'add' || GETPOST('modify', 'alpha'))
|
|||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Server")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Server")), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$ftp_port = "FTP_PORT_" . $entry;
|
$ftp_port = "FTP_PORT_" . $entry;
|
||||||
$ftp_user = "FTP_USER_" . $entry;
|
$ftp_user = "FTP_USER_" . $entry;
|
||||||
$ftp_password = "FTP_PASSWORD_" . $entry;
|
$ftp_password = "FTP_PASSWORD_" . $entry;
|
||||||
$ftp_passive = "FTP_PASSIVE_" . $entry;
|
$ftp_passive = "FTP_PASSIVE_" . $entry;
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$result1=dolibarr_set_const($db, "FTP_PORT_" . $entry, GETPOST($ftp_port, 'alpha'), 'chaine', 0, '', $conf->entity);
|
$result1=dolibarr_set_const($db, "FTP_PORT_" . $entry, GETPOST($ftp_port, 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
if ($result1) $result2=dolibarr_set_const($db, "FTP_SERVER_" . $entry, GETPOST($ftp_server, 'alpha'), 'chaine', 0, '', $conf->entity);
|
if ($result1) $result2=dolibarr_set_const($db, "FTP_SERVER_" . $entry, GETPOST($ftp_server, 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
@ -91,25 +91,25 @@ if ($action == 'add' || GETPOST('modify', 'alpha'))
|
|||||||
if ($result4) $result5=dolibarr_set_const($db, "FTP_NAME_" . $entry, GETPOST($ftp_name, 'alpha'), 'chaine', 0, '', $conf->entity);
|
if ($result4) $result5=dolibarr_set_const($db, "FTP_NAME_" . $entry, GETPOST($ftp_name, 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
if ($result5) $result6=dolibarr_set_const($db, "FTP_PASSIVE_" . $entry, GETPOST($ftp_passive, 'alpha'), 'chaine', 0, '', $conf->entity);
|
if ($result5) $result6=dolibarr_set_const($db, "FTP_PASSIVE_" . $entry, GETPOST($ftp_passive, 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
if ($result1 && $result2 && $result3 && $result4 && $result5 && $result6)
|
if ($result1 && $result2 && $result3 && $result4 && $result5 && $result6)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST('delete', 'alpha'))
|
if (GETPOST('delete', 'alpha'))
|
||||||
{
|
{
|
||||||
if($entry)
|
if($entry)
|
||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$result1=dolibarr_del_const($db, "FTP_PORT_" . $entry, $conf->entity);
|
$result1=dolibarr_del_const($db, "FTP_PORT_" . $entry, $conf->entity);
|
||||||
if ($result1) $result2=dolibarr_del_const($db, "FTP_SERVER_" . $entry, $conf->entity);
|
if ($result1) $result2=dolibarr_del_const($db, "FTP_SERVER_" . $entry, $conf->entity);
|
||||||
@ -228,7 +228,7 @@ else
|
|||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
preg_match('/([0-9]+)$/i', $obj->name, $reg);
|
preg_match('/([0-9]+)$/i', $obj->name, $reg);
|
||||||
$idrss = $reg[0];
|
$idrss = $reg[0];
|
||||||
//print "x".join(',',$reg)."=".$obj->name."=".$idrss;
|
//print "x".join(',',$reg)."=".$obj->name."=".$idrss;
|
||||||
|
|
||||||
|
|||||||
@ -46,11 +46,11 @@ if ($id)
|
|||||||
|
|
||||||
dol_fiche_head($head, 'info', $langs->trans("Establishment"), -1, 'building');
|
dol_fiche_head($head, 'info', $langs->trans("Establishment"), -1, 'building');
|
||||||
|
|
||||||
print '<table width="100%"><tr><td>';
|
print '<table width="100%"><tr><td>';
|
||||||
dol_print_object_info($object);
|
dol_print_object_info($object);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -34,8 +34,8 @@ $err = 0;
|
|||||||
// If the config file exists and is filled, we're not on first install so we skip the language selection page
|
// If the config file exists and is filled, we're not on first install so we skip the language selection page
|
||||||
if (file_exists($conffile) && isset($dolibarr_main_url_root))
|
if (file_exists($conffile) && isset($dolibarr_main_url_root))
|
||||||
{
|
{
|
||||||
header("Location: check.php?testget=ok");
|
header("Location: check.php?testget=ok");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
|
|||||||
@ -44,12 +44,12 @@ $action=GETPOST('action', 'alpha')?GETPOST('action', 'alpha'):(empty($argv[4])?'
|
|||||||
$targetversion=DOL_VERSION; // If it's latest upgrade
|
$targetversion=DOL_VERSION; // If it's latest upgrade
|
||||||
if (! empty($action) && preg_match('/upgrade/i', $action)) // If it's an old upgrade
|
if (! empty($action) && preg_match('/upgrade/i', $action)) // If it's an old upgrade
|
||||||
{
|
{
|
||||||
$tmp=explode('_', $action, 2);
|
$tmp=explode('_', $action, 2);
|
||||||
if ($tmp[0]=='upgrade')
|
if ($tmp[0]=='upgrade')
|
||||||
{
|
{
|
||||||
if (! empty($tmp[1])) $targetversion=$tmp[1]; // if $action = 'upgrade_6.0.0-beta', we use '6.0.0-beta'
|
if (! empty($tmp[1])) $targetversion=$tmp[1]; // if $action = 'upgrade_6.0.0-beta', we use '6.0.0-beta'
|
||||||
else $targetversion=DOL_VERSION; // if $action = 'upgrade', we use DOL_VERSION
|
else $targetversion=DOL_VERSION; // if $action = 'upgrade', we use DOL_VERSION
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$langs->loadLangs(array("admin", "install"));
|
$langs->loadLangs(array("admin", "install"));
|
||||||
@ -112,241 +112,241 @@ print '<br>';
|
|||||||
// Test if we can run a first install process
|
// Test if we can run a first install process
|
||||||
if (empty($versionfrom) && empty($versionto) && ! is_writable($conffile))
|
if (empty($versionfrom) && empty($versionto) && ! is_writable($conffile))
|
||||||
{
|
{
|
||||||
print $langs->trans("ConfFileIsNotWritable", $conffiletoshow);
|
print $langs->trans("ConfFileIsNotWritable", $conffiletoshow);
|
||||||
pFooter(1, $setuplang, 'jscheckparam');
|
pFooter(1, $setuplang, 'jscheckparam');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action))
|
if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action))
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
// If password is encoded, we decode it
|
// If password is encoded, we decode it
|
||||||
if (preg_match('/crypted:/i', $dolibarr_main_db_pass) || ! empty($dolibarr_main_db_encrypted_pass))
|
if (preg_match('/crypted:/i', $dolibarr_main_db_pass) || ! empty($dolibarr_main_db_encrypted_pass))
|
||||||
{
|
{
|
||||||
require_once $dolibarr_main_document_root.'/core/lib/security.lib.php';
|
require_once $dolibarr_main_document_root.'/core/lib/security.lib.php';
|
||||||
if (preg_match('/crypted:/i', $dolibarr_main_db_pass))
|
if (preg_match('/crypted:/i', $dolibarr_main_db_pass))
|
||||||
{
|
{
|
||||||
$dolibarr_main_db_pass = preg_replace('/crypted:/i', '', $dolibarr_main_db_pass);
|
$dolibarr_main_db_pass = preg_replace('/crypted:/i', '', $dolibarr_main_db_pass);
|
||||||
$dolibarr_main_db_pass = dol_decode($dolibarr_main_db_pass);
|
$dolibarr_main_db_pass = dol_decode($dolibarr_main_db_pass);
|
||||||
$dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this as it is used to know the password was initially crypted
|
$dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this as it is used to know the password was initially crypted
|
||||||
}
|
}
|
||||||
else $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass);
|
else $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass);
|
||||||
}
|
}
|
||||||
|
|
||||||
$conf->db->type = $dolibarr_main_db_type;
|
$conf->db->type = $dolibarr_main_db_type;
|
||||||
$conf->db->host = $dolibarr_main_db_host;
|
$conf->db->host = $dolibarr_main_db_host;
|
||||||
$conf->db->port = $dolibarr_main_db_port;
|
$conf->db->port = $dolibarr_main_db_port;
|
||||||
$conf->db->name = $dolibarr_main_db_name;
|
$conf->db->name = $dolibarr_main_db_name;
|
||||||
$conf->db->user = $dolibarr_main_db_user;
|
$conf->db->user = $dolibarr_main_db_user;
|
||||||
$conf->db->pass = $dolibarr_main_db_pass;
|
$conf->db->pass = $dolibarr_main_db_pass;
|
||||||
$conf->db->dolibarr_main_db_encryption = isset($dolibarr_main_db_encryption)?$dolibarr_main_db_encryption:'';
|
$conf->db->dolibarr_main_db_encryption = isset($dolibarr_main_db_encryption)?$dolibarr_main_db_encryption:'';
|
||||||
$conf->db->dolibarr_main_db_cryptkey = isset($dolibarr_main_db_cryptkey)?$dolibarr_main_db_cryptkey:'';
|
$conf->db->dolibarr_main_db_cryptkey = isset($dolibarr_main_db_cryptkey)?$dolibarr_main_db_cryptkey:'';
|
||||||
|
|
||||||
$db=getDoliDBInstance($conf->db->type, $conf->db->host, $conf->db->user, $conf->db->pass, $conf->db->name, $conf->db->port);
|
$db=getDoliDBInstance($conf->db->type, $conf->db->host, $conf->db->user, $conf->db->pass, $conf->db->name, $conf->db->port);
|
||||||
|
|
||||||
// Create the global $hookmanager object
|
// Create the global $hookmanager object
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||||
$hookmanager=new HookManager($db);
|
$hookmanager=new HookManager($db);
|
||||||
|
|
||||||
$ok = 0;
|
$ok = 0;
|
||||||
|
|
||||||
// If first install
|
// If first install
|
||||||
if ($action == "set")
|
if ($action == "set")
|
||||||
{
|
{
|
||||||
// Active module user
|
// Active module user
|
||||||
$modName='modUser';
|
$modName='modUser';
|
||||||
$file = $modName . ".class.php";
|
$file = $modName . ".class.php";
|
||||||
dolibarr_install_syslog('step5: load module user ' . DOL_DOCUMENT_ROOT . "/core/modules/" . $file, LOG_INFO);
|
dolibarr_install_syslog('step5: load module user ' . DOL_DOCUMENT_ROOT . "/core/modules/" . $file, LOG_INFO);
|
||||||
include_once DOL_DOCUMENT_ROOT ."/core/modules/".$file;
|
include_once DOL_DOCUMENT_ROOT ."/core/modules/".$file;
|
||||||
$objMod = new $modName($db);
|
$objMod = new $modName($db);
|
||||||
$result=$objMod->init();
|
$result=$objMod->init();
|
||||||
if (! $result) print 'ERROR in activating module file='.$file;
|
if (! $result) print 'ERROR in activating module file='.$file;
|
||||||
|
|
||||||
if ($db->connected)
|
if ($db->connected)
|
||||||
{
|
{
|
||||||
$conf->setValues($db);
|
$conf->setValues($db);
|
||||||
// Reset forced setup after the setValues
|
// Reset forced setup after the setValues
|
||||||
if (defined('SYSLOG_FILE')) $conf->global->SYSLOG_FILE=constant('SYSLOG_FILE');
|
if (defined('SYSLOG_FILE')) $conf->global->SYSLOG_FILE=constant('SYSLOG_FILE');
|
||||||
$conf->global->MAIN_ENABLE_LOG_TO_HTML = 1;
|
$conf->global->MAIN_ENABLE_LOG_TO_HTML = 1;
|
||||||
|
|
||||||
// Create admin user
|
// Create admin user
|
||||||
include_once DOL_DOCUMENT_ROOT .'/user/class/user.class.php';
|
include_once DOL_DOCUMENT_ROOT .'/user/class/user.class.php';
|
||||||
|
|
||||||
// Set default encryption to yes, generate a salt and set default encryption algorythm (but only if there is no user yet into database)
|
// Set default encryption to yes, generate a salt and set default encryption algorythm (but only if there is no user yet into database)
|
||||||
$sql = "SELECT u.rowid, u.pass, u.pass_crypted";
|
$sql = "SELECT u.rowid, u.pass, u.pass_crypted";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$numrows=$db->num_rows($resql);
|
$numrows=$db->num_rows($resql);
|
||||||
if ($numrows == 0)
|
if ($numrows == 0)
|
||||||
{
|
{
|
||||||
// Define default setup for password encryption
|
// Define default setup for password encryption
|
||||||
dolibarr_set_const($db, "DATABASE_PWD_ENCRYPTED", "1", 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "DATABASE_PWD_ENCRYPTED", "1", 'chaine', 0, '', $conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_SECURITY_SALT", dol_print_date(dol_now(), 'dayhourlog'), 'chaine', 0, '', 0); // All entities
|
dolibarr_set_const($db, "MAIN_SECURITY_SALT", dol_print_date(dol_now(), 'dayhourlog'), 'chaine', 0, '', 0); // All entities
|
||||||
if (function_exists('password_hash'))
|
if (function_exists('password_hash'))
|
||||||
dolibarr_set_const($db, "MAIN_SECURITY_HASH_ALGO", 'password_hash', 'chaine', 0, '', 0); // All entities
|
dolibarr_set_const($db, "MAIN_SECURITY_HASH_ALGO", 'password_hash', 'chaine', 0, '', 0); // All entities
|
||||||
else
|
else
|
||||||
dolibarr_set_const($db, "MAIN_SECURITY_HASH_ALGO", 'sha1md5', 'chaine', 0, '', 0); // All entities
|
dolibarr_set_const($db, "MAIN_SECURITY_HASH_ALGO", 'sha1md5', 'chaine', 0, '', 0); // All entities
|
||||||
}
|
}
|
||||||
|
|
||||||
dolibarr_install_syslog('step5: DATABASE_PWD_ENCRYPTED = '.$conf->global->DATABASE_PWD_ENCRYPTED.' MAIN_SECURITY_HASH_ALGO = '.$conf->global->MAIN_SECURITY_HASH_ALGO, LOG_INFO);
|
dolibarr_install_syslog('step5: DATABASE_PWD_ENCRYPTED = '.$conf->global->DATABASE_PWD_ENCRYPTED.' MAIN_SECURITY_HASH_ALGO = '.$conf->global->MAIN_SECURITY_HASH_ALGO, LOG_INFO);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create user used to create the admin user
|
// Create user used to create the admin user
|
||||||
$createuser=new User($db);
|
$createuser=new User($db);
|
||||||
$createuser->id=0;
|
$createuser->id=0;
|
||||||
$createuser->admin=1;
|
$createuser->admin=1;
|
||||||
|
|
||||||
// Set admin user
|
// Set admin user
|
||||||
$newuser = new User($db);
|
$newuser = new User($db);
|
||||||
$newuser->lastname='SuperAdmin';
|
$newuser->lastname='SuperAdmin';
|
||||||
$newuser->firstname='';
|
$newuser->firstname='';
|
||||||
$newuser->login = $login;
|
$newuser->login = $login;
|
||||||
$newuser->pass = $pass;
|
$newuser->pass = $pass;
|
||||||
$newuser->admin=1;
|
$newuser->admin=1;
|
||||||
$newuser->entity=0;
|
$newuser->entity=0;
|
||||||
|
|
||||||
$conf->global->USER_MAIL_REQUIRED=0; // Force global option to be sure to create a new user with no email
|
$conf->global->USER_MAIL_REQUIRED=0; // Force global option to be sure to create a new user with no email
|
||||||
$result=$newuser->create($createuser, 1);
|
$result=$newuser->create($createuser, 1);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
print $langs->trans("AdminLoginCreatedSuccessfuly", $login) . "<br>";
|
print $langs->trans("AdminLoginCreatedSuccessfuly", $login) . "<br>";
|
||||||
$success = 1;
|
$success = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($newuser->error == 'ErrorLoginAlreadyExists')
|
if ($newuser->error == 'ErrorLoginAlreadyExists')
|
||||||
{
|
{
|
||||||
dolibarr_install_syslog('step5: AdminLoginAlreadyExists', LOG_WARNING);
|
dolibarr_install_syslog('step5: AdminLoginAlreadyExists', LOG_WARNING);
|
||||||
print '<br><div class="warning">' . $langs->trans("AdminLoginAlreadyExists", $login) . "</div><br>";
|
print '<br><div class="warning">' . $langs->trans("AdminLoginAlreadyExists", $login) . "</div><br>";
|
||||||
$success = 1;
|
$success = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_install_syslog('step5: FailedToCreateAdminLogin ' . $newuser->error, LOG_ERR);
|
dolibarr_install_syslog('step5: FailedToCreateAdminLogin ' . $newuser->error, LOG_ERR);
|
||||||
print '<br><div class="error">'.$langs->trans("FailedToCreateAdminLogin").' '.$newuser->error.'</div><br><br>';
|
print '<br><div class="error">'.$langs->trans("FailedToCreateAdminLogin").' '.$newuser->error.'</div><br><br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($success)
|
if ($success)
|
||||||
{
|
{
|
||||||
// Insert MAIN_VERSION_FIRST_INSTALL in a dedicated transaction. So if it fails (when first install was already done), we can do other following requests.
|
// Insert MAIN_VERSION_FIRST_INSTALL in a dedicated transaction. So if it fails (when first install was already done), we can do other following requests.
|
||||||
$db->begin();
|
$db->begin();
|
||||||
dolibarr_install_syslog('step5: set MAIN_VERSION_FIRST_INSTALL const to ' . $targetversion, LOG_DEBUG);
|
dolibarr_install_syslog('step5: set MAIN_VERSION_FIRST_INSTALL const to ' . $targetversion, LOG_DEBUG);
|
||||||
$resql=$db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) values(".$db->encrypt('MAIN_VERSION_FIRST_INSTALL', 1).",".$db->encrypt($targetversion, 1).",'chaine',0,'Dolibarr version when first install',0)");
|
$resql=$db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) values(".$db->encrypt('MAIN_VERSION_FIRST_INSTALL', 1).",".$db->encrypt($targetversion, 1).",'chaine',0,'Dolibarr version when first install',0)");
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$conf->global->MAIN_VERSION_FIRST_INSTALL=$targetversion;
|
$conf->global->MAIN_VERSION_FIRST_INSTALL=$targetversion;
|
||||||
$db->commit();
|
$db->commit();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//if (! $resql) dol_print_error($db,'Error in setup program'); // We ignore errors. Key may already exists
|
//if (! $resql) dol_print_error($db,'Error in setup program'); // We ignore errors. Key may already exists
|
||||||
$db->commit();
|
$db->commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
dolibarr_install_syslog('step5: set MAIN_VERSION_LAST_INSTALL const to ' . $targetversion, LOG_DEBUG);
|
dolibarr_install_syslog('step5: set MAIN_VERSION_LAST_INSTALL const to ' . $targetversion, LOG_DEBUG);
|
||||||
$resql=$db->query("DELETE FROM ".MAIN_DB_PREFIX."const WHERE ".$db->decrypt('name')."='MAIN_VERSION_LAST_INSTALL'");
|
$resql=$db->query("DELETE FROM ".MAIN_DB_PREFIX."const WHERE ".$db->decrypt('name')."='MAIN_VERSION_LAST_INSTALL'");
|
||||||
if (! $resql) dol_print_error($db, 'Error in setup program');
|
if (! $resql) dol_print_error($db, 'Error in setup program');
|
||||||
$resql=$db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) values(".$db->encrypt('MAIN_VERSION_LAST_INSTALL', 1).",".$db->encrypt($targetversion, 1).",'chaine',0,'Dolibarr version when last install',0)");
|
$resql=$db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) values(".$db->encrypt('MAIN_VERSION_LAST_INSTALL', 1).",".$db->encrypt($targetversion, 1).",'chaine',0,'Dolibarr version when last install',0)");
|
||||||
if (! $resql) dol_print_error($db, 'Error in setup program');
|
if (! $resql) dol_print_error($db, 'Error in setup program');
|
||||||
$conf->global->MAIN_VERSION_LAST_INSTALL=$targetversion;
|
$conf->global->MAIN_VERSION_LAST_INSTALL=$targetversion;
|
||||||
|
|
||||||
if ($useforcedwizard)
|
if ($useforcedwizard)
|
||||||
{
|
{
|
||||||
dolibarr_install_syslog('step5: set MAIN_REMOVE_INSTALL_WARNING const to 1', LOG_DEBUG);
|
dolibarr_install_syslog('step5: set MAIN_REMOVE_INSTALL_WARNING const to 1', LOG_DEBUG);
|
||||||
$resql=$db->query("DELETE FROM ".MAIN_DB_PREFIX."const WHERE ".$db->decrypt('name')."='MAIN_REMOVE_INSTALL_WARNING'");
|
$resql=$db->query("DELETE FROM ".MAIN_DB_PREFIX."const WHERE ".$db->decrypt('name')."='MAIN_REMOVE_INSTALL_WARNING'");
|
||||||
if (! $resql) dol_print_error($db, 'Error in setup program');
|
if (! $resql) dol_print_error($db, 'Error in setup program');
|
||||||
$resql=$db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) values(".$db->encrypt('MAIN_REMOVE_INSTALL_WARNING', 1).",".$db->encrypt(1, 1).",'chaine',1,'Disable install warnings',0)");
|
$resql=$db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) values(".$db->encrypt('MAIN_REMOVE_INSTALL_WARNING', 1).",".$db->encrypt(1, 1).",'chaine',1,'Disable install warnings',0)");
|
||||||
if (! $resql) dol_print_error($db, 'Error in setup program');
|
if (! $resql) dol_print_error($db, 'Error in setup program');
|
||||||
$conf->global->MAIN_REMOVE_INSTALL_WARNING=1;
|
$conf->global->MAIN_REMOVE_INSTALL_WARNING=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we ask to force some modules to be enabled
|
// If we ask to force some modules to be enabled
|
||||||
if (! empty($force_install_module))
|
if (! empty($force_install_module))
|
||||||
{
|
{
|
||||||
if (! defined('DOL_DOCUMENT_ROOT') && ! empty($dolibarr_main_document_root)) define('DOL_DOCUMENT_ROOT', $dolibarr_main_document_root);
|
if (! defined('DOL_DOCUMENT_ROOT') && ! empty($dolibarr_main_document_root)) define('DOL_DOCUMENT_ROOT', $dolibarr_main_document_root);
|
||||||
|
|
||||||
$tmparray=explode(',', $force_install_module);
|
$tmparray=explode(',', $force_install_module);
|
||||||
foreach ($tmparray as $modtoactivate)
|
foreach ($tmparray as $modtoactivate)
|
||||||
{
|
{
|
||||||
$modtoactivatenew=preg_replace('/\.class\.php$/i', '', $modtoactivate);
|
$modtoactivatenew=preg_replace('/\.class\.php$/i', '', $modtoactivate);
|
||||||
print $langs->trans("ActivateModule", $modtoactivatenew).'<br>';
|
print $langs->trans("ActivateModule", $modtoactivatenew).'<br>';
|
||||||
|
|
||||||
$file=$modtoactivatenew.'.class.php';
|
$file=$modtoactivatenew.'.class.php';
|
||||||
dolibarr_install_syslog('step5: activate module file=' . $file);
|
dolibarr_install_syslog('step5: activate module file=' . $file);
|
||||||
$res=dol_include_once("/core/modules/".$file);
|
$res=dol_include_once("/core/modules/".$file);
|
||||||
|
|
||||||
$res=activateModule($modtoactivatenew, 1);
|
$res=activateModule($modtoactivatenew, 1);
|
||||||
if (! empty($res['errors'])) print 'ERROR in activating module file='.$file;
|
if (! empty($res['errors'])) print 'ERROR in activating module file='.$file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dolibarr_install_syslog('step5: remove MAIN_NOT_INSTALLED const');
|
dolibarr_install_syslog('step5: remove MAIN_NOT_INSTALLED const');
|
||||||
$resql=$db->query("DELETE FROM ".MAIN_DB_PREFIX."const WHERE ".$db->decrypt('name')."='MAIN_NOT_INSTALLED'");
|
$resql=$db->query("DELETE FROM ".MAIN_DB_PREFIX."const WHERE ".$db->decrypt('name')."='MAIN_NOT_INSTALLED'");
|
||||||
if (! $resql) dol_print_error($db, 'Error in setup program');
|
if (! $resql) dol_print_error($db, 'Error in setup program');
|
||||||
|
|
||||||
$db->commit();
|
$db->commit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $langs->trans("ErrorFailedToConnect")."<br>";
|
print $langs->trans("ErrorFailedToConnect")."<br>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If upgrade
|
// If upgrade
|
||||||
elseif (empty($action) || preg_match('/upgrade/i', $action))
|
elseif (empty($action) || preg_match('/upgrade/i', $action))
|
||||||
{
|
{
|
||||||
if ($db->connected)
|
if ($db->connected)
|
||||||
{
|
{
|
||||||
$conf->setValues($db);
|
$conf->setValues($db);
|
||||||
// Reset forced setup after the setValues
|
// Reset forced setup after the setValues
|
||||||
if (defined('SYSLOG_FILE')) $conf->global->SYSLOG_FILE=constant('SYSLOG_FILE');
|
if (defined('SYSLOG_FILE')) $conf->global->SYSLOG_FILE=constant('SYSLOG_FILE');
|
||||||
$conf->global->MAIN_ENABLE_LOG_TO_HTML = 1;
|
$conf->global->MAIN_ENABLE_LOG_TO_HTML = 1;
|
||||||
|
|
||||||
// Define if we need to update the MAIN_VERSION_LAST_UPGRADE value in database
|
// Define if we need to update the MAIN_VERSION_LAST_UPGRADE value in database
|
||||||
$tagdatabase=false;
|
$tagdatabase=false;
|
||||||
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE)) $tagdatabase=true; // We don't know what it was before, so now we consider we are version choosed.
|
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE)) $tagdatabase=true; // We don't know what it was before, so now we consider we are version choosed.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mainversionlastupgradearray=preg_split('/[.-]/', $conf->global->MAIN_VERSION_LAST_UPGRADE);
|
$mainversionlastupgradearray=preg_split('/[.-]/', $conf->global->MAIN_VERSION_LAST_UPGRADE);
|
||||||
$targetversionarray=preg_split('/[.-]/', $targetversion);
|
$targetversionarray=preg_split('/[.-]/', $targetversion);
|
||||||
if (versioncompare($targetversionarray, $mainversionlastupgradearray) > 0) $tagdatabase=true;
|
if (versioncompare($targetversionarray, $mainversionlastupgradearray) > 0) $tagdatabase=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($tagdatabase)
|
if ($tagdatabase)
|
||||||
{
|
{
|
||||||
dolibarr_install_syslog('step5: set MAIN_VERSION_LAST_UPGRADE const to value ' . $targetversion);
|
dolibarr_install_syslog('step5: set MAIN_VERSION_LAST_UPGRADE const to value ' . $targetversion);
|
||||||
$resql=$db->query("DELETE FROM ".MAIN_DB_PREFIX."const WHERE ".$db->decrypt('name')."='MAIN_VERSION_LAST_UPGRADE'");
|
$resql=$db->query("DELETE FROM ".MAIN_DB_PREFIX."const WHERE ".$db->decrypt('name')."='MAIN_VERSION_LAST_UPGRADE'");
|
||||||
if (! $resql) dol_print_error($db, 'Error in setup program');
|
if (! $resql) dol_print_error($db, 'Error in setup program');
|
||||||
$resql=$db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) VALUES (".$db->encrypt('MAIN_VERSION_LAST_UPGRADE', 1).",".$db->encrypt($targetversion, 1).",'chaine',0,'Dolibarr version for last upgrade',0)");
|
$resql=$db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) VALUES (".$db->encrypt('MAIN_VERSION_LAST_UPGRADE', 1).",".$db->encrypt($targetversion, 1).",'chaine',0,'Dolibarr version for last upgrade',0)");
|
||||||
if (! $resql) dol_print_error($db, 'Error in setup program');
|
if (! $resql) dol_print_error($db, 'Error in setup program');
|
||||||
$conf->global->MAIN_VERSION_LAST_UPGRADE=$targetversion;
|
$conf->global->MAIN_VERSION_LAST_UPGRADE=$targetversion;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_install_syslog('step5: we run an upgrade to version ' . $targetversion . ' but database was already upgraded to ' . $conf->global->MAIN_VERSION_LAST_UPGRADE . '. We keep MAIN_VERSION_LAST_UPGRADE as it is.');
|
dolibarr_install_syslog('step5: we run an upgrade to version ' . $targetversion . ' but database was already upgraded to ' . $conf->global->MAIN_VERSION_LAST_UPGRADE . '. We keep MAIN_VERSION_LAST_UPGRADE as it is.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $langs->trans("ErrorFailedToConnect")."<br>";
|
print $langs->trans("ErrorFailedToConnect")."<br>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error('', 'step5.php: unknown choice of action');
|
dol_print_error('', 'step5.php: unknown choice of action');
|
||||||
}
|
}
|
||||||
|
|
||||||
// May fail if parameter already defined
|
// May fail if parameter already defined
|
||||||
$resql=$db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) VALUES (".$db->encrypt('MAIN_LANG_DEFAULT', 1).",".$db->encrypt($setuplang, 1).",'chaine',0,'Default language',1)");
|
$resql=$db->query("INSERT INTO ".MAIN_DB_PREFIX."const(name,value,type,visible,note,entity) VALUES (".$db->encrypt('MAIN_LANG_DEFAULT', 1).",".$db->encrypt($setuplang, 1).",'chaine',0,'Default language',1)");
|
||||||
//if (! $resql) dol_print_error($db,'Error in setup program');
|
//if (! $resql) dol_print_error($db,'Error in setup program');
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -356,104 +356,104 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action))
|
|||||||
// If first install
|
// If first install
|
||||||
if ($action == "set" && $success)
|
if ($action == "set" && $success)
|
||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION))
|
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION))
|
||||||
{
|
{
|
||||||
// Install is finished
|
// Install is finished
|
||||||
print $langs->trans("SystemIsInstalled")."<br>";
|
print $langs->trans("SystemIsInstalled")."<br>";
|
||||||
|
|
||||||
$createlock=0;
|
$createlock=0;
|
||||||
|
|
||||||
if (! empty($force_install_lockinstall) || ! empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE))
|
if (! empty($force_install_lockinstall) || ! empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE))
|
||||||
{
|
{
|
||||||
// Install is finished, we create the lock file
|
// Install is finished, we create the lock file
|
||||||
$lockfile=DOL_DATA_ROOT.'/install.lock';
|
$lockfile=DOL_DATA_ROOT.'/install.lock';
|
||||||
$fp = @fopen($lockfile, "w");
|
$fp = @fopen($lockfile, "w");
|
||||||
if ($fp)
|
if ($fp)
|
||||||
{
|
{
|
||||||
if (empty($force_install_lockinstall) || $force_install_lockinstall == 1) $force_install_lockinstall=444; // For backward compatibility
|
if (empty($force_install_lockinstall) || $force_install_lockinstall == 1) $force_install_lockinstall=444; // For backward compatibility
|
||||||
fwrite($fp, "This is a lock file to prevent use of install pages (set with permission ".$force_install_lockinstall.")");
|
fwrite($fp, "This is a lock file to prevent use of install pages (set with permission ".$force_install_lockinstall.")");
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
@chmod($lockfile, octdec($force_install_lockinstall));
|
@chmod($lockfile, octdec($force_install_lockinstall));
|
||||||
$createlock=1;
|
$createlock=1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (empty($createlock))
|
if (empty($createlock))
|
||||||
{
|
{
|
||||||
print '<div class="warning">'.$langs->trans("WarningRemoveInstallDir")."</div>";
|
print '<div class="warning">'.$langs->trans("WarningRemoveInstallDir")."</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<br>";
|
print "<br>";
|
||||||
|
|
||||||
print $langs->trans("YouNeedToPersonalizeSetup")."<br><br>";
|
print $langs->trans("YouNeedToPersonalizeSetup")."<br><br>";
|
||||||
|
|
||||||
print '<div class="center"><a href="../admin/index.php?mainmenu=home&leftmenu=setup' . (isset($login) ? '&username=' . urlencode($login) : '') . '">';
|
print '<div class="center"><a href="../admin/index.php?mainmenu=home&leftmenu=setup' . (isset($login) ? '&username=' . urlencode($login) : '') . '">';
|
||||||
print $langs->trans("GoToSetupArea");
|
print $langs->trans("GoToSetupArea");
|
||||||
print '</a></div>';
|
print '</a></div>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// If here MAIN_VERSION_LAST_UPGRADE is not empty
|
// If here MAIN_VERSION_LAST_UPGRADE is not empty
|
||||||
print $langs->trans("VersionLastUpgrade").': <b><span class="ok">'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</span></b><br>';
|
print $langs->trans("VersionLastUpgrade").': <b><span class="ok">'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</span></b><br>';
|
||||||
print $langs->trans("VersionProgram").': <b><span class="ok">'.DOL_VERSION.'</span></b><br>';
|
print $langs->trans("VersionProgram").': <b><span class="ok">'.DOL_VERSION.'</span></b><br>';
|
||||||
print $langs->trans("MigrationNotFinished").'<br>';
|
print $langs->trans("MigrationNotFinished").'<br>';
|
||||||
print "<br>";
|
print "<br>";
|
||||||
|
|
||||||
print '<div class="center"><a href="'.$dolibarr_main_url_root .'/install/index.php">';
|
print '<div class="center"><a href="'.$dolibarr_main_url_root .'/install/index.php">';
|
||||||
print $langs->trans("GoToUpgradePage");
|
print $langs->trans("GoToUpgradePage");
|
||||||
print '</a></div>';
|
print '</a></div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If upgrade
|
// If upgrade
|
||||||
elseif (empty($action) || preg_match('/upgrade/i', $action))
|
elseif (empty($action) || preg_match('/upgrade/i', $action))
|
||||||
{
|
{
|
||||||
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION))
|
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION))
|
||||||
{
|
{
|
||||||
// Upgrade is finished
|
// Upgrade is finished
|
||||||
print $langs->trans("SystemIsUpgraded")."<br>";
|
print $langs->trans("SystemIsUpgraded")."<br>";
|
||||||
|
|
||||||
$createlock=0;
|
$createlock=0;
|
||||||
|
|
||||||
if (! empty($force_install_lockinstall) || ! empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE))
|
if (! empty($force_install_lockinstall) || ! empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE))
|
||||||
{
|
{
|
||||||
// Upgrade is finished, we create the lock file
|
// Upgrade is finished, we create the lock file
|
||||||
$lockfile=DOL_DATA_ROOT.'/install.lock';
|
$lockfile=DOL_DATA_ROOT.'/install.lock';
|
||||||
$fp = @fopen($lockfile, "w");
|
$fp = @fopen($lockfile, "w");
|
||||||
if ($fp)
|
if ($fp)
|
||||||
{
|
{
|
||||||
if (empty($force_install_lockinstall) || $force_install_lockinstall == 1) $force_install_lockinstall=444; // For backward compatibility
|
if (empty($force_install_lockinstall) || $force_install_lockinstall == 1) $force_install_lockinstall=444; // For backward compatibility
|
||||||
fwrite($fp, "This is a lock file to prevent use of install pages (set with permission ".$force_install_lockinstall.")");
|
fwrite($fp, "This is a lock file to prevent use of install pages (set with permission ".$force_install_lockinstall.")");
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
@chmod($lockfile, octdec($force_install_lockinstall));
|
@chmod($lockfile, octdec($force_install_lockinstall));
|
||||||
$createlock=1;
|
$createlock=1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (empty($createlock))
|
if (empty($createlock))
|
||||||
{
|
{
|
||||||
print '<br><div class="warning">'.$langs->trans("WarningRemoveInstallDir")."</div>";
|
print '<br><div class="warning">'.$langs->trans("WarningRemoveInstallDir")."</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<br><br>";
|
print "<br><br>";
|
||||||
|
|
||||||
print '<div class="center"><a href="../index.php?mainmenu=home' . (isset($login) ? '&username=' . urlencode($login) : '') . '">';
|
print '<div class="center"><a href="../index.php?mainmenu=home' . (isset($login) ? '&username=' . urlencode($login) : '') . '">';
|
||||||
print $langs->trans("GoToDolibarr").'...';
|
print $langs->trans("GoToDolibarr").'...';
|
||||||
print '</a></div><br>';
|
print '</a></div><br>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// If here MAIN_VERSION_LAST_UPGRADE is not empty
|
// If here MAIN_VERSION_LAST_UPGRADE is not empty
|
||||||
print $langs->trans("VersionLastUpgrade").': <b><span class="ok">'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</span></b><br>';
|
print $langs->trans("VersionLastUpgrade").': <b><span class="ok">'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</span></b><br>';
|
||||||
print $langs->trans("VersionProgram").': <b><span class="ok">'.DOL_VERSION.'</span></b>';
|
print $langs->trans("VersionProgram").': <b><span class="ok">'.DOL_VERSION.'</span></b>';
|
||||||
|
|
||||||
print "<br>";
|
print "<br>";
|
||||||
|
|
||||||
print '<div class="center"><a href="../install/index.php">';
|
print '<div class="center"><a href="../install/index.php">';
|
||||||
print $langs->trans("GoToUpgradePage");
|
print $langs->trans("GoToUpgradePage");
|
||||||
print '</a></div>';
|
print '</a></div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error('', 'step5.php: unknown choice of action');
|
dol_print_error('', 'step5.php: unknown choice of action');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear cache files
|
// Clear cache files
|
||||||
|
|||||||
@ -41,66 +41,66 @@ $action=GETPOST('action', 'alpha');
|
|||||||
*/
|
*/
|
||||||
if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
|
if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
|
||||||
{
|
{
|
||||||
$code=$reg[1];
|
$code=$reg[1];
|
||||||
if (dolibarr_set_const($db, $code, 1, 'yesno', 0, '', $conf->entity) > 0)
|
if (dolibarr_set_const($db, $code, 1, 'yesno', 0, '', $conf->entity) > 0)
|
||||||
{
|
{
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
|
if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
|
||||||
{
|
{
|
||||||
$code=$reg[1];
|
$code=$reg[1];
|
||||||
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
||||||
{
|
{
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'remises')
|
if ($action == 'remises')
|
||||||
{
|
{
|
||||||
if (dolibarr_set_const($db, 'MARGIN_METHODE_FOR_DISCOUNT', $_POST['MARGIN_METHODE_FOR_DISCOUNT'], 'chaine', 0, '', $conf->entity) > 0)
|
if (dolibarr_set_const($db, 'MARGIN_METHODE_FOR_DISCOUNT', $_POST['MARGIN_METHODE_FOR_DISCOUNT'], 'chaine', 0, '', $conf->entity) > 0)
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'typemarges')
|
if ($action == 'typemarges')
|
||||||
{
|
{
|
||||||
if (dolibarr_set_const($db, 'MARGIN_TYPE', $_POST['MARGIN_TYPE'], 'chaine', 0, '', $conf->entity) > 0)
|
if (dolibarr_set_const($db, 'MARGIN_TYPE', $_POST['MARGIN_TYPE'], 'chaine', 0, '', $conf->entity) > 0)
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'contact')
|
if ($action == 'contact')
|
||||||
{
|
{
|
||||||
if (dolibarr_set_const($db, 'AGENT_CONTACT_TYPE', $_POST['AGENT_CONTACT_TYPE'], 'chaine', 0, '', $conf->entity) > 0)
|
if (dolibarr_set_const($db, 'AGENT_CONTACT_TYPE', $_POST['AGENT_CONTACT_TYPE'], 'chaine', 0, '', $conf->entity) > 0)
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Global test setup
|
* Global test setup
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function setUpBeforeClass()
|
public static function setUpBeforeClass()
|
||||||
{
|
{
|
||||||
@ -41,7 +41,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Unit test setup
|
* Unit test setup
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function setUp()
|
protected function setUp()
|
||||||
{
|
{
|
||||||
@ -50,7 +50,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Verify pre conditions
|
* Verify pre conditions
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function assertPreConditions()
|
protected function assertPreConditions()
|
||||||
{
|
{
|
||||||
@ -59,7 +59,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A sample test
|
* A sample test
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function testSomething()
|
public function testSomething()
|
||||||
{
|
{
|
||||||
@ -70,7 +70,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Verify post conditions
|
* Verify post conditions
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function assertPostConditions()
|
protected function assertPostConditions()
|
||||||
{
|
{
|
||||||
@ -79,7 +79,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Unit test teardown
|
* Unit test teardown
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function tearDown()
|
protected function tearDown()
|
||||||
{
|
{
|
||||||
@ -88,7 +88,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Global test teardown
|
* Global test teardown
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function tearDownAfterClass()
|
public static function tearDownAfterClass()
|
||||||
{
|
{
|
||||||
@ -99,7 +99,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase
|
|||||||
* Unsuccessful test
|
* Unsuccessful test
|
||||||
*
|
*
|
||||||
* @param Exception $e Exception
|
* @param Exception $e Exception
|
||||||
* @return void
|
* @return void
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
protected function onNotSuccessfulTest(Exception $e)
|
protected function onNotSuccessfulTest(Exception $e)
|
||||||
|
|||||||
@ -47,11 +47,11 @@ function opensurvey_prepare_head(Opensurveysondage $object)
|
|||||||
$head[1][2] = 'preview';
|
$head[1][2] = 'preview';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
// Show more tabs from modules
|
// Show more tabs from modules
|
||||||
// Entries must be declared in modules descriptor with line
|
// Entries must be declared in modules descriptor with line
|
||||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'opensurveypoll');
|
complete_head_from_modules($conf, $langs, $object, $head, $h, 'opensurveypoll');
|
||||||
|
|
||||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'opensurveypoll', 'remove');
|
complete_head_from_modules($conf, $langs, $object, $head, $h, 'opensurveypoll', 'remove');
|
||||||
|
|
||||||
|
|||||||
@ -52,17 +52,17 @@ if ($action == 'setvalue' && $user->admin)
|
|||||||
if (! $result > 0) $error++;
|
if (! $result > 0) $error++;
|
||||||
$result=dolibarr_set_const($db, "PAYBOX_PBX_IDENTIFIANT", GETPOST('PAYBOX_PBX_IDENTIFIANT', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$result=dolibarr_set_const($db, "PAYBOX_PBX_IDENTIFIANT", GETPOST('PAYBOX_PBX_IDENTIFIANT', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
if (! $result > 0) $error++;
|
if (! $result > 0) $error++;
|
||||||
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_CREDITOR", GETPOST('ONLINE_PAYMENT_CREDITOR', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_CREDITOR", GETPOST('ONLINE_PAYMENT_CREDITOR', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
if (! $result > 0) $error++;
|
if (! $result > 0) $error++;
|
||||||
$result=dolibarr_set_const($db, "PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS", GETPOST('PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS', 'int'), 'chaine', 0, '', $conf->entity);
|
$result=dolibarr_set_const($db, "PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS", GETPOST('PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS', 'int'), 'chaine', 0, '', $conf->entity);
|
||||||
if (! $result > 0) $error++;
|
if (! $result > 0) $error++;
|
||||||
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL", GETPOST('ONLINE_PAYMENT_CSS_URL', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL", GETPOST('ONLINE_PAYMENT_CSS_URL', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
if (! $result > 0) $error++;
|
if (! $result > 0) $error++;
|
||||||
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_FORM", GETPOST('ONLINE_PAYMENT_MESSAGE_FORM', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_FORM", GETPOST('ONLINE_PAYMENT_MESSAGE_FORM', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
if (! $result > 0) $error++;
|
if (! $result > 0) $error++;
|
||||||
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK", GETPOST('ONLINE_PAYMENT_MESSAGE_OK', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK", GETPOST('ONLINE_PAYMENT_MESSAGE_OK', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
if (! $result > 0) $error++;
|
if (! $result > 0) $error++;
|
||||||
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_KO", GETPOST('ONLINE_PAYMENT_MESSAGE_KO', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_KO", GETPOST('ONLINE_PAYMENT_MESSAGE_KO', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
if (! $result > 0) $error++;
|
if (! $result > 0) $error++;
|
||||||
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_SENDEMAIL", GETPOST('ONLINE_PAYMENT_SENDEMAIL'), 'chaine', 0, '', $conf->entity);
|
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_SENDEMAIL", GETPOST('ONLINE_PAYMENT_SENDEMAIL'), 'chaine', 0, '', $conf->entity);
|
||||||
if (! $result > 0) $error++;
|
if (! $result > 0) $error++;
|
||||||
|
|||||||
@ -24,14 +24,14 @@
|
|||||||
|
|
||||||
if (session_id() == "")
|
if (session_id() == "")
|
||||||
{
|
{
|
||||||
session_start();
|
session_start();
|
||||||
if (ini_get('register_globals')) // To solve bug in using $_SESSION
|
if (ini_get('register_globals')) // To solve bug in using $_SESSION
|
||||||
{
|
{
|
||||||
foreach ($_SESSION as $key=>$value)
|
foreach ($_SESSION as $key=>$value)
|
||||||
{
|
{
|
||||||
if (isset($GLOBALS[$key])) unset($GLOBALS[$key]);
|
if (isset($GLOBALS[$key])) unset($GLOBALS[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==================================
|
// ==================================
|
||||||
@ -50,13 +50,13 @@ $API_version="56";
|
|||||||
*/
|
*/
|
||||||
if (! empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox', 'alpha')) // We can force sand box with param 'forcesandbox'
|
if (! empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox', 'alpha')) // We can force sand box with param 'forcesandbox'
|
||||||
{
|
{
|
||||||
$API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp";
|
$API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp";
|
||||||
$API_Url = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=";
|
$API_Url = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$API_Endpoint = "https://api-3t.paypal.com/nvp";
|
$API_Endpoint = "https://api-3t.paypal.com/nvp";
|
||||||
$API_Url = "https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=";
|
$API_Url = "https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
|
|||||||
@ -50,19 +50,19 @@ print $langs->trans("DirectPrintingJobsDesc").'<br><br>';
|
|||||||
$object = new PrintingDriver($db);
|
$object = new PrintingDriver($db);
|
||||||
$result = $object->listDrivers($db, 10);
|
$result = $object->listDrivers($db, 10);
|
||||||
foreach ($result as $driver) {
|
foreach ($result as $driver) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php';
|
||||||
$classname = 'printing_'.$driver;
|
$classname = 'printing_'.$driver;
|
||||||
$langs->load($driver);
|
$langs->load($driver);
|
||||||
$printer = new $classname($db);
|
$printer = new $classname($db);
|
||||||
if ($conf->global->{$printer->active}) {
|
if ($conf->global->{$printer->active}) {
|
||||||
//$printer->listJobs('commande');
|
//$printer->listJobs('commande');
|
||||||
$result = $printer->listJobs();
|
$result = $printer->listJobs();
|
||||||
print $printer->resprint;
|
print $printer->resprint;
|
||||||
|
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
setEventMessages($printer->error, $printer->errors, 'errors');
|
setEventMessages($printer->error, $printer->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -32,46 +32,46 @@
|
|||||||
*/
|
*/
|
||||||
function printingAdminPrepareHead($mode)
|
function printingAdminPrepareHead($mode)
|
||||||
{
|
{
|
||||||
global $langs, $conf;
|
global $langs, $conf;
|
||||||
|
|
||||||
$h = 0;
|
$h = 0;
|
||||||
$head = array();
|
$head = array();
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=config";
|
$head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=config";
|
||||||
$head[$h][1] = $langs->trans("ListDrivers");
|
$head[$h][1] = $langs->trans("ListDrivers");
|
||||||
$head[$h][2] = 'config';
|
$head[$h][2] = 'config';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
if ($mode == 'setup') {
|
if ($mode == 'setup') {
|
||||||
$head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=setup&driver=".GETPOST('driver', 'alpha');
|
$head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=setup&driver=".GETPOST('driver', 'alpha');
|
||||||
$head[$h][1] = $langs->trans("SetupDriver");
|
$head[$h][1] = $langs->trans("SetupDriver");
|
||||||
$head[$h][2] = 'setup';
|
$head[$h][2] = 'setup';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($mode == 'test') {
|
if ($mode == 'test') {
|
||||||
$head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=test&driver=".GETPOST('driver', 'alpha');
|
$head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=test&driver=".GETPOST('driver', 'alpha');
|
||||||
$head[$h][1] = $langs->trans("TargetedPrinter");
|
$head[$h][1] = $langs->trans("TargetedPrinter");
|
||||||
$head[$h][2] = 'test';
|
$head[$h][2] = 'test';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** TODO This feature seem to be not ready yet.
|
/** TODO This feature seem to be not ready yet.
|
||||||
$head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=userconf";
|
$head[$h][0] = DOL_URL_ROOT."/printing/admin/printing.php?mode=userconf";
|
||||||
$head[$h][1] = $langs->trans("UserConf");
|
$head[$h][1] = $langs->trans("UserConf");
|
||||||
$head[$h][2] = 'userconf';
|
$head[$h][2] = 'userconf';
|
||||||
$h++;
|
$h++;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//$object=new stdClass();
|
//$object=new stdClass();
|
||||||
|
|
||||||
// Show more tabs from modules
|
// Show more tabs from modules
|
||||||
// Entries must be declared in modules descriptor with line
|
// Entries must be declared in modules descriptor with line
|
||||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||||
//complete_head_from_modules($conf,$langs,$object,$head,$h,'printingadmin');
|
//complete_head_from_modules($conf,$langs,$object,$head,$h,'printingadmin');
|
||||||
|
|
||||||
//complete_head_from_modules($conf,$langs,$object,$head,$h,'printing','remove');
|
//complete_head_from_modules($conf,$langs,$object,$head,$h,'printing','remove');
|
||||||
|
|
||||||
return $head;
|
return $head;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -201,7 +201,7 @@ if ($action == 'convert')
|
|||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
$objectstatic2 = new ProductFournisseur($db); // Object init must be into loop to avoid to get value of previous step
|
$objectstatic2 = new ProductFournisseur($db); // Object init must be into loop to avoid to get value of previous step
|
||||||
$ret=$objectstatic2->fetch_product_fournisseur_price($obj->rowid);
|
$ret=$objectstatic2->fetch_product_fournisseur_price($obj->rowid);
|
||||||
if ($ret > 0)
|
if ($ret > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -73,9 +73,9 @@ if ($action == 'add')
|
|||||||
if ($result == 0) //No existing entry found with title, ok
|
if ($result == 0) //No existing entry found with title, ok
|
||||||
{
|
{
|
||||||
//Check the expression validity by parsing it
|
//Check the expression validity by parsing it
|
||||||
$priceparser = new PriceParser($db);
|
$priceparser = new PriceParser($db);
|
||||||
$price_result = $priceparser->testExpression($id, $expression);
|
$price_result = $priceparser->testExpression($id, $expression);
|
||||||
if ($price_result < 0) { //Expression is not valid
|
if ($price_result < 0) { //Expression is not valid
|
||||||
setEventMessages($priceparser->translatedError(), null, 'errors');
|
setEventMessages($priceparser->translatedError(), null, 'errors');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -113,9 +113,9 @@ if ($action == 'update')
|
|||||||
if ($result == 0 || $result == $eid) //No existing entry found with title or existing one is the current one, ok
|
if ($result == 0 || $result == $eid) //No existing entry found with title or existing one is the current one, ok
|
||||||
{
|
{
|
||||||
//Check the expression validity by parsing it
|
//Check the expression validity by parsing it
|
||||||
$priceparser = new PriceParser($db);
|
$priceparser = new PriceParser($db);
|
||||||
$price_result = $priceparser->testExpression($id, $expression);
|
$price_result = $priceparser->testExpression($id, $expression);
|
||||||
if ($price_result < 0) { //Expression is not valid
|
if ($price_result < 0) { //Expression is not valid
|
||||||
setEventMessages($priceparser->translatedError(), null, 'errors');
|
setEventMessages($priceparser->translatedError(), null, 'errors');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -149,7 +149,7 @@ if ($action == 'delete')
|
|||||||
{
|
{
|
||||||
if ($eid != 0)
|
if ($eid != 0)
|
||||||
{
|
{
|
||||||
$price_expression->fetch($eid);
|
$price_expression->fetch($eid);
|
||||||
$result = $price_expression->delete($user);
|
$result = $price_expression->delete($user);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
@ -200,7 +200,7 @@ $help_text.= '<br><br>'.$langs->trans("PriceExpressionEditorHelp3");
|
|||||||
$help_text.= '<br><br>'.$langs->trans("PriceExpressionEditorHelp4");
|
$help_text.= '<br><br>'.$langs->trans("PriceExpressionEditorHelp4");
|
||||||
$help_text.= '<br><br>'.$langs->trans("PriceExpressionEditorHelp5");
|
$help_text.= '<br><br>'.$langs->trans("PriceExpressionEditorHelp5");
|
||||||
foreach ($price_globals->listGlobalVariables() as $entry) {
|
foreach ($price_globals->listGlobalVariables() as $entry) {
|
||||||
$help_text.= '<br><b>#globals_'.$entry->code.'#</b> '.$entry->description.' = '.$entry->value;
|
$help_text.= '<br><b>#globals_'.$entry->code.'#</b> '.$entry->description.' = '.$entry->value;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Price expression editor
|
//Price expression editor
|
||||||
|
|||||||
@ -61,15 +61,15 @@ $staticproduct=new Product($db);
|
|||||||
$helpurl='';
|
$helpurl='';
|
||||||
if ($type == '0')
|
if ($type == '0')
|
||||||
{
|
{
|
||||||
$helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
|
$helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
|
||||||
}
|
}
|
||||||
elseif ($type == '1')
|
elseif ($type == '1')
|
||||||
{
|
{
|
||||||
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
||||||
}
|
}
|
||||||
$title=$langs->trans("Statistics");
|
$title=$langs->trans("Statistics");
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ $sql.= " GROUP BY p.rowid, p.label, p.ref, p.fk_product_type";
|
|||||||
$result=$db->query($sql);
|
$result=$db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$totalnboflines = $db->num_rows($result);
|
$totalnboflines = $db->num_rows($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql.= $db->order($sortfield, $sortorder);
|
$sql.= $db->order($sortfield, $sortorder);
|
||||||
@ -139,23 +139,23 @@ $sql.= $db->plimit($limit+1, $offset);
|
|||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($resql);
|
$objp = $db->fetch_object($resql);
|
||||||
|
|
||||||
$infoprod[$objp->rowid]=array('type'=>$objp->type, 'ref'=>$objp->ref, 'label'=>$objp->label);
|
$infoprod[$objp->rowid]=array('type'=>$objp->type, 'ref'=>$objp->ref, 'label'=>$objp->label);
|
||||||
$infoprod[$objp->rowid]['nblineproposal']=$objp->c;
|
$infoprod[$objp->rowid]['nblineproposal']=$objp->c;
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
//var_dump($infoprod);
|
//var_dump($infoprod);
|
||||||
|
|
||||||
|
|||||||
@ -32,45 +32,45 @@ require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.commande.class.php';
|
|||||||
*/
|
*/
|
||||||
function dolDispatchToDo($order_id)
|
function dolDispatchToDo($order_id)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$dispatched = array();
|
$dispatched = array();
|
||||||
$ordered = array();
|
$ordered = array();
|
||||||
|
|
||||||
// Count nb of quantity dispatched per product
|
// Count nb of quantity dispatched per product
|
||||||
$sql = 'SELECT fk_product, SUM(qty) FROM ' . MAIN_DB_PREFIX . 'commande_fournisseur_dispatch';
|
$sql = 'SELECT fk_product, SUM(qty) FROM ' . MAIN_DB_PREFIX . 'commande_fournisseur_dispatch';
|
||||||
$sql.= ' WHERE fk_commande = ' . $order_id;
|
$sql.= ' WHERE fk_commande = ' . $order_id;
|
||||||
$sql.= ' GROUP BY fk_product';
|
$sql.= ' GROUP BY fk_product';
|
||||||
$sql.= ' ORDER by fk_product';
|
$sql.= ' ORDER by fk_product';
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql && $db->num_rows($resql))
|
if ($resql && $db->num_rows($resql))
|
||||||
{
|
{
|
||||||
while ($obj = $db->fetch_object($resql))
|
while ($obj = $db->fetch_object($resql))
|
||||||
$dispatched[$obj->fk_product] = $obj;
|
$dispatched[$obj->fk_product] = $obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Count nb of quantity to dispatch per product
|
// Count nb of quantity to dispatch per product
|
||||||
$sql = 'SELECT fk_product, SUM(qty) FROM ' . MAIN_DB_PREFIX . 'commande_fournisseurdet';
|
$sql = 'SELECT fk_product, SUM(qty) FROM ' . MAIN_DB_PREFIX . 'commande_fournisseurdet';
|
||||||
$sql.= ' WHERE fk_commande = ' . $order_id;
|
$sql.= ' WHERE fk_commande = ' . $order_id;
|
||||||
$sql.= ' AND fk_product > 0';
|
$sql.= ' AND fk_product > 0';
|
||||||
if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql.= ' AND product_type = 0';
|
if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql.= ' AND product_type = 0';
|
||||||
$sql.= ' GROUP BY fk_product';
|
$sql.= ' GROUP BY fk_product';
|
||||||
$sql.= ' ORDER by fk_product';
|
$sql.= ' ORDER by fk_product';
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql && $db->num_rows($resql))
|
if ($resql && $db->num_rows($resql))
|
||||||
{
|
{
|
||||||
while ($obj = $db->fetch_object($resql))
|
while ($obj = $db->fetch_object($resql))
|
||||||
$ordered[$obj->fk_product] = $obj;
|
$ordered[$obj->fk_product] = $obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
$todispatch=0;
|
$todispatch=0;
|
||||||
foreach ($ordered as $key => $val)
|
foreach ($ordered as $key => $val)
|
||||||
{
|
{
|
||||||
if ($ordered[$key] > $dispatched[$key]) $todispatch++;
|
if ($ordered[$key] > $dispatched[$key]) $todispatch++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ($todispatch ? true : false);
|
return ($todispatch ? true : false);
|
||||||
//return true;
|
//return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -80,30 +80,30 @@ function dolDispatchToDo($order_id)
|
|||||||
*/
|
*/
|
||||||
function dispatchedOrders()
|
function dispatchedOrders()
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$sql = 'SELECT rowid FROM ' . MAIN_DB_PREFIX . 'commande_fournisseur';
|
$sql = 'SELECT rowid FROM ' . MAIN_DB_PREFIX . 'commande_fournisseur';
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
$resarray = array();
|
$resarray = array();
|
||||||
if ($resql && $db->num_rows($resql) > 0)
|
if ($resql && $db->num_rows($resql) > 0)
|
||||||
{
|
{
|
||||||
while ($obj = $db->fetch_object($resql))
|
while ($obj = $db->fetch_object($resql))
|
||||||
{
|
{
|
||||||
if (! dolDispatchToDo($obj->rowid))
|
if (! dolDispatchToDo($obj->rowid))
|
||||||
{
|
{
|
||||||
$resarray[] = $obj->rowid;
|
$resarray[] = $obj->rowid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($resarray))
|
if (count($resarray))
|
||||||
{
|
{
|
||||||
$res = '(' . implode(',', $resarray) . ')';
|
$res = '(' . implode(',', $resarray) . ')';
|
||||||
} else {
|
} else {
|
||||||
//hack to make sure ordered SQL request won't syntax error
|
//hack to make sure ordered SQL request won't syntax error
|
||||||
$res = '(0)';
|
$res = '(0)';
|
||||||
}
|
}
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -159,16 +159,16 @@ function ordered($product_id)
|
|||||||
*/
|
*/
|
||||||
function getProducts($order_id)
|
function getProducts($order_id)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
$order = new CommandeFournisseur($db);
|
$order = new CommandeFournisseur($db);
|
||||||
$f = $order->fetch($order_id);
|
$f = $order->fetch($order_id);
|
||||||
$products = array();
|
$products = array();
|
||||||
if($f) {
|
if($f) {
|
||||||
foreach($order->lines as $line) {
|
foreach($order->lines as $line) {
|
||||||
if (!in_array($line->fk_product, $products)) {
|
if (!in_array($line->fk_product, $products)) {
|
||||||
$products[] = $line->fk_product;
|
$products[] = $line->fk_product;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $products;
|
return $products;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,7 +51,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu
|
|||||||
if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
|
if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
|
||||||
|
|
||||||
if ($id > 0 || ! empty($ref)) {
|
if ($id > 0 || ! empty($ref)) {
|
||||||
$upload_dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
$upload_dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get parameters
|
// Get parameters
|
||||||
@ -94,11 +94,11 @@ if ($object->id > 0)
|
|||||||
{
|
{
|
||||||
$upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
$upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||||
|
|
||||||
// To verify role of users
|
// To verify role of users
|
||||||
//$userAccess = $object->restrictedProjectArea($user,'read');
|
//$userAccess = $object->restrictedProjectArea($user,'read');
|
||||||
$userWrite = $object->restrictedProjectArea($user, 'write');
|
$userWrite = $object->restrictedProjectArea($user, 'write');
|
||||||
//$userDelete = $object->restrictedProjectArea($user,'delete');
|
//$userDelete = $object->restrictedProjectArea($user,'delete');
|
||||||
//print "userAccess=".$userAccess." userWrite=".$userWrite." userDelete=".$userDelete;
|
//print "userAccess=".$userAccess." userWrite=".$userWrite." userDelete=".$userDelete;
|
||||||
|
|
||||||
$head = project_prepare_head($object);
|
$head = project_prepare_head($object);
|
||||||
dol_fiche_head($head, 'document', $langs->trans("Project"), -1, ($object->public?'projectpub':'project'));
|
dol_fiche_head($head, 'document', $langs->trans("Project"), -1, ($object->public?'projectpub':'project'));
|
||||||
@ -122,15 +122,15 @@ if ($object->id > 0)
|
|||||||
// Thirdparty
|
// Thirdparty
|
||||||
if ($object->thirdparty->id > 0)
|
if ($object->thirdparty->id > 0)
|
||||||
{
|
{
|
||||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1, 'project');
|
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1, 'project');
|
||||||
}
|
}
|
||||||
$morehtmlref.='</div>';
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
// Define a complementary filter for search of next/prev ref.
|
// Define a complementary filter for search of next/prev ref.
|
||||||
if (! $user->rights->projet->all->lire)
|
if (! $user->rights->projet->all->lire)
|
||||||
{
|
{
|
||||||
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
|
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
|
||||||
$object->next_prev_filter=" rowid in (".(count($objectsListId)?join(',', array_keys($objectsListId)):'0').")";
|
$object->next_prev_filter=" rowid in (".(count($objectsListId)?join(',', array_keys($objectsListId)):'0').")";
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||||
|
|||||||
@ -171,58 +171,58 @@ else
|
|||||||
function constructGanttLine($tarr, $task, $task_dependencies, $level = 0, $project_id = null)
|
function constructGanttLine($tarr, $task, $task_dependencies, $level = 0, $project_id = null)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
global $dateformatinput2;
|
global $dateformatinput2;
|
||||||
|
|
||||||
$start_date = $task["task_start_date"];
|
$start_date = $task["task_start_date"];
|
||||||
$end_date = $task["task_end_date"];
|
$end_date = $task["task_end_date"];
|
||||||
if (!$end_date) $end_date = $start_date;
|
if (!$end_date) $end_date = $start_date;
|
||||||
$start_date = dol_print_date($start_date, $dateformatinput2);
|
$start_date = dol_print_date($start_date, $dateformatinput2);
|
||||||
$end_date = dol_print_date($end_date, $dateformatinput2);
|
$end_date = dol_print_date($end_date, $dateformatinput2);
|
||||||
// Resources
|
// Resources
|
||||||
$resources = $task["task_resources"];
|
$resources = $task["task_resources"];
|
||||||
// Define depend (ex: "", "4,13", ...)
|
// Define depend (ex: "", "4,13", ...)
|
||||||
$depend = '';
|
$depend = '';
|
||||||
$count = 0;
|
$count = 0;
|
||||||
foreach ($task_dependencies as $value) {
|
foreach ($task_dependencies as $value) {
|
||||||
// Not yet used project_dependencies = array(array(0=>idtask,1=>idtasktofinishfisrt))
|
// Not yet used project_dependencies = array(array(0=>idtask,1=>idtasktofinishfisrt))
|
||||||
if ($value[0] == $task['task_id']) {
|
if ($value[0] == $task['task_id']) {
|
||||||
$depend.=($count>0?",":"").$value[1];
|
$depend.=($count>0?",":"").$value[1];
|
||||||
$count ++;
|
$count ++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// $depend .= "\"";
|
// $depend .= "\"";
|
||||||
// Define parent
|
// Define parent
|
||||||
if ($project_id && $level < 0)
|
if ($project_id && $level < 0)
|
||||||
{
|
{
|
||||||
$parent = '-'.$project_id;
|
$parent = '-'.$project_id;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$parent = $task["task_parent_alternate_id"];
|
$parent = $task["task_parent_alternate_id"];
|
||||||
//$parent = $task["task_parent"];
|
//$parent = $task["task_parent"];
|
||||||
}
|
}
|
||||||
// Define percent
|
// Define percent
|
||||||
$percent = $task['task_percent_complete']?$task['task_percent_complete']:0;
|
$percent = $task['task_percent_complete']?$task['task_percent_complete']:0;
|
||||||
// Link (more information)
|
// Link (more information)
|
||||||
if ($task["task_id"] < 0)
|
if ($task["task_id"] < 0)
|
||||||
{
|
{
|
||||||
//$link=DOL_URL_ROOT.'/projet/tasks.php?withproject=1&id='.abs($task["task_id"]);
|
//$link=DOL_URL_ROOT.'/projet/tasks.php?withproject=1&id='.abs($task["task_id"]);
|
||||||
$link='';
|
$link='';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$link=DOL_URL_ROOT.'/projet/tasks/contact.php?withproject=1&id='.$task["task_id"];
|
$link=DOL_URL_ROOT.'/projet/tasks/contact.php?withproject=1&id='.$task["task_id"];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Name
|
// Name
|
||||||
//$name='<a href="'.DOL_URL_ROOT.'/projet/task/tasks.php?id='.$task['task_id'].'">'.$task['task_name'].'</a>';
|
//$name='<a href="'.DOL_URL_ROOT.'/projet/task/tasks.php?id='.$task['task_id'].'">'.$task['task_name'].'</a>';
|
||||||
$name=$task['task_name'];
|
$name=$task['task_name'];
|
||||||
|
|
||||||
/*for($i=0; $i < $level; $i++) {
|
/*for($i=0; $i < $level; $i++) {
|
||||||
$name=' - '.$name;
|
$name=' - '.$name;
|
||||||
}*/
|
}*/
|
||||||
// Add line to gantt
|
// Add line to gantt
|
||||||
/*
|
/*
|
||||||
g.AddTaskItem(new JSGantt.TaskItem(1, 'Define Chart API','', '', 'ggroupblack','', 0, 'Brian', 0, 1,0,1,'','','Some Notes text',g));
|
g.AddTaskItem(new JSGantt.TaskItem(1, 'Define Chart API','', '', 'ggroupblack','', 0, 'Brian', 0, 1,0,1,'','','Some Notes text',g));
|
||||||
g.AddTaskItem(new JSGantt.TaskItem(11,'Chart Object', '2014-02-20','2014-02-20','gmilestone', '', 1, 'Shlomy',100,0,1,1,'','','',g));
|
g.AddTaskItem(new JSGantt.TaskItem(11,'Chart Object', '2014-02-20','2014-02-20','gmilestone', '', 1, 'Shlomy',100,0,1,1,'','','',g));
|
||||||
</pre>
|
</pre>
|
||||||
@ -247,30 +247,30 @@ function constructGanttLine($tarr, $task, $task_dependencies, $level = 0, $proje
|
|||||||
<dt>pGantt</dt><dd>(required) javascript JSGantt.GanttChart object from which to take settings. Defaults to "g" for backwards compatibility</dd>
|
<dt>pGantt</dt><dd>(required) javascript JSGantt.GanttChart object from which to take settings. Defaults to "g" for backwards compatibility</dd>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//$note="";
|
//$note="";
|
||||||
|
|
||||||
$s = "\n// Add task level = ".$level." id=".$task["task_id"]." parent_id=".$task["task_parent"]." aternate_id=".$task["task_alternate_id"]." parent_aternate_id=".$task["task_parent_alternate_id"]."\n";
|
$s = "\n// Add task level = ".$level." id=".$task["task_id"]." parent_id=".$task["task_parent"]." aternate_id=".$task["task_alternate_id"]." parent_aternate_id=".$task["task_parent_alternate_id"]."\n";
|
||||||
|
|
||||||
//$task["task_is_group"]=1; // When task_is_group is 1, content will be autocalculated from sum of all low tasks
|
//$task["task_is_group"]=1; // When task_is_group is 1, content will be autocalculated from sum of all low tasks
|
||||||
|
|
||||||
// For JSGanttImproved
|
// For JSGanttImproved
|
||||||
$css = $task['task_css'];
|
$css = $task['task_css'];
|
||||||
$line_is_auto_group = $task["task_is_group"];
|
$line_is_auto_group = $task["task_is_group"];
|
||||||
//$line_is_auto_group=0;
|
//$line_is_auto_group=0;
|
||||||
//if ($line_is_auto_group) $css = 'ggroupblack';
|
//if ($line_is_auto_group) $css = 'ggroupblack';
|
||||||
//$dependency = ($depend?$depend:$parent."SS");
|
//$dependency = ($depend?$depend:$parent."SS");
|
||||||
$dependency = '';
|
$dependency = '';
|
||||||
//$name = str_repeat("..", $level).$name;
|
//$name = str_repeat("..", $level).$name;
|
||||||
|
|
||||||
$taskid = $task["task_alternate_id"];
|
$taskid = $task["task_alternate_id"];
|
||||||
//$taskid = $task['task_id'];
|
//$taskid = $task['task_id'];
|
||||||
|
|
||||||
$note = $task['note'];
|
$note = $task['note'];
|
||||||
|
|
||||||
$note = dol_concatdesc($note, $langs->trans("Workload").' : '.($task['task_planned_workload'] ? convertSecondToTime($task['task_planned_workload'], 'allhourmin') : ''));
|
$note = dol_concatdesc($note, $langs->trans("Workload").' : '.($task['task_planned_workload'] ? convertSecondToTime($task['task_planned_workload'], 'allhourmin') : ''));
|
||||||
|
|
||||||
$s.= "g.AddTaskItem(new JSGantt.TaskItem('".$taskid."', '".dol_escape_js(trim($name))."', '".$start_date."', '".$end_date."', '".$css."', '".$link."', ".$task['task_milestone'].", '".dol_escape_js($resources)."', ".($percent >= 0 ? $percent : 0).", ".$line_is_auto_group.", '".$parent."', 1, '".$dependency."', '".(empty($task["task_is_group"]) ? (($percent >= 0 && $percent != '') ? $percent.'%' : '') : '')."', '".dol_escape_js($note)."', g));";
|
$s.= "g.AddTaskItem(new JSGantt.TaskItem('".$taskid."', '".dol_escape_js(trim($name))."', '".$start_date."', '".$end_date."', '".$css."', '".$link."', ".$task['task_milestone'].", '".dol_escape_js($resources)."', ".($percent >= 0 ? $percent : 0).", ".$line_is_auto_group.", '".$parent."', 1, '".$dependency."', '".(empty($task["task_is_group"]) ? (($percent >= 0 && $percent != '') ? $percent.'%' : '') : '')."', '".dol_escape_js($note)."', g));";
|
||||||
echo $s;
|
echo $s;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -284,15 +284,15 @@ function constructGanttLine($tarr, $task, $task_dependencies, $level = 0, $proje
|
|||||||
*/
|
*/
|
||||||
function findChildGanttLine($tarr, $parent, $task_dependencies, $level)
|
function findChildGanttLine($tarr, $parent, $task_dependencies, $level)
|
||||||
{
|
{
|
||||||
$n=count($tarr);
|
$n=count($tarr);
|
||||||
|
|
||||||
$old_parent_id = 0;
|
$old_parent_id = 0;
|
||||||
for ($x=0; $x < $n; $x++)
|
for ($x=0; $x < $n; $x++)
|
||||||
{
|
{
|
||||||
if($tarr[$x]["task_parent"] == $parent && $tarr[$x]["task_parent"] != $tarr[$x]["task_id"])
|
if($tarr[$x]["task_parent"] == $parent && $tarr[$x]["task_parent"] != $tarr[$x]["task_id"])
|
||||||
{
|
{
|
||||||
// Create a grouping parent task for the new level
|
// Create a grouping parent task for the new level
|
||||||
/*if (empty($old_parent_id) || $old_parent_id != $tarr[$x]['task_project_id'])
|
/*if (empty($old_parent_id) || $old_parent_id != $tarr[$x]['task_project_id'])
|
||||||
{
|
{
|
||||||
$tmpt = array(
|
$tmpt = array(
|
||||||
'task_id'=> -98, 'task_name'=>'Level '.$level, 'task_resources'=>'', 'task_start_date'=>'', 'task_end_date'=>'',
|
'task_id'=> -98, 'task_name'=>'Level '.$level, 'task_resources'=>'', 'task_start_date'=>'', 'task_end_date'=>'',
|
||||||
@ -301,9 +301,9 @@ function findChildGanttLine($tarr, $parent, $task_dependencies, $level)
|
|||||||
$old_parent_id = $tarr[$x]['task_project_id'];
|
$old_parent_id = $tarr[$x]['task_project_id'];
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
constructGanttLine($tarr, $tarr[$x], $task_dependencies, $level, null);
|
constructGanttLine($tarr, $tarr[$x], $task_dependencies, $level, null);
|
||||||
findChildGanttLine($tarr, $tarr[$x]["task_id"], $task_dependencies, $level+1);
|
findChildGanttLine($tarr, $tarr[$x]["task_id"], $task_dependencies, $level+1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,7 @@ if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defi
|
|||||||
*/
|
*/
|
||||||
function llxHeaderVierge()
|
function llxHeaderVierge()
|
||||||
{
|
{
|
||||||
print '<html><title>Export agenda cal</title><body>';
|
print '<html><title>Export agenda cal</title><body>';
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Footer function
|
* Footer function
|
||||||
@ -55,7 +55,7 @@ function llxHeaderVierge()
|
|||||||
*/
|
*/
|
||||||
function llxFooterVierge()
|
function llxFooterVierge()
|
||||||
{
|
{
|
||||||
print '</body></html>';
|
print '</body></html>';
|
||||||
}
|
}
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
@ -129,12 +129,12 @@ $filename=$shortfilename;
|
|||||||
// Complete long filename
|
// Complete long filename
|
||||||
foreach ($filters as $key => $value)
|
foreach ($filters as $key => $value)
|
||||||
{
|
{
|
||||||
//if ($key == 'notolderthan') $filename.='-notolderthan'.$value; This filter key is already added before and does not need to be in filename
|
//if ($key == 'notolderthan') $filename.='-notolderthan'.$value; This filter key is already added before and does not need to be in filename
|
||||||
if ($key == 'year') $filename.='-year'.$value;
|
if ($key == 'year') $filename.='-year'.$value;
|
||||||
if ($key == 'id') $filename.='-id'.$value;
|
if ($key == 'id') $filename.='-id'.$value;
|
||||||
if ($key == 'idfrom') $filename.='-idfrom'.$value;
|
if ($key == 'idfrom') $filename.='-idfrom'.$value;
|
||||||
if ($key == 'idto') $filename.='-idto'.$value;
|
if ($key == 'idto') $filename.='-idto'.$value;
|
||||||
if ($key == 'project') $filename.='-project'.$value;
|
if ($key == 'project') $filename.='-project'.$value;
|
||||||
if ($key == 'logina') $filename.='-logina'.$value; // Author
|
if ($key == 'logina') $filename.='-logina'.$value; // Author
|
||||||
if ($key == 'logint') $filename.='-logint'.$value; // Assigned to
|
if ($key == 'logint') $filename.='-logint'.$value; // Assigned to
|
||||||
if ($key == 'notactiontype') $filename.='-notactiontype'.$value;
|
if ($key == 'notactiontype') $filename.='-notactiontype'.$value;
|
||||||
@ -149,7 +149,7 @@ if ($shortfilename=='dolibarrcalendar')
|
|||||||
$langs->load("main");
|
$langs->load("main");
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
llxHeaderVierge();
|
llxHeaderVierge();
|
||||||
print '<div class="error">'.$langs->trans("ErrorWrongValueForParameterX", 'format').'</div>';
|
print '<div class="error">'.$langs->trans("ErrorWrongValueForParameterX", 'format').'</div>';
|
||||||
llxFooterVierge();
|
llxFooterVierge();
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -186,7 +186,7 @@ if ($format == 'ical' || $format == 'vcal')
|
|||||||
$result=readfile($outputfile);
|
$result=readfile($outputfile);
|
||||||
if (! $result) print 'File '.$outputfile.' was empty.';
|
if (! $result) print 'File '.$outputfile.' was empty.';
|
||||||
|
|
||||||
//header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename));
|
//header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -81,7 +81,7 @@ if (! empty($tag))
|
|||||||
|
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
|
|
||||||
//Update status communication of contact prospect
|
//Update status communication of contact prospect
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=3 WHERE fk_stcomm != -1 AND rowid IN (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."socpeople AS sc INNER JOIN ".MAIN_DB_PREFIX."mailing_cibles AS mc ON mc.tag = '".$db->escape($tag)."' AND mc.source_type = 'contact' AND mc.source_id = sc.rowid)";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=3 WHERE fk_stcomm != -1 AND rowid IN (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."socpeople AS sc INNER JOIN ".MAIN_DB_PREFIX."mailing_cibles AS mc ON mc.tag = '".$db->escape($tag)."' AND mc.source_type = 'contact' AND mc.source_id = sc.rowid)";
|
||||||
dol_syslog("public/emailing/mailing-read.php : Mail read contact : ".$sql, LOG_DEBUG);
|
dol_syslog("public/emailing/mailing-read.php : Mail read contact : ".$sql, LOG_DEBUG);
|
||||||
|
|
||||||
|
|||||||
@ -152,7 +152,7 @@ function llxHeaderVierge($title, $head = "")
|
|||||||
*/
|
*/
|
||||||
function llxFooterVierge()
|
function llxFooterVierge()
|
||||||
{
|
{
|
||||||
printCommonFooter('public');
|
printCommonFooter('public');
|
||||||
|
|
||||||
print "</body>\n";
|
print "</body>\n";
|
||||||
print "</html>\n";
|
print "</html>\n";
|
||||||
|
|||||||
@ -56,10 +56,10 @@ function llxHeaderVierge($title, $head = "")
|
|||||||
|
|
||||||
header("Content-type: text/html; charset=".$conf->file->character_set_client);
|
header("Content-type: text/html; charset=".$conf->file->character_set_client);
|
||||||
print "<html>\n";
|
print "<html>\n";
|
||||||
print "<head>\n";
|
print "<head>\n";
|
||||||
print "<title>".$title."</title>\n";
|
print "<title>".$title."</title>\n";
|
||||||
if ($head) print $head."\n";
|
if ($head) print $head."\n";
|
||||||
print "</head>\n";
|
print "</head>\n";
|
||||||
print '<body class="public_body">'."\n";
|
print '<body class="public_body">'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,9 +70,9 @@ function llxHeaderVierge($title, $head = "")
|
|||||||
*/
|
*/
|
||||||
function llxFooterVierge()
|
function llxFooterVierge()
|
||||||
{
|
{
|
||||||
printCommonFooter('public');
|
printCommonFooter('public');
|
||||||
|
|
||||||
print "</body>\n";
|
print "</body>\n";
|
||||||
print "</html>\n";
|
print "</html>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -36,14 +36,14 @@ require '../main.inc.php';
|
|||||||
|
|
||||||
if (! GETPOST('transkey', 'alphanohtml') && ! GETPOST('transphrase', 'alphanohtml'))
|
if (! GETPOST('transkey', 'alphanohtml') && ! GETPOST('transphrase', 'alphanohtml'))
|
||||||
{
|
{
|
||||||
print 'Sorry, it seems your internet connexion is off.<br>';
|
print 'Sorry, it seems your internet connexion is off.<br>';
|
||||||
print 'You need to be connected to network to use this software.<br>';
|
print 'You need to be connected to network to use this software.<br>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$langs->load("error");
|
$langs->load("error");
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
|
|
||||||
if (GETPOST('transphrase', 'alphanohtml')) print GETPOST('transphrase', 'alphanohtml');
|
if (GETPOST('transphrase', 'alphanohtml')) print GETPOST('transphrase', 'alphanohtml');
|
||||||
if (GETPOST('transkey', 'alphanohtml')) print $langs->trans(GETPOST('transkey', 'alphanohtml'));
|
if (GETPOST('transkey', 'alphanohtml')) print $langs->trans(GETPOST('transkey', 'alphanohtml'));
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user