Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
20c1e29d72
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -29,10 +29,11 @@ include_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php");
|
||||
|
||||
$langs->load("admin");
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
$rowid = GETPOST('rowid','int');
|
||||
$action = GETPOST('action');
|
||||
$action = GETPOST('action','alpha');
|
||||
$errmesg='';
|
||||
|
||||
// Definition des positions possibles pour les boites
|
||||
$pos_array = array(0); // Positions possibles pour une boite (0,1,2,...)
|
||||
@ -396,7 +397,7 @@ foreach($boxactivated as $key => $box)
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.img_object("",$logo).' '.$box->boxlabel.'</td>';
|
||||
print '<td>' . ($box->note?$box->note:' ') . '</td>';
|
||||
print '<td align="center">' . $pos_name[$box->position] . '</td>';
|
||||
print '<td align="center">' . (isset($pos_name[$box->position])?$pos_name[$box->position]:'') . '</td>';
|
||||
$hasnext=($key < (count($boxactivated)-1));
|
||||
$hasprevious=($key != 0);
|
||||
print '<td align="center">'.($key+1).'</td>';
|
||||
|
||||
@ -39,7 +39,9 @@ $action=GETPOST('action');
|
||||
$langs->load("admin");
|
||||
$langs->load("companies");
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
$message='';
|
||||
|
||||
|
||||
/*
|
||||
@ -324,7 +326,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Barcode
|
||||
if ($conf->barcode->enabled)
|
||||
if (! empty($conf->barcode->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("Gencod").'</td><td>';
|
||||
@ -338,7 +340,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<table width="100%" class="nocellnopadd"><tr class="nocellnopadd"><td valign="middle" class="nocellnopadd">';
|
||||
print '<input type="file" class="flat" name="logo" size="50">';
|
||||
print '</td><td valign="middle" align="right">';
|
||||
if ($mysoc->logo_mini)
|
||||
if (! empty($mysoc->logo_mini))
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete")).'</a>';
|
||||
if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
|
||||
@ -357,7 +359,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
// Note
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td valign="top">'.$langs->trans("Note").'</td><td>';
|
||||
print '<textarea class="flat" name="note" cols="80" rows="'.ROWS_5.'">'.$conf->global->MAIN_INFO_SOCIETE_NOTE.'</textarea></td></tr>';
|
||||
print '<textarea class="flat" name="note" cols="80" rows="'.ROWS_5.'">'.(! empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? $conf->global->MAIN_INFO_SOCIETE_NOTE : '').'</textarea></td></tr>';
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
@ -394,9 +396,9 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->transcountry("ProfId1",$mysoc->country_code).'</td><td>';
|
||||
if ($mysoc->country_code)
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
print '<input name="siren" size="20" value="' . $conf->global->MAIN_INFO_SIREN . '">';
|
||||
print '<input name="siren" size="20" value="' . (! empty($conf->global->MAIN_INFO_SIREN) ? $conf->global->MAIN_INFO_SIREN : '') . '">';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -410,9 +412,9 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->transcountry("ProfId2",$mysoc->country_code).'</td><td>';
|
||||
if ($mysoc->country_code)
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
print '<input name="siret" size="20" value="' . $conf->global->MAIN_INFO_SIRET . '">';
|
||||
print '<input name="siret" size="20" value="' . (! empty($conf->global->MAIN_INFO_SIRET) ? $conf->global->MAIN_INFO_SIRET : '' ) . '">';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -426,9 +428,9 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->transcountry("ProfId3",$mysoc->country_code).'</td><td>';
|
||||
if ($mysoc->country_code)
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
print '<input name="ape" size="20" value="' . $conf->global->MAIN_INFO_APE . '">';
|
||||
print '<input name="ape" size="20" value="' . (! empty($conf->global->MAIN_INFO_APE) ? $conf->global->MAIN_INFO_APE : '') . '">';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -442,9 +444,9 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->transcountry("ProfId4",$mysoc->country_code).'</td><td>';
|
||||
if ($mysoc->country_code)
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
print '<input name="rcs" size="20" value="' . $conf->global->MAIN_INFO_RCS . '">';
|
||||
print '<input name="rcs" size="20" value="' . (! empty($conf->global->MAIN_INFO_RCS) ? $conf->global->MAIN_INFO_RCS : '') . '">';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -458,9 +460,9 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->transcountry("ProfId5",$mysoc->country_code).'</td><td>';
|
||||
if ($mysoc->country_code)
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
print '<input name="MAIN_INFO_PROFID5" size="20" value="' . $conf->global->MAIN_INFO_PROFID5 . '">';
|
||||
print '<input name="MAIN_INFO_PROFID5" size="20" value="' . (! empty($conf->global->MAIN_INFO_PROFID5) ? $conf->global->MAIN_INFO_PROFID5 : '') . '">';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -474,9 +476,9 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->transcountry("ProfId6",$mysoc->country_code).'</td><td>';
|
||||
if ($mysoc->country_code)
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
print '<input name="MAIN_INFO_PROFID6" size="20" value="' . $conf->global->MAIN_INFO_PROFID6 . '">';
|
||||
print '<input name="MAIN_INFO_PROFID6" size="20" value="' . (! empty($conf->global->MAIN_INFO_PROFID6) ? $conf->global->MAIN_INFO_PROFID6 : '') . '">';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -488,7 +490,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
// TVA Intra
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("VATIntra").'</td><td>';
|
||||
print '<input name="tva" size="20" value="' . $conf->global->MAIN_INFO_TVAINTRA . '">';
|
||||
print '<input name="tva" size="20" value="' . (! empty($conf->global->MAIN_INFO_TVAINTRA) ? $conf->global->MAIN_INFO_TVAINTRA : '') . '">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
@ -683,7 +685,7 @@ else
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("Web").'</td><td>' . dol_print_url($conf->global->MAIN_INFO_SOCIETE_WEB,'_blank',80) . '</td></tr>';
|
||||
|
||||
// Barcode
|
||||
if ($conf->barcode->enabled)
|
||||
if (! empty($conf->barcode->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("Gencod").'</td><td>' . $conf->global->MAIN_INFO_SOCIETE_GENCOD . '</td></tr>';
|
||||
@ -715,7 +717,7 @@ else
|
||||
print '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%" valign="top">'.$langs->trans("Note").'</td><td>' . nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) . '</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td width="35%" valign="top">'.$langs->trans("Note").'</td><td>' . (! empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) : '') . '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -746,10 +748,12 @@ else
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->transcountry("ProfId1",$mysoc->country_code).'</td><td>';
|
||||
if ($langs->transcountry("ProfId1",$mysoc->country_code) != '-')
|
||||
if (! empty($conf->global->MAIN_INFO_SIREN))
|
||||
{
|
||||
print $conf->global->MAIN_INFO_SIREN;
|
||||
if ($conf->global->MAIN_INFO_SIREN && $mysoc->country_code == 'FR') print ' <a href="http://avis-situation-sirene.insee.fr/avisitu/jsp/avis.jsp" target="_blank">'.$langs->trans("Check").'</a>';
|
||||
if ($mysoc->country_code == 'FR') print ' <a href="http://avis-situation-sirene.insee.fr/avisitu/jsp/avis.jsp" target="_blank">'.$langs->trans("Check").'</a>';
|
||||
} else {
|
||||
print ' ';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -759,9 +763,11 @@ else
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->transcountry("ProfId2",$mysoc->country_code).'</td><td>';
|
||||
if ($langs->transcountry("ProfId2",$mysoc->country_code) != '-')
|
||||
if (! empty($conf->global->MAIN_INFO_SIRET))
|
||||
{
|
||||
print $conf->global->MAIN_INFO_SIRET;
|
||||
} else {
|
||||
print ' ';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -771,9 +777,11 @@ else
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->transcountry("ProfId3",$mysoc->country_code).'</td><td>';
|
||||
if ($langs->transcountry("ProfId3",$mysoc->country_code) != '-')
|
||||
if (! empty($conf->global->MAIN_INFO_APE))
|
||||
{
|
||||
print $conf->global->MAIN_INFO_APE;
|
||||
} else {
|
||||
print ' ';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -783,9 +791,11 @@ else
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->transcountry("ProfId4",$mysoc->country_code).'</td><td>';
|
||||
if ($langs->transcountry("ProfId4",$mysoc->country_code) != '-')
|
||||
if (! empty($conf->global->MAIN_INFO_RCS))
|
||||
{
|
||||
print $conf->global->MAIN_INFO_RCS;
|
||||
} else {
|
||||
print ' ';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -795,9 +805,11 @@ else
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->transcountry("ProfId5",$mysoc->country_code).'</td><td>';
|
||||
if ($langs->transcountry("ProfId5",$mysoc->country_code) != '-')
|
||||
if (! empty($conf->global->MAIN_INFO_PROFID5))
|
||||
{
|
||||
print $conf->global->MAIN_INFO_PROFID5;
|
||||
} else {
|
||||
print ' ';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -807,9 +819,11 @@ else
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->transcountry("ProfId6",$mysoc->country_code).'</td><td>';
|
||||
if ($langs->transcountry("ProfId6",$mysoc->country_code) != '-')
|
||||
if (! empty($conf->global->MAIN_INFO_PROFID6))
|
||||
{
|
||||
print $conf->global->MAIN_INFO_PROFID6;
|
||||
} else {
|
||||
print ' ';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -818,7 +832,7 @@ else
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("VATIntra").'</td>';
|
||||
print '<td>';
|
||||
if ($conf->global->MAIN_INFO_TVAINTRA)
|
||||
if (! empty($conf->global->MAIN_INFO_TVAINTRA))
|
||||
{
|
||||
$s='';
|
||||
$s.=$conf->global->MAIN_INFO_TVAINTRA;
|
||||
@ -826,7 +840,7 @@ else
|
||||
if (empty($conf->global->MAIN_DISABLEVATCHECK))
|
||||
{
|
||||
$s.=' ';
|
||||
if ($conf->use_javascript_ajax)
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print "\n";
|
||||
print '<script language="JavaScript" type="text/javascript">';
|
||||
|
||||
@ -33,9 +33,11 @@ $langs->load("contracts");
|
||||
$langs->load("bills");
|
||||
$langs->load("banks");
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
if ( (isset($_POST["action"]) && $_POST["action"] == 'update'))
|
||||
$action=GETPOST('action','alpha');
|
||||
|
||||
if ($action == 'update')
|
||||
{
|
||||
//Conversion des jours en secondes
|
||||
if ($_POST["ActionsToDo"]) dolibarr_set_const($db, "MAIN_DELAY_ACTIONS_TODO",$_POST["ActionsToDo"],'chaine',0,'',$conf->entity);
|
||||
@ -71,7 +73,7 @@ $form = new Form($db);
|
||||
$countrynotdefined='<font class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</font>';
|
||||
|
||||
|
||||
if ((isset($_GET["action"]) && $_GET["action"] == 'edit'))
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<form method="post" action="delais.php" name="form_index">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -82,7 +84,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit'))
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("DelaysOfToleranceBeforeWarning").'</td><td width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
//
|
||||
if ($conf->agenda->enabled)
|
||||
if (! empty($conf->agenda->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
@ -90,7 +92,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit'))
|
||||
print '<td>'.$langs->trans("DelaysOfToleranceActionsToDo").'</td><td>';
|
||||
print '<input size="5" name="ActionsToDo" value="'. ($conf->global->MAIN_DELAY_ACTIONS_TODO+0) . '"> ' . $langs->trans("days") . '</td></tr>';
|
||||
}
|
||||
if ($conf->commande->enabled)
|
||||
if (! empty($conf->commande->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
@ -98,7 +100,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit'))
|
||||
print '<td>'.$langs->trans("DelaysOfToleranceOrdersToProcess").'</td><td>';
|
||||
print '<input size="5" name="OrdersToProcess" value="'. ($conf->global->MAIN_DELAY_ORDERS_TO_PROCESS+0) . '"> ' . $langs->trans("days") . '</td></tr>';
|
||||
}
|
||||
if ($conf->fournisseur->enabled)
|
||||
if (! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
@ -106,7 +108,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit'))
|
||||
print '<td>'.$langs->trans("DelaysOfToleranceSuppliersOrdersToProcess").'</td><td>';
|
||||
print '<input size="5" name="SuppliersOrdersToProcess" value="'. ($conf->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS+0) . '"> ' . $langs->trans("days") . '</td></tr>';
|
||||
}
|
||||
if ($conf->propal->enabled)
|
||||
if (! empty($conf->propal->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
@ -114,7 +116,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit'))
|
||||
print '<td>'.$langs->trans("DelaysOfTolerancePropalsToClose").'</td><td>';
|
||||
print '<input size="5" name="PropalsToClose" value="'. ($conf->global->MAIN_DELAY_PROPALS_TO_CLOSE+0) . '"> ' . $langs->trans("days") . '</td></tr>';
|
||||
}
|
||||
if ($conf->propal->enabled)
|
||||
if (! empty($conf->propal->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
@ -122,7 +124,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit'))
|
||||
print '<td>'.$langs->trans("DelaysOfTolerancePropalsToBill").'</td><td>';
|
||||
print '<input size="5" name="PropalsToBill" value="'. ($conf->global->MAIN_DELAY_PROPALS_TO_BILL+0) . '"> ' . $langs->trans("days") . '</td></tr>';
|
||||
}
|
||||
if ($conf->service->enabled)
|
||||
if (! empty($conf->service->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
@ -130,7 +132,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit'))
|
||||
print '<td>'.$langs->trans("DelaysOfToleranceNotActivatedServices").'</td><td>';
|
||||
print '<input size="5" name="BoardNotActivatedServices" value="'. ($conf->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES+0) . '"> ' . $langs->trans("days") . '</td></tr>';
|
||||
}
|
||||
if ($conf->service->enabled)
|
||||
if (! empty($conf->service->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
@ -138,7 +140,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit'))
|
||||
print '<td>'.$langs->trans("DelaysOfToleranceRunningServices").'</td><td>';
|
||||
print '<input size="5" name="BoardRunningServices" value="'. ($conf->global->MAIN_DELAY_RUNNING_SERVICES +0). '"> ' . $langs->trans("days") . '</td></tr>';
|
||||
}
|
||||
if ($conf->facture->enabled)
|
||||
if (! empty($conf->facture->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
@ -146,7 +148,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit'))
|
||||
print '<td>'.$langs->trans("DelaysOfToleranceCustomerBillsUnpaid").'</td><td>';
|
||||
print '<input size="5" name="CustomerBillsUnpaid" value="'. ($conf->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED+0) . '"> ' . $langs->trans("days") . '</td></tr>';
|
||||
}
|
||||
if ($conf->fournisseur->enabled)
|
||||
if (! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
@ -154,7 +156,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit'))
|
||||
print '<td>'.$langs->trans("DelaysOfToleranceSupplierBillsToPay").'</td><td>';
|
||||
print '<input size="5" name="SupplierBillsToPay" value="'. ($conf->global->MAIN_DELAY_SUPPLIER_BILLS_TO_PAY+0) . '"> ' . $langs->trans("days") . '</td></tr>';
|
||||
}
|
||||
if ($conf->banque->enabled)
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
@ -167,7 +169,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit'))
|
||||
print '<td>'.$langs->trans("DelaysOfToleranceChequesToDeposit").'</td><td>';
|
||||
print '<input size="5" name="ChequesToDeposit" value="'. ($conf->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT+0) . '"> ' . $langs->trans("days") . '</td></tr>';
|
||||
}
|
||||
if ($conf->adherent->enabled)
|
||||
if (! empty($conf->adherent->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
@ -186,7 +188,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit'))
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td>' .$form->selectyesno('MAIN_DISABLE_METEO',$conf->global->MAIN_DISABLE_METEO,1) . '</td></tr>';
|
||||
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td>' .$form->selectyesno('MAIN_DISABLE_METEO',(isset($conf->global->MAIN_DISABLE_METEO)?1:0),1) . '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -209,14 +211,14 @@ else
|
||||
|
||||
$var=!$var;
|
||||
|
||||
if ($conf->agenda->enabled)
|
||||
if (! empty($conf->agenda->enabled))
|
||||
{
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td width="20px">'.img_object('','action').'</td>';
|
||||
print '<td>'.$langs->trans("DelaysOfToleranceActionsToDo").'</td><td>' . ($conf->global->MAIN_DELAY_ACTIONS_TODO+0) . ' ' . $langs->trans("days") . '</td></tr>';
|
||||
}
|
||||
|
||||
if ($conf->commande->enabled)
|
||||
if (! empty($conf->commande->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
@ -224,7 +226,7 @@ else
|
||||
print '<td>'.$langs->trans("DelaysOfToleranceOrdersToProcess").'</td><td>' . ($conf->global->MAIN_DELAY_ORDERS_TO_PROCESS+0) . ' ' . $langs->trans("days") . '</td></tr>';
|
||||
}
|
||||
|
||||
if ($conf->fournisseur->enabled)
|
||||
if (! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
@ -232,7 +234,7 @@ else
|
||||
print '<td>'.$langs->trans("DelaysOfToleranceSuppliersOrdersToProcess").'</td><td>' . ($conf->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS+0) . ' ' . $langs->trans("days") . '</td></tr>';
|
||||
}
|
||||
|
||||
if ($conf->propal->enabled)
|
||||
if (! empty($conf->propal->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
@ -240,7 +242,7 @@ else
|
||||
print '<td>'.$langs->trans("DelaysOfTolerancePropalsToClose").'</td><td>' . ($conf->global->MAIN_DELAY_PROPALS_TO_CLOSE+0). ' ' . $langs->trans("days") . '</td></tr>';
|
||||
}
|
||||
|
||||
if ($conf->propal->enabled)
|
||||
if (! empty($conf->propal->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
@ -248,7 +250,7 @@ else
|
||||
print '<td>'.$langs->trans("DelaysOfTolerancePropalsToBill").'</td><td>' . ($conf->global->MAIN_DELAY_PROPALS_TO_BILL+0) . ' ' . $langs->trans("days") . '</td></tr>';
|
||||
}
|
||||
|
||||
if ($conf->service->enabled)
|
||||
if (! empty($conf->service->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
@ -256,7 +258,7 @@ else
|
||||
print '<td>'.$langs->trans("DelaysOfToleranceNotActivatedServices").'</td><td>' . ($conf->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES+0) . ' ' . $langs->trans("days") . '</td></tr>';
|
||||
}
|
||||
|
||||
if ($conf->service->enabled)
|
||||
if (! empty($conf->service->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
@ -264,7 +266,7 @@ else
|
||||
print '<td>'.$langs->trans("DelaysOfToleranceRunningServices").'</td><td>' . ($conf->global->MAIN_DELAY_RUNNING_SERVICES+0). ' ' . $langs->trans("days") . '</td></tr>';
|
||||
}
|
||||
|
||||
if ($conf->facture->enabled)
|
||||
if (! empty($conf->facture->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
@ -272,7 +274,7 @@ else
|
||||
print '<td>'.$langs->trans("DelaysOfToleranceCustomerBillsUnpaid").'</td><td>' . ($conf->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED+0) . ' ' . $langs->trans("days") . '</td></tr>';
|
||||
}
|
||||
|
||||
if ($conf->fournisseur->enabled)
|
||||
if (! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
@ -280,7 +282,7 @@ else
|
||||
print '<td>'.$langs->trans("DelaysOfToleranceSupplierBillsToPay").'</td><td>' . ($conf->global->MAIN_DELAY_SUPPLIER_BILLS_TO_PAY+0) . ' ' . $langs->trans("days") . '</td></tr>';
|
||||
}
|
||||
|
||||
if ($conf->banque->enabled)
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
@ -293,7 +295,7 @@ else
|
||||
print '<td>'.$langs->trans("DelaysOfToleranceChequesToDeposit").'</td><td>' . ($conf->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT+0) . ' ' . $langs->trans("days") . '</td></tr>';
|
||||
}
|
||||
|
||||
if ($conf->adherent->enabled)
|
||||
if (! empty($conf->adherent->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
@ -368,7 +370,7 @@ print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
?>
|
||||
|
||||
@ -208,7 +208,7 @@ if ($action == 'edit') // Edit
|
||||
print '</td>';
|
||||
print '<td width="20"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Hide unauthorized button
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ButtonHideUnauthorized").'</td><td>';
|
||||
@ -238,7 +238,7 @@ if ($action == 'edit') // Edit
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageLogin").'</td><td colspan="2">';
|
||||
// Editeur wysiwyg
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
|
||||
$doleditor=new DolEditor('main_home',$conf->global->MAIN_HOME,'',142,'dolibarr_notes','In',false,true,true,ROWS_4,90);
|
||||
$doleditor=new DolEditor('main_home',(isset($conf->global->MAIN_HOME)?$conf->global->MAIN_HOME:''),'',142,'dolibarr_notes','In',false,true,true,ROWS_4,90);
|
||||
$doleditor->Create();
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
@ -246,7 +246,7 @@ if ($action == 'edit') // Edit
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageOfDay").'</td><td colspan="2">';
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
|
||||
$doleditor=new DolEditor('main_motd',$conf->global->MAIN_MOTD,'',142,'dolibarr_notes','In',false,true,true,ROWS_4,90);
|
||||
$doleditor=new DolEditor('main_motd',(isset($conf->global->MAIN_MOTD)?$conf->global->MAIN_MOTD:''),'',142,'dolibarr_notes','In',false,true,true,ROWS_4,90);
|
||||
$doleditor->Create();
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
@ -366,35 +366,37 @@ else // Show
|
||||
print '</td>';
|
||||
print '<td width="20"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Hide unauthorized button
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ButtonHideUnauthorized").'</td><td colspan="2">';
|
||||
print yn($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED,1);
|
||||
print yn((isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0),1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Link to help center
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableLinkToHelpCenter").'</td><td colspan="2">';
|
||||
print yn($conf->global->MAIN_HELPCENTER_DISABLELINK,1);
|
||||
print yn((isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0),1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Link to wiki help
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/'.$conf->theme.'/img//helpdoc.png','',1)).'</td><td colspan="2">';
|
||||
print yn($conf->global->MAIN_HELP_DISABLELINK,1);
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/helpdoc.png','',1)).'</td><td colspan="2">';
|
||||
print yn((isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0),1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Message login
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageLogin").'</td><td colspan="2">';
|
||||
print dol_htmlcleanlastbr($conf->global->MAIN_HOME);
|
||||
if (isset($conf->global->MAIN_HOME)) print dol_htmlcleanlastbr($conf->global->MAIN_HOME);
|
||||
else print ' ';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Message of the day
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageOfDay").'</td><td colspan="2">';
|
||||
print dol_htmlcleanlastbr($conf->global->MAIN_MOTD);
|
||||
if (isset($conf->global->MAIN_MOTD)) print dol_htmlcleanlastbr($conf->global->MAIN_MOTD);
|
||||
else print ' ';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
/*
|
||||
@ -415,7 +417,6 @@ else // Show
|
||||
}
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
?>
|
||||
$db->close();
|
||||
?>
|
||||
@ -37,7 +37,7 @@ $langs->load("users");
|
||||
$langs->load("other");
|
||||
|
||||
// Security check
|
||||
if (!$user->admin) accessforbidden();
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
$dirstandard = array();
|
||||
$dirsmartphone = array();
|
||||
@ -48,6 +48,9 @@ foreach($dirmenus as $dirmenu)
|
||||
$dirsmartphone[]=$dirmenu.'smartphone';
|
||||
}
|
||||
|
||||
$error=0;
|
||||
$errmsgs=array();
|
||||
|
||||
|
||||
// Cette page peut etre longue. On augmente le delai autorise.
|
||||
// Ne fonctionne que si on est pas en safe_mode.
|
||||
@ -80,7 +83,6 @@ if ($action == 'update' && empty($_POST["cancel"]))
|
||||
if (isset($_POST["MAIN_MENUFRONT_SMARTPHONE"])) $listofmenuhandler[preg_replace('/((_back|_front)office)?\.php/i','',$_POST["MAIN_MENUFRONT_SMARTPHONE"])]=1;
|
||||
|
||||
// Initialize menu handlers
|
||||
$error=0; $errmsgs=array();
|
||||
foreach ($listofmenuhandler as $key => $val)
|
||||
{
|
||||
// Load sql init_menu_handler.sql file
|
||||
@ -154,7 +156,7 @@ print $langs->trans("MenusDesc")."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
if (isset($_GET["action"]) && $_GET["action"] == 'edit')
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -240,8 +242,8 @@ else
|
||||
print '<td>';
|
||||
$filelib=preg_replace('/.php$/i','',(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED));
|
||||
print $filelib;
|
||||
if (preg_match('/smartphone/',$conf->global->MAIN_MENU_SMARTPHONE_FORCED)
|
||||
|| (empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED) && preg_match('/smartphone/',$conf->global->MAIN_MENU_SMARTPHONE)))
|
||||
if (! empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED) && preg_match('/smartphone/', $conf->global->MAIN_MENU_SMARTPHONE_FORCED)
|
||||
|| (empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED) && ! empty($conf->global->MAIN_MENU_SMARTPHONE) && preg_match('/smartphone/',$conf->global->MAIN_MENU_SMARTPHONE)))
|
||||
{
|
||||
print ' '.img_warning($langs->transnoentitiesnoconv("ThisForceAlsoTheme"));
|
||||
}
|
||||
@ -249,8 +251,8 @@ else
|
||||
print '<td>';
|
||||
$filelib=preg_replace('/.php$/i','',(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$conf->global->MAIN_MENUFRONT_SMARTPHONE:$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED));
|
||||
print $filelib;
|
||||
if (preg_match('/smartphone/',$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)
|
||||
|| (empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED) && preg_match('/smartphone/',$conf->global->MAIN_MENUFRONT_SMARTPHONE)))
|
||||
if (! empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED) && preg_match('/smartphone/',$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)
|
||||
|| (empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED) && ! empty($conf->global->MAIN_MENU_SMARTPHONE) && preg_match('/smartphone/',$conf->global->MAIN_MENUFRONT_SMARTPHONE)))
|
||||
{
|
||||
print ' '.img_warning($langs->transnoentitiesnoconv("ThisForceAlsoTheme"));
|
||||
}
|
||||
@ -266,7 +268,7 @@ print '</div>';
|
||||
dol_htmloutput_errors('',$errmsgs);
|
||||
|
||||
|
||||
if (! isset($_GET["action"]) || $_GET["action"] != 'edit')
|
||||
if ($action != 'edit')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2009-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2009-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -41,7 +41,9 @@ foreach($dirmenus as $dirmenu)
|
||||
$dirsmartphone[]=$dirmenu.'smartphone';
|
||||
}
|
||||
|
||||
$mesg=$_GET["mesg"];
|
||||
$action=GETPOST('action','alpha');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$mesg=GETPOST('mesg');
|
||||
|
||||
$menu_handler_top=$conf->global->MAIN_MENU_STANDARD;
|
||||
$menu_handler_smartphone=$conf->global->MAIN_MENU_SMARTPHONE;
|
||||
@ -52,15 +54,15 @@ $menu_handler_smartphone=preg_replace('/_frontoffice.php/i','',$menu_handler_sma
|
||||
|
||||
$menu_handler=$menu_handler_top;
|
||||
|
||||
if ($_REQUEST["handler_origine"]) $menu_handler=$_REQUEST["handler_origine"];
|
||||
if ($_REQUEST["menu_handler"]) $menu_handler=$_REQUEST["menu_handler"];
|
||||
if (isset($_REQUEST["handler_origine"])) $menu_handler=$_REQUEST["handler_origine"];
|
||||
if (isset($_REQUEST["menu_handler"])) $menu_handler=$_REQUEST["menu_handler"];
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (isset($_GET["action"]) && ($_GET["action"] == 'up'))
|
||||
if ($action == 'up')
|
||||
{
|
||||
$current=array();
|
||||
$previous=array();
|
||||
@ -116,7 +118,7 @@ if (isset($_GET["action"]) && ($_GET["action"] == 'up'))
|
||||
$db->query($sql);
|
||||
}
|
||||
|
||||
if (isset($_GET["action"]) && $_GET["action"] == 'down')
|
||||
elseif ($action == 'down')
|
||||
{
|
||||
$current=array();
|
||||
$next=array();
|
||||
@ -172,7 +174,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'down')
|
||||
$db->query($sql);
|
||||
}
|
||||
|
||||
if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes')
|
||||
elseif ($action == 'confirm_delete' && $confirm == 'yes')
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
@ -191,7 +193,7 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes')
|
||||
$db->rollback();
|
||||
|
||||
$reload = 0;
|
||||
$_GET["action"]='';
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
|
||||
@ -237,7 +239,7 @@ print "<br>\n";
|
||||
|
||||
|
||||
// Confirmation for remove menu entry
|
||||
if ($_GET["action"] == 'delete')
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$sql = "SELECT m.titre";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."menu as m";
|
||||
@ -341,8 +343,8 @@ else
|
||||
print '<div class="error">'.$langs->trans("ErrorFeatureNeedJavascript").'</div>';
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
print '<br>';
|
||||
|
||||
llxFooter();
|
||||
llxFooter();
|
||||
$db->close();
|
||||
?>
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
|
||||
/* Copyright (C) 2010-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -28,33 +28,35 @@ $langs->load("users");
|
||||
$langs->load("admin");
|
||||
$langs->load("other");
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($_GET["action"] == 'activate_hidemenu')
|
||||
if ($action == 'activate_hidemenu')
|
||||
{
|
||||
dolibarr_set_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", '1','chaine',0,'',$conf->entity);
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else if ($_GET["action"] == 'disable_hidemenu')
|
||||
else if ($action == 'disable_hidemenu')
|
||||
{
|
||||
dolibarr_del_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED",$conf->entity);
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($_GET["action"] == 'activate_layoutmenu')
|
||||
if ($action == 'activate_layoutmenu')
|
||||
{
|
||||
dolibarr_set_const($db, "MAIN_MENU_USE_JQUERY_LAYOUT", '1','chaine',0,'',$conf->entity);
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else if ($_GET["action"] == 'disable_layoutmenu')
|
||||
else if ($action == 'disable_layoutmenu')
|
||||
{
|
||||
dolibarr_del_const($db, "MAIN_MENU_USE_JQUERY_LAYOUT",$conf->entity);
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
@ -106,11 +108,11 @@ $var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td colspan="3">'.$langs->trans("HideUnauthorizedMenu").'</td>';
|
||||
print '<td align="center">';
|
||||
if ($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED == 0)
|
||||
if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED))
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=activate_hidemenu">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
}
|
||||
if($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED == 1)
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=disable_hidemenu">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
|
||||
}
|
||||
@ -118,17 +120,17 @@ print "</td>";
|
||||
print '</tr>';
|
||||
|
||||
// Use a flip-hide menu
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL > 0)
|
||||
if (isset($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL > 0)
|
||||
{
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td colspan="3">'.$langs->trans("MenuUseLayout").'</td>';
|
||||
print '<td align="center">';
|
||||
if ($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT == 0)
|
||||
if (empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=activate_layoutmenu">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
}
|
||||
if($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT == 1)
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=disable_layoutmenu">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
|
||||
}
|
||||
@ -138,7 +140,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0)
|
||||
|
||||
print '</table>';
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
?>
|
||||
$db->close();
|
||||
?>
|
||||
@ -376,10 +376,10 @@ if ($mode != 4)
|
||||
print "<td align=\"center\" valign=\"middle\">";
|
||||
|
||||
// Module actif
|
||||
if (! empty($objMod->always_enabled) || (($conf->global->MAIN_MODULE_MULTICOMPANY && $objMod->core_enabled) && ($user->entity || $conf->entity!=1)))
|
||||
if (! empty($objMod->always_enabled) || ((! empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity!=1)))
|
||||
{
|
||||
print $langs->trans("Required");
|
||||
if ($conf->global->MAIN_MODULE_MULTICOMPANY && $user->entity) $disableSetup++;
|
||||
if (! empty($conf->multicompany->enabled) && $user->entity) $disableSetup++;
|
||||
print '</td>'."\n";
|
||||
}
|
||||
else
|
||||
|
||||
@ -58,20 +58,20 @@ if ($id || $ref)
|
||||
$dbtablename = 'product';
|
||||
$fieldid = isset($ref)?'ref':'rowid';
|
||||
}
|
||||
if ($type == 1) {
|
||||
elseif ($type == 1) {
|
||||
$elementtype = 'fournisseur';
|
||||
$objecttype = 'societe&categorie';
|
||||
$objectid = isset($id)?$id:(isset($socid)?$socid:'');
|
||||
$fieldid = 'rowid';
|
||||
}
|
||||
if ($type == 2) {
|
||||
elseif ($type == 2) {
|
||||
$elementtype = 'societe';
|
||||
$objecttype = 'societe&categorie';
|
||||
$objectid = isset($id)?$id:(isset($socid)?$socid:'');
|
||||
$dbtablename = '&societe';
|
||||
$fieldid = 'rowid';
|
||||
}
|
||||
if ($type == 3) {
|
||||
elseif ($type == 3) {
|
||||
$elementtype = 'member';
|
||||
$objecttype = 'adherent&categorie';
|
||||
$objectid = isset($id)?$id:(isset($ref)?$ref:'');
|
||||
|
||||
@ -776,7 +776,7 @@ class Categorie
|
||||
// Process all childs on several levels of this category
|
||||
$protection++;
|
||||
if ($protection > 10) return; // On ne traite pas plus de 10 niveaux de profondeurs
|
||||
if (! is_array($this->cats[$id_categ]['id_children'])) return;
|
||||
if (empty($this->cats[$id_categ]['id_children'])) return;
|
||||
foreach($this->cats[$id_categ]['id_children'] as $key => $idchild)
|
||||
{
|
||||
// Protection when a category has itself as a child (should not happen)
|
||||
|
||||
@ -86,6 +86,13 @@ class ActionComm extends CommonObject
|
||||
function ActionComm($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
|
||||
$this->author = (object) array();
|
||||
$this->usermod = (object) array();
|
||||
$this->usertodo = (object) array();
|
||||
$this->userdone = (object) array();
|
||||
$this->societe = (object) array();
|
||||
$this->contact = (object) array();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -31,15 +31,13 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/agenda.lib.php");
|
||||
if ($conf->contrat->enabled) require_once(DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php");
|
||||
if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php");
|
||||
|
||||
if (!$user->rights->societe->lire)
|
||||
accessforbidden();
|
||||
if (! $user->rights->societe->lire) accessforbidden();
|
||||
|
||||
$langs->load("commercial");
|
||||
|
||||
// Securite acces client
|
||||
$socid='';
|
||||
if ($_GET["socid"]) { $socid=$_GET["socid"]; }
|
||||
if ($user->societe_id > 0)
|
||||
$socid=GETPOST('socid','int');
|
||||
if (isset($user->societe_id) && $user->societe_id > 0)
|
||||
{
|
||||
$action = '';
|
||||
$socid = $user->societe_id;
|
||||
@ -180,7 +178,7 @@ if ($conf->propal->enabled && $user->rights->propal->lire)
|
||||
print '</td>';
|
||||
print '<td align="right" nowrap="nowrap">'.price($obj->total_ht).'</td></tr>';
|
||||
$i++;
|
||||
$total += $obj->price;
|
||||
$total += $obj->total_ht;
|
||||
}
|
||||
if ($total>0)
|
||||
{
|
||||
@ -282,7 +280,7 @@ if ($conf->societe->enabled && $user->rights->societe->lire)
|
||||
{
|
||||
$langs->load("boxes");
|
||||
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.client, s.datec,s.tms";
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.client, s.datec, s.tms, s.canvas";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE s.client IN (1, 2, 3)";
|
||||
|
||||
@ -74,7 +74,7 @@ function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$menu->add('/compta/bank/fiche.php?id='.$objp->rowid,$objp->label,1,$user->rights->banque->lire);
|
||||
if ($objp->rappro && $objp->courant != 2 && ! $objp->clos) // If not cash account and not closed and can be reconciliate
|
||||
if ($objp->rappro && $objp->courant != 2 && empty($objp->clos)) // If not cash account and not closed and can be reconciliate
|
||||
{
|
||||
$menu->add('/compta/bank/rappro.php?account='.$objp->rowid,$langs->trans("Conciliate"),2,$user->rights->banque->consolidate);
|
||||
}
|
||||
|
||||
@ -52,6 +52,9 @@ class Deplacement extends CommonObject
|
||||
var $fk_project;
|
||||
var $extraparams=array();
|
||||
|
||||
var $statuts=array();
|
||||
var $statuts_short=array();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@ -231,7 +234,7 @@ class Deplacement extends CommonObject
|
||||
$this->note_private = $obj->note;
|
||||
$this->note_public = $obj->note_public;
|
||||
$this->fk_project = $obj->fk_projet;
|
||||
|
||||
|
||||
$this->extraparams = (array) json_decode($obj->extraparams, true);
|
||||
|
||||
return 1;
|
||||
@ -308,19 +311,19 @@ class Deplacement extends CommonObject
|
||||
}
|
||||
if ($mode == 3)
|
||||
{
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
||||
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
|
||||
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
||||
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
|
||||
}
|
||||
if ($mode == 4)
|
||||
{
|
||||
//if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
|
||||
//if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]);
|
||||
}
|
||||
if ($mode == 5)
|
||||
{
|
||||
if ($statut==0) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
||||
if ($statut==1) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
|
||||
if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
||||
if ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -563,13 +563,13 @@ if ($conf->don->enabled && $user->rights->societe->lire)
|
||||
|
||||
|
||||
// Last trips and expenses
|
||||
if ($conf->deplacement->enabled && $user->rights->deplacement->lire)
|
||||
if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire)
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php');
|
||||
|
||||
$langs->load("boxes");
|
||||
|
||||
$sql = "SELECT u.rowid as uid, u.name, u.firstname, d.rowid, d.dated as date, d.tms as dm, d.km";
|
||||
$sql = "SELECT u.rowid as uid, u.name, u.firstname, d.fk_statut, d.rowid, d.dated as date, d.tms as dm, d.km";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."deplacement as d, ".MAIN_DB_PREFIX."user as u";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE u.rowid = d.fk_user";
|
||||
@ -923,7 +923,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
|
||||
{
|
||||
$facstatic=new FactureFournisseur($db);
|
||||
|
||||
$sql = "SELECT ff.rowid, ff.facnumber, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc,";
|
||||
$sql = "SELECT ff.rowid, ff.facnumber, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, ff.paye,";
|
||||
$sql.= " s.nom, s.rowid as socid,";
|
||||
$sql.= " sum(pf.amount) as am";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff";
|
||||
|
||||
@ -133,12 +133,13 @@ echo $this->control->tpl['ajax_selectcountry'];
|
||||
<td colspan="3" valign="top"><textarea name="note" cols="70" rows="<?php echo ROWS_3; ?>"><?php echo $this->control->tpl['note']; ?></textarea></td>
|
||||
</tr>
|
||||
|
||||
<?php if (! empty($this->control->tpl['contact_element'])) { ?>
|
||||
<?php foreach ($this->control->tpl['contact_element'] as $element) { ?>
|
||||
<tr>
|
||||
<td><?php echo $element['linked_element_label']; ?></td>
|
||||
<td colspan="3"><?php echo $element['linked_element_value']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php } } ?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans("DolibarrLogin"); ?></td>
|
||||
|
||||
@ -540,10 +540,11 @@ else
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
print '<input type="hidden" name="contactid" value="'.$object->id.'">';
|
||||
print '<input type="hidden" name="old_name" value="'.$object->name.'">';
|
||||
print '<input type="hidden" name="old_firstname" value="'.$object->firstname.'">';
|
||||
if (! empty($backtopage)) print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
|
||||
@ -45,15 +45,15 @@ if (! isset($mode) || $mode != 'noajax') // For ajax call
|
||||
$module=GETPOST("module");
|
||||
$urlsource=GETPOST("urlsource");
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $conf->liste_limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="name";
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $conf->liste_limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="name";
|
||||
|
||||
$upload_dir = dirname(str_replace("../","/", $conf->ecm->dir_output.'/'.$file));
|
||||
|
||||
|
||||
@ -72,7 +72,7 @@ if ($modulepart == 'ecm')
|
||||
* View
|
||||
*/
|
||||
|
||||
top_httphead();
|
||||
top_httphead();
|
||||
|
||||
$userstatic=new User($db);
|
||||
$form=new Form($db);
|
||||
|
||||
@ -85,7 +85,7 @@ class box_activity extends ModeleBoxes
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$now=gmmktime();
|
||||
$now=dol_now();
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num)
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -32,6 +33,15 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty"
|
||||
var $error='';
|
||||
var $max=5;
|
||||
|
||||
var $rowid;
|
||||
var $id;
|
||||
var $position;
|
||||
var $box_order;
|
||||
var $fk_user;
|
||||
var $sourcefile;
|
||||
var $box_id;
|
||||
var $note;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
||||
@ -36,6 +36,11 @@ abstract class CommonObject
|
||||
public $errors;
|
||||
public $canvas; // Contains canvas name if it is
|
||||
|
||||
public $lastname;
|
||||
public $firstname;
|
||||
public $name;
|
||||
public $nom;
|
||||
public $civility_id;
|
||||
|
||||
// No constructor as it is an abstract class
|
||||
|
||||
@ -66,7 +71,7 @@ abstract class CommonObject
|
||||
}
|
||||
|
||||
// If order not defined, we use the setup
|
||||
if ($nameorder < 0) $nameorder=(! $conf->global->MAIN_FIRSTNAME_NAME_POSITION);
|
||||
if ($nameorder < 0) $nameorder=(empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION));
|
||||
|
||||
if ($nameorder)
|
||||
{
|
||||
|
||||
@ -189,7 +189,7 @@ class Conf
|
||||
{
|
||||
$modulename=strtolower($reg[1]);
|
||||
if ($modulename == 'propale') $modulename='propal';
|
||||
if (! is_object($this->$modulename)) $this->$modulename=(object) array();
|
||||
if (! isset($this->$modulename) || ! is_object($this->$modulename)) $this->$modulename=(object) array();
|
||||
$this->$modulename->enabled=true;
|
||||
$this->modules[]=$modulename; // Add this module in list of enabled modules
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ class DolGraph
|
||||
global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet;
|
||||
|
||||
// To use old feature
|
||||
if ($conf->global->MAIN_GRAPH_LIBRARY == 'artichow')
|
||||
if (isset($conf->global->MAIN_GRAPH_LIBRARY) && $conf->global->MAIN_GRAPH_LIBRARY == 'artichow')
|
||||
{
|
||||
$this->_library='artichow';
|
||||
|
||||
@ -850,7 +850,7 @@ class DolGraph
|
||||
$this->_stringtoshow.='{ ';
|
||||
if (! isset($this->type[$i]) || $this->type[$i] == 'bars') $this->_stringtoshow.='bars: { show: true, align: "'.($i==$firstlot?'center':'left').'", barWidth: 0.5 }, ';
|
||||
if (isset($this->type[$i]) && $this->type[$i] == 'lines') $this->_stringtoshow.='lines: { show: true, fill: false }, ';
|
||||
$this->_stringtoshow.='color: "#'.$color.'", label: "'.dol_escape_js($this->Legend[$i]).'", data: d'.$i.' }';
|
||||
$this->_stringtoshow.='color: "#'.$color.'", label: "'.(isset($this->Legend[$i]) ? dol_escape_js($this->Legend[$i]) : '').'", data: d'.$i.' }';
|
||||
$i++;
|
||||
}
|
||||
$this->_stringtoshow.="\n".' ], { series: { stack: stack, lines: { fill: false, steps: steps }, bars: { barWidth: 0.6 } }'."\n";
|
||||
|
||||
@ -91,7 +91,7 @@ class Form
|
||||
if ($perm)
|
||||
{
|
||||
$tmp=explode(':',$typeofdata);
|
||||
$ret.= '<div class="editkey_'.$tmp[0].' '.$tmp[1].'" id="'.$htmlname.'">';
|
||||
$ret.= '<div class="editkey_'.$tmp[0].(! empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">';
|
||||
$ret.= $langs->trans($text);
|
||||
$ret.= '</div>'."\n";
|
||||
}
|
||||
@ -267,7 +267,8 @@ class Form
|
||||
if (preg_match('/^(string|email|numeric)/',$inputType))
|
||||
{
|
||||
$tmp=explode(':',$inputType);
|
||||
$inputType=$tmp[0]; $inputOption=$tmp[1];
|
||||
$inputType=$tmp[0];
|
||||
if (! empty($tmp[1])) $inputOption=$tmp[1];
|
||||
if (! empty($tmp[2])) $savemethod=$tmp[2];
|
||||
}
|
||||
else if (preg_match('/^datepicker/',$inputType))
|
||||
@ -2237,8 +2238,8 @@ class Form
|
||||
{
|
||||
foreach ($formquestion as $key => $input)
|
||||
{
|
||||
array_push($inputok,$input['name']);
|
||||
if ($input['inputko'] == 1) array_push($inputko,$input['name']);
|
||||
if (isset($input['name'])) array_push($inputok,$input['name']);
|
||||
if (isset($input['inputko']) && $input['inputko'] == 1) array_push($inputko,$input['name']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -271,9 +271,8 @@ class FormCompany
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$noselect.=$out;
|
||||
if (!empty($htmlname)) $out.= '</select>';
|
||||
if (!empty($htmlname) && $user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
||||
if (! empty($htmlname)) $out.= '</select>';
|
||||
if (! empty($htmlname) && $user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -93,11 +93,11 @@ class InfoBox
|
||||
$box=new $boxname($db,$obj->note);
|
||||
|
||||
// box properties
|
||||
$box->rowid=$obj->rowid;
|
||||
$box->id=$obj->box_id;
|
||||
$box->position=$obj->position;
|
||||
$box->box_order=$obj->box_order;
|
||||
$box->fk_user=$obj->fk_user;
|
||||
$box->rowid = (! empty($obj->rowid) ? $obj->rowid : '');
|
||||
$box->id = (! empty($obj->box_id) ? $obj->box_id : '');
|
||||
$box->position = (! empty($obj->position) ? $obj->position : '');
|
||||
$box->box_order = (! empty($obj->box_order) ? $obj->box_order : '');
|
||||
$box->fk_user = (! empty($obj->fk_user) ? $obj->fk_user : '');
|
||||
$box->sourcefile=$relsourcefile;
|
||||
if ($mode == 'activated' && (! $user->id || ! $user->conf->$confuserzone))
|
||||
{
|
||||
@ -108,11 +108,11 @@ class InfoBox
|
||||
}
|
||||
}
|
||||
// box_def properties
|
||||
$box->box_id=$obj->box_id;
|
||||
$box->note=$obj->note;
|
||||
$box->box_id = (! empty($obj->box_id) ? $obj->box_id : '');
|
||||
$box->note = (! empty($obj->note) ? $obj->note : '');
|
||||
|
||||
$enabled=true;
|
||||
if ($box->depends && count($box->depends) > 0)
|
||||
if (isset($box->depends) && count($box->depends) > 0)
|
||||
{
|
||||
foreach($box->depends as $module)
|
||||
{
|
||||
|
||||
@ -178,7 +178,7 @@ function show_array_actions_to_do($max=5)
|
||||
include_once(DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php');
|
||||
include_once(DOL_DOCUMENT_ROOT.'/societe/class/client.class.php');
|
||||
|
||||
$sql = "SELECT a.id, a.label, a.datep as dp, a.fk_user_author, a.percent,";
|
||||
$sql = "SELECT a.id, a.label, a.datep as dp, a.datep2 as dp2, a.fk_user_author, a.percent,";
|
||||
$sql.= " c.code, c.libelle,";
|
||||
$sql.= " s.nom as sname, s.rowid, s.client";
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c,";
|
||||
@ -226,13 +226,13 @@ function show_array_actions_to_do($max=5)
|
||||
|
||||
print '<td>';
|
||||
if ($obj->rowid > 0)
|
||||
{
|
||||
$customerstatic->id=$obj->rowid;
|
||||
$customerstatic->name=$obj->sname;
|
||||
$customerstatic->client=$obj->client;
|
||||
print $customerstatic->getNomUrl(1,'',16);
|
||||
}
|
||||
print '</td>';
|
||||
{
|
||||
$customerstatic->id=$obj->rowid;
|
||||
$customerstatic->name=$obj->sname;
|
||||
$customerstatic->client=$obj->client;
|
||||
print $customerstatic->getNomUrl(1,'',16);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
$datep=$db->jdate($obj->dp);
|
||||
$datep2=$db->jdate($obj->dp2);
|
||||
|
||||
@ -64,7 +64,10 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil
|
||||
|
||||
if ($dir = opendir($newpath))
|
||||
{
|
||||
$filedate='';
|
||||
$filesize='';
|
||||
$file_list = array();
|
||||
|
||||
while (false !== ($file = readdir($dir)))
|
||||
{
|
||||
if (! utf8_check($file)) $file=utf8_encode($file); // To be sure data is stored in utf8 in memory
|
||||
|
||||
@ -821,12 +821,12 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e
|
||||
// This part of code should not be used.
|
||||
dol_syslog("Functions.lib::dol_print_date function call with deprecated value of time in page ".$_SERVER["PHP_SELF"], LOG_WARNING);
|
||||
// Date has format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' or 'YYYYMMDDHHMMSS'
|
||||
$syear = $reg[1];
|
||||
$smonth = $reg[2];
|
||||
$sday = $reg[3];
|
||||
$shour = $reg[4];
|
||||
$smin = $reg[5];
|
||||
$ssec = $reg[6];
|
||||
$syear = (! empty($reg[1]) ? $reg[1] : '');
|
||||
$smonth = (! empty($reg[2]) ? $reg[2] : '');
|
||||
$sday = (! empty($reg[3]) ? $reg[3] : '');
|
||||
$shour = (! empty($reg[4]) ? $reg[4] : '');
|
||||
$smin = (! empty($reg[5]) ? $reg[5] : '');
|
||||
$ssec = (! empty($reg[6]) ? $reg[6] : '');
|
||||
|
||||
$time=dol_mktime($shour,$smin,$ssec,$smonth,$sday,$syear,true);
|
||||
$ret=adodb_strftime($format,$time+$offsettz+$offsetdst,$to_gmt);
|
||||
@ -966,7 +966,7 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
|
||||
else $localtz = new DateTimeZone('UTC');
|
||||
$dt = new DateTime(null,$localtz);
|
||||
$dt->setDate($year,$month,$day);
|
||||
$dt->setTime($hour,$minute,$second);
|
||||
$dt->setTime((int) $hour, (int) $minute, (int) $second);
|
||||
$date=$dt->getTimestamp();
|
||||
}
|
||||
else
|
||||
@ -3852,7 +3852,7 @@ function picto_from_langcode($codelang)
|
||||
*/
|
||||
function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode='add')
|
||||
{
|
||||
if (is_array($conf->tabs_modules[$type]))
|
||||
if (isset($conf->tabs_modules[$type]) && is_array($conf->tabs_modules[$type]))
|
||||
{
|
||||
foreach ($conf->tabs_modules[$type] as $value)
|
||||
{
|
||||
|
||||
@ -123,7 +123,7 @@ function product_prepare_head($object, $user)
|
||||
|
||||
|
||||
// More tabs from canvas
|
||||
if (is_array($object->onglets))
|
||||
if (isset($object->onglets) && is_array($object->onglets))
|
||||
{
|
||||
foreach ($object->onglets as $onglet)
|
||||
{
|
||||
|
||||
@ -115,10 +115,12 @@ function restrictedArea($user, $features, $objectid=0, $dbtablename='', $feature
|
||||
if ($dbt_select != 'rowid') $objectid = "'".$objectid."'";
|
||||
|
||||
// More features to check
|
||||
$features = explode("&",$features);
|
||||
$features = explode("&", $features);
|
||||
|
||||
// More parameters
|
||||
list($dbtablename, $sharedelement) = explode('&', $dbtablename);
|
||||
$params = explode('&', $dbtablename);
|
||||
$dbtablename=(! empty($params[0]) ? $params[0] : '');
|
||||
$sharedelement=(! empty($params[1]) ? $params[1] : '');
|
||||
|
||||
// Check read permission from module
|
||||
// TODO Replace "feature" param into caller by first level of permission
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
|
||||
/* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -159,7 +159,11 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
{
|
||||
global $conf,$langs,$bc;
|
||||
|
||||
$dirthemes=array_merge(array($conf->global->MAIN_FORCETHEMEDIR.'/theme'),(array) $conf->modules_parts['themes']);
|
||||
$forcethemedir=(! empty($conf->global->MAIN_FORCETHEMEDIR) ? $conf->global->MAIN_FORCETHEMEDIR : '');
|
||||
$dirthemes=array($forcethemedir.'/theme');
|
||||
if (! empty($conf->modules_parts['themes'])) {
|
||||
$dirthemes=array_merge(array($forcethemedir.'/theme'),(array) $conf->modules_parts['themes']);
|
||||
}
|
||||
|
||||
$selected_theme=$conf->global->MAIN_THEME;
|
||||
if (! empty($fuser)) $selected_theme=$fuser->conf->MAIN_THEME;
|
||||
@ -206,7 +210,12 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
{
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("ThemeDir").'</td>';
|
||||
print '<td'.($foruserprofile?' colspan="3"':'').'>'.$dirtheme.'</td>';
|
||||
print '<td>';
|
||||
foreach($dirthemes as $dirtheme)
|
||||
{
|
||||
echo '"'.$dirtheme.'" ';
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@ -214,14 +223,14 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">';
|
||||
|
||||
print '<table class="nobordernopadding" width="100%">';
|
||||
|
||||
|
||||
$i=0;
|
||||
|
||||
|
||||
foreach($dirthemes as $dir)
|
||||
{
|
||||
$dirtheme=dol_buildpath($dir,0);
|
||||
$urltheme=dol_buildpath($dir,1);
|
||||
|
||||
|
||||
if (is_dir($dirtheme))
|
||||
{
|
||||
$handle=opendir($dirtheme);
|
||||
@ -234,12 +243,12 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
{
|
||||
// Disable not stable themes
|
||||
//if ($conf->global->MAIN_FEATURES_LEVEL < 1 && preg_match('/bureau2crea/i',$subdir)) continue;
|
||||
|
||||
|
||||
if ($i % $thumbsbyrow == 0)
|
||||
{
|
||||
print '<tr '.$bc[$var].'>';
|
||||
}
|
||||
|
||||
|
||||
print '<td align="center">';
|
||||
$file=$dirtheme."/".$subdir."/thumb.png";
|
||||
$url=$urltheme."/".$subdir."/thumb.png";
|
||||
@ -260,16 +269,16 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
print '<input '.($edit?'':'disabled').' type="radio" '.$bc[$var].' style="border: 0px;" name="main_theme" value="'.$subdir.'"> '.$subdir;
|
||||
}
|
||||
print '</td></tr></table></td>';
|
||||
|
||||
|
||||
$i++;
|
||||
|
||||
|
||||
if ($i % $thumbsbyrow == 0) print '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($i % $thumbsbyrow != 0)
|
||||
{
|
||||
while ($i % $thumbsbyrow != 0)
|
||||
|
||||
@ -897,7 +897,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
$langs->load("companies");
|
||||
|
||||
// Customers invoices
|
||||
if ($conf->facture->enabled)
|
||||
if (! empty($conf->facture->enabled))
|
||||
{
|
||||
$langs->load("bills");
|
||||
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills",$langs->trans("BillsCustomers"),0,$user->rights->facture->lire, '', $mainmenu, 'customers_bills');
|
||||
@ -911,7 +911,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
|
||||
$newmenu->add("/compta/paiement/liste.php?leftmenu=customers_bills_payments",$langs->trans("Payments"),1,$user->rights->facture->lire);
|
||||
|
||||
if ($conf->global->BILL_ADD_PAYMENT_VALIDATION)
|
||||
if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))
|
||||
{
|
||||
$newmenu->add("/compta/paiement/avalider.php?leftmenu=customers_bills_payments",$langs->trans("MenuToValid"),2,$user->rights->facture->lire);
|
||||
}
|
||||
@ -921,13 +921,13 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
}
|
||||
|
||||
// Suppliers
|
||||
if ($conf->societe->enabled && $conf->fournisseur->enabled)
|
||||
if (! empty($conf->societe->enabled) && ! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
if ($conf->facture->enabled)
|
||||
if (! empty($conf->facture->enabled))
|
||||
{
|
||||
$langs->load("bills");
|
||||
$newmenu->add("/fourn/facture/index.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"),0,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
|
||||
if ($user->societe_id == 0)
|
||||
if (isset($user->societe_id) && $user->societe_id == 0)
|
||||
{
|
||||
$newmenu->add("/fourn/facture/fiche.php?action=create",$langs->trans("NewBill"),1,$user->rights->fournisseur->facture->creer);
|
||||
}
|
||||
@ -939,17 +939,17 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
}
|
||||
|
||||
// Orders
|
||||
if ($conf->commande->enabled)
|
||||
if (! empty($conf->commande->enabled))
|
||||
{
|
||||
$langs->load("orders");
|
||||
if ($conf->facture->enabled) $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=3", $langs->trans("MenuOrdersToBill"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
|
||||
if (! empty($conf->facture->enabled)) $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=3", $langs->trans("MenuOrdersToBill"), 0, $user->rights->commande->lire, '', $mainmenu, 'orders');
|
||||
// if ($leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->rights->commande->lire);
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL > 1)
|
||||
if (isset($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL > 1)
|
||||
if ($leftmenu=="orders") $newmenu->add("/commande/customer.php", $langs->trans("GenerateBill"), 1, $user->rights->commande->lire);
|
||||
}
|
||||
|
||||
// Donations
|
||||
if ($conf->don->enabled)
|
||||
if (! empty($conf->don->enabled))
|
||||
{
|
||||
$langs->load("donations");
|
||||
$newmenu->add("/compta/dons/index.php?leftmenu=donations&mainmenu=accountancy",$langs->trans("Donations"), 0, $user->rights->don->lire, '', $mainmenu, 'donations');
|
||||
@ -959,7 +959,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
}
|
||||
|
||||
// Trips and expenses
|
||||
if ($conf->deplacement->enabled)
|
||||
if (! empty($conf->deplacement->enabled))
|
||||
{
|
||||
$langs->load("trips");
|
||||
$newmenu->add("/compta/deplacement/index.php?leftmenu=tripsandexpenses&mainmenu=accountancy", $langs->trans("TripsAndExpenses"), 0, $user->rights->deplacement->lire, '', $mainmenu, 'tripsandexpenses');
|
||||
@ -969,7 +969,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
}
|
||||
|
||||
// Taxes and social contributions
|
||||
if ($conf->tax->enabled)
|
||||
if (! empty($conf->tax->enabled))
|
||||
{
|
||||
$newmenu->add("/compta/charges/index.php?leftmenu=tax&mainmenu=accountancy",$langs->trans("MenuTaxAndDividends"), 0, $user->rights->tax->charges->lire, '', $mainmenu, 'tax');
|
||||
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/sociales/index.php?leftmenu=tax_social",$langs->trans("MenuSocialContributions"),1,$user->rights->tax->charges->lire);
|
||||
@ -986,7 +986,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
global $mysoc;
|
||||
|
||||
//Local Taxes
|
||||
if($mysoc->country_code=='ES' && $mysoc->localtax2_assuj=="1")
|
||||
if($mysoc->country_code=='ES' && (isset($mysoc->localtax2_assuj) && $mysoc->localtax2_assuj=="1"))
|
||||
{
|
||||
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/localtax/index.php?leftmenu=tax_vat&mainmenu=accountancy",$langs->transcountry("LT2",$mysoc->country_code),1,$user->rights->tax->charges->lire);
|
||||
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add("/compta/localtax/fiche.php?leftmenu=tax_vat&action=create",$langs->trans("NewPayment"),2,$user->rights->tax->charges->creer);
|
||||
@ -1000,7 +1000,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
}
|
||||
|
||||
// Compta simple
|
||||
if ($conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION)
|
||||
if (! empty($conf->comptabilite->enabled) && ! empty($conf->global->FACTURE_VENTILATION))
|
||||
{
|
||||
$newmenu->add("/compta/ventilation/index.php?leftmenu=ventil",$langs->trans("Dispatch"),0,$user->rights->compta->ventilation->lire, '', $mainmenu, 'ventil');
|
||||
if ($leftmenu=="ventil") $newmenu->add("/compta/ventilation/liste.php",$langs->trans("ToDispatch"),1,$user->rights->compta->ventilation->lire);
|
||||
@ -1014,13 +1014,13 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
}
|
||||
|
||||
// Compta expert
|
||||
if ($conf->accounting->enabled)
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Rapports
|
||||
if ($conf->comptabilite->enabled || $conf->accounting->enabled)
|
||||
if (! empty($conf->comptabilite->enabled) || ! empty($conf->accounting->enabled))
|
||||
{
|
||||
$langs->load("compta");
|
||||
|
||||
@ -1064,7 +1064,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
$langs->load("bills");
|
||||
|
||||
// Bank-Caisse
|
||||
if ($conf->banque->enabled)
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
$newmenu->add("/compta/bank/index.php?leftmenu=bank&mainmenu=bank",$langs->trans("MenuBankCash"),0,$user->rights->banque->lire, '', $mainmenu, 'bank');
|
||||
|
||||
@ -1078,7 +1078,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
}
|
||||
|
||||
// Prelevements
|
||||
if ($conf->prelevement->enabled)
|
||||
if (! empty($conf->prelevement->enabled))
|
||||
{
|
||||
$newmenu->add("/compta/prelevement/index.php?leftmenu=withdraw&mainmenu=bank",$langs->trans("StandingOrders"),0,$user->rights->prelevement->bons->lire, '', $mainmenu, 'withdraw');
|
||||
|
||||
@ -1096,7 +1096,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
}
|
||||
|
||||
// Gestion cheques
|
||||
if ($conf->facture->enabled && $conf->banque->enabled)
|
||||
if (! empty($conf->facture->enabled) && ! empty($conf->banque->enabled))
|
||||
{
|
||||
$newmenu->add("/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank",$langs->trans("MenuChequeDeposits"),0,$user->rights->banque->cheque, '', $mainmenu, 'checks');
|
||||
$newmenu->add("/compta/paiement/cheque/fiche.php?leftmenu=checks&action=new&mainmenu=bank",$langs->trans("NewChequeDeposit"),1,$user->rights->banque->cheque);
|
||||
@ -1111,7 +1111,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
if ($mainmenu == 'products')
|
||||
{
|
||||
// Products
|
||||
if ($conf->product->enabled)
|
||||
if (! empty($conf->product->enabled))
|
||||
{
|
||||
$newmenu->add("/product/index.php?leftmenu=product&type=0", $langs->trans("Products"), 0, $user->rights->produit->lire, '', $mainmenu, 'product');
|
||||
if ($user->societe_id == 0)
|
||||
@ -1130,7 +1130,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
}
|
||||
|
||||
// Services
|
||||
if ($conf->service->enabled)
|
||||
if (! empty($conf->service->enabled))
|
||||
{
|
||||
$newmenu->add("/product/index.php?leftmenu=service&type=1", $langs->trans("Services"), 0, $user->rights->service->lire, '', $mainmenu, 'service');
|
||||
if ($user->societe_id == 0)
|
||||
@ -1145,7 +1145,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
}
|
||||
|
||||
// Categories
|
||||
if ($conf->categorie->enabled)
|
||||
if (! empty($conf->categorie->enabled))
|
||||
{
|
||||
$langs->load("categories");
|
||||
$newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat');
|
||||
@ -1157,7 +1157,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
}
|
||||
|
||||
// Stocks
|
||||
if ($conf->stock->enabled)
|
||||
if (! empty($conf->stock->enabled))
|
||||
{
|
||||
$langs->load("stocks");
|
||||
$newmenu->add("/product/stock/index.php?leftmenu=stock", $langs->trans("Stocks"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock');
|
||||
@ -1168,7 +1168,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
}
|
||||
|
||||
// Expeditions
|
||||
if ($conf->expedition->enabled)
|
||||
if (! empty($conf->expedition->enabled))
|
||||
{
|
||||
$langs->load("sendings");
|
||||
$newmenu->add("/expedition/index.php?leftmenu=sendings", $langs->trans("Shipments"), 0, $user->rights->expedition->lire, '', $mainmenu, 'sendings');
|
||||
@ -1187,7 +1187,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
{
|
||||
$langs->load("suppliers");
|
||||
|
||||
if ($conf->societe->enabled && $conf->fournisseur->enabled)
|
||||
if (! empty($conf->societe->enabled) && ! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
$newmenu->add("/fourn/index.php?leftmenu=suppliers", $langs->trans("Suppliers"), 0, $user->rights->societe->lire && $user->rights->fournisseur->lire, '', $mainmenu, 'suppliers');
|
||||
|
||||
@ -1201,12 +1201,12 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
$newmenu->add("/fourn/stats.php",$langs->trans("Statistics"), 1, $user->rights->societe->lire && $user->rights->fournisseur->lire);
|
||||
}
|
||||
|
||||
if ($conf->facture->enabled)
|
||||
if (! empty($conf->facture->enabled))
|
||||
{
|
||||
$langs->load("bills");
|
||||
$newmenu->add("/fourn/facture/index.php?leftmenu=orders", $langs->trans("Bills"), 0, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'orders');
|
||||
|
||||
if ($user->societe_id == 0)
|
||||
if (isset($user->societe_id) && $user->societe_id == 0)
|
||||
{
|
||||
$newmenu->add("/fourn/facture/fiche.php?action=create",$langs->trans("NewBill"), 1, $user->rights->fournisseur->facture->creer);
|
||||
}
|
||||
@ -1214,7 +1214,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
$newmenu->add("/fourn/facture/paiement.php", $langs->trans("Payments"), 1, $user->rights->fournisseur->facture->lire);
|
||||
}
|
||||
|
||||
if ($conf->fournisseur->enabled)
|
||||
if (! empty($conf->fournisseur->enabled))
|
||||
{
|
||||
$langs->load("orders");
|
||||
$newmenu->add("/fourn/commande/index.php?leftmenu=suppliers",$langs->trans("Orders"), 0, $user->rights->fournisseur->commande->lire, '', $mainmenu, 'suppliers');
|
||||
@ -1222,11 +1222,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
$newmenu->add("/fourn/commande/liste.php?leftmenu=suppliers", $langs->trans("List"), 1, $user->rights->fournisseur->commande->lire);
|
||||
}
|
||||
|
||||
if ($conf->categorie->enabled)
|
||||
if (! empty($conf->categorie->enabled))
|
||||
{
|
||||
$langs->load("categories");
|
||||
$newmenu->add("/categories/index.php?leftmenu=cat&type=1", $langs->trans("Categories"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat');
|
||||
if ($user->societe_id == 0)
|
||||
if (isset($user->societe_id) && $user->societe_id == 0)
|
||||
{
|
||||
$newmenu->add("/categories/fiche.php?action=create&type=1", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||
}
|
||||
@ -1240,7 +1240,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
*/
|
||||
if ($mainmenu == 'project')
|
||||
{
|
||||
if ($conf->projet->enabled)
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
$langs->load("projects");
|
||||
|
||||
@ -1305,7 +1305,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
*/
|
||||
if ($mainmenu == 'members')
|
||||
{
|
||||
if ($conf->adherent->enabled)
|
||||
if (! empty($conf->adherent->enabled))
|
||||
{
|
||||
$langs->load("members");
|
||||
$langs->load("compta");
|
||||
@ -1326,11 +1326,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
||||
$newmenu->add("/adherents/stats/index.php?leftmenu=members",$langs->trans("MenuMembersStats"),1,$user->rights->adherent->lire);
|
||||
|
||||
|
||||
if ($conf->categorie->enabled)
|
||||
if (! empty($conf->categorie->enabled))
|
||||
{
|
||||
$langs->load("categories");
|
||||
$newmenu->add("/categories/index.php?leftmenu=cat&type=3", $langs->trans("Categories"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat');
|
||||
if ($user->societe_id == 0)
|
||||
if (isset($user->societe_id) && $user->societe_id == 0)
|
||||
{
|
||||
$newmenu->add("/categories/fiche.php?action=create&type=3", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
|
||||
}
|
||||
|
||||
@ -53,10 +53,6 @@ if (! defined('LOG_DEBUG'))
|
||||
}
|
||||
}
|
||||
|
||||
// Force PHP error_reporting setup (Dolibarr may report warning without this)
|
||||
error_reporting(E_ALL & ~(E_STRICT|E_NOTICE|E_DEPRECATED));
|
||||
//error_reporting(E_ALL | E_STRICT);
|
||||
|
||||
// End of common declaration part
|
||||
if (defined('DOL_INC_FOR_VERSION_ERROR')) return;
|
||||
|
||||
@ -78,6 +74,17 @@ if (! $result && ! empty($_SERVER["GATEWAY_INTERFACE"])) // If install not do
|
||||
header("Location: install/index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Force PHP error_reporting setup (Dolibarr may report warning without this)
|
||||
if (! empty($dolibarr_strict_mode))
|
||||
{
|
||||
error_reporting(E_ALL | E_STRICT);
|
||||
}
|
||||
else
|
||||
{
|
||||
error_reporting(E_ALL & ~(E_STRICT|E_NOTICE|E_DEPRECATED));
|
||||
}
|
||||
|
||||
// Disable php display errors
|
||||
if (! empty($dolibarr_main_prod)) ini_set('display_errors','Off');
|
||||
|
||||
|
||||
@ -405,27 +405,29 @@ class FactureFournisseur extends Facture
|
||||
while ($i < $num_rows)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql_rows);
|
||||
$this->lines[$i]->rowid = $obj->rowid;
|
||||
$this->lines[$i]->description = $obj->description;
|
||||
$this->lines[$i]->ref = $obj->product_ref; // TODO deprecated
|
||||
$this->lines[$i]->product_ref = $obj->product_ref; // Internal reference
|
||||
//$this->lines[$i]->ref_fourn = $obj->ref_fourn; // Reference fournisseur du produit
|
||||
$this->lines[$i]->libelle = $obj->label; // Label du produit
|
||||
$this->lines[$i]->product_desc = $obj->product_desc; // Description du produit
|
||||
$this->lines[$i]->pu_ht = $obj->pu_ht;
|
||||
$this->lines[$i]->pu_ttc = $obj->pu_ttc;
|
||||
$this->lines[$i]->tva_tx = $obj->tva_tx;
|
||||
$this->lines[$i]->localtax1_tx = $obj->localtax1_tx;
|
||||
$this->lines[$i]->localtax2_tx = $obj->localtax2_tx;
|
||||
$this->lines[$i]->qty = $obj->qty;
|
||||
$this->lines[$i]->tva = $obj->tva;
|
||||
$this->lines[$i]->total_ht = $obj->total_ht;
|
||||
$this->lines[$i]->total_tva = $obj->total_tva;
|
||||
$this->lines[$i]->total_localtax1 = $obj->total_localtax1;
|
||||
$this->lines[$i]->total_localtax2 = $obj->total_localtax2;
|
||||
$this->lines[$i]->total_ttc = $obj->total_ttc;
|
||||
$this->lines[$i]->fk_product = $obj->fk_product;
|
||||
$this->lines[$i]->product_type = $obj->product_type;
|
||||
|
||||
$this->lines[$i] = (object) array();
|
||||
$this->lines[$i]->rowid = $obj->rowid;
|
||||
$this->lines[$i]->description = $obj->description;
|
||||
$this->lines[$i]->ref = $obj->product_ref; // TODO deprecated
|
||||
$this->lines[$i]->product_ref = $obj->product_ref; // Internal reference
|
||||
//$this->lines[$i]->ref_fourn = $obj->ref_fourn; // Reference fournisseur du produit
|
||||
$this->lines[$i]->libelle = $obj->label; // Label du produit
|
||||
$this->lines[$i]->product_desc = $obj->product_desc; // Description du produit
|
||||
$this->lines[$i]->pu_ht = $obj->pu_ht;
|
||||
$this->lines[$i]->pu_ttc = $obj->pu_ttc;
|
||||
$this->lines[$i]->tva_tx = $obj->tva_tx;
|
||||
$this->lines[$i]->localtax1_tx = $obj->localtax1_tx;
|
||||
$this->lines[$i]->localtax2_tx = $obj->localtax2_tx;
|
||||
$this->lines[$i]->qty = $obj->qty;
|
||||
$this->lines[$i]->tva = $obj->tva;
|
||||
$this->lines[$i]->total_ht = $obj->total_ht;
|
||||
$this->lines[$i]->total_tva = $obj->total_tva;
|
||||
$this->lines[$i]->total_localtax1 = $obj->total_localtax1;
|
||||
$this->lines[$i]->total_localtax2 = $obj->total_localtax2;
|
||||
$this->lines[$i]->total_ttc = $obj->total_ttc;
|
||||
$this->lines[$i]->fk_product = $obj->fk_product;
|
||||
$this->lines[$i]->product_type = $obj->product_type;
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -293,7 +293,7 @@ class ProductFournisseur extends Product
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT s.nom as supplier_name, s.rowid as fourn_id,";
|
||||
$sql.= " pfp.rowid as product_fourn_pri_id, pfp.ref_fourn,";
|
||||
$sql.= " pfp.rowid as product_fourn_pri_id, pfp.ref_fourn, pfp.fk_product as product_fourn_id,";
|
||||
$sql.= " pfp.price, pfp.quantity, pfp.unitprice, pfp.tva_tx, pfp.fk_availability";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
|
||||
@ -669,7 +669,7 @@ if (! defined('NOREQUIRETRAN'))
|
||||
}
|
||||
|
||||
// Use php template engine
|
||||
if ($conf->global->MAIN_USE_TEMPLATE_ENGINE && ! defined('NOTEMPLATEENGINE'))
|
||||
if (! empty($conf->global->MAIN_USE_TEMPLATE_ENGINE) && ! defined('NOTEMPLATEENGINE'))
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT.'/includes/savant/Savant3.php');
|
||||
|
||||
@ -893,14 +893,17 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
||||
//print 'themepath='.$themepath.' themeparam='.$themeparam;exit;
|
||||
print '<link rel="stylesheet" type="text/css" title="default" href="'.$themepath.$themeparam.'">'."\n";
|
||||
// CSS forced by modules (relative url starting with /)
|
||||
$dircss=(array) $conf->modules_parts['css'];
|
||||
foreach($dircss as $key => $cssfile)
|
||||
if (isset($conf->modules_parts['css']))
|
||||
{
|
||||
// cssfile is a relative path
|
||||
print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1);
|
||||
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
|
||||
if (!preg_match('/\.css$/i',$cssfile)) print $themeparam;
|
||||
print '"><!-- Added by module '.$key. '-->'."\n";
|
||||
$dircss=(array) $conf->modules_parts['css'];
|
||||
foreach($dircss as $key => $cssfile)
|
||||
{
|
||||
// cssfile is a relative path
|
||||
print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1);
|
||||
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
|
||||
if (!preg_match('/\.css$/i',$cssfile)) print $themeparam;
|
||||
print '"><!-- Added by module '.$key. '-->'."\n";
|
||||
}
|
||||
}
|
||||
// CSS forced by page in top_htmlhead call (relative url starting with /)
|
||||
if (is_array($arrayofcss))
|
||||
@ -1207,7 +1210,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
|
||||
|
||||
print "\n".'<!-- Start top horizontal menu '.$top_menu.' -->'."\n";
|
||||
|
||||
if ($conf->use_javascript_ajax && $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) print '<div class="ui-layout-north"> <!-- Begin top layout -->'."\n";
|
||||
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print '<div class="ui-layout-north"> <!-- Begin top layout -->'."\n";
|
||||
|
||||
print '<div id="tmenu_tooltip" class="tmenu">'."\n";
|
||||
|
||||
@ -1241,7 +1244,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
|
||||
$loginhtmltext.='<br><b>'.$langs->trans("IPAddress").'</b>: '.$_SERVER["REMOTE_ADDR"];
|
||||
$loginhtmltext.='<br>';
|
||||
$loginhtmltext.='<br><u>'.$langs->trans("Connection").'</u>';
|
||||
if ($conf->global->MAIN_MODULE_MULTICOMPANY) $loginhtmltext.='<br><b>'.$langs->trans("ConnectedOnMultiCompany").'</b>: '.$conf->entity.' (user entity '.$user->entity.')';
|
||||
if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY)) $loginhtmltext.='<br><b>'.$langs->trans("ConnectedOnMultiCompany").'</b>: '.$conf->entity.' (user entity '.$user->entity.')';
|
||||
$loginhtmltext.='<br><b>'.$langs->trans("ConnectedSince").'</b>: '.dol_print_date($user->datelastlogin,"dayhour");
|
||||
$loginhtmltext.='<br><b>'.$langs->trans("PreviousConnexion").'</b>: '.dol_print_date($user->datepreviouslogin,"dayhour");
|
||||
$loginhtmltext.='<br><b>'.$langs->trans("AuthenticationMode").'</b>: '.$_SESSION["dol_authmode"];
|
||||
@ -1253,7 +1256,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
|
||||
if (! empty($_SESSION["disablemodules"])) $loginhtmltext.='<br><b>'.$langs->trans("DisabledModules").'</b>: <br>'.join(', ',explode(',',$_SESSION["disablemodules"]));
|
||||
|
||||
$appli='Dolibarr';
|
||||
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_APPLICATION_TITLE;
|
||||
if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_APPLICATION_TITLE;
|
||||
|
||||
// Link info
|
||||
$logouttext='';
|
||||
@ -1281,7 +1284,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
|
||||
print '<div class="login_block">'."\n";
|
||||
print '<table class="nobordernopadding" summary=""><tr>';
|
||||
|
||||
if (! is_object($form)) $form=new Form($db);
|
||||
$form=new Form($db);
|
||||
|
||||
$toprightmenu.=$form->textwithtooltip('',$loginhtmltext,2,1,$logintext,'',1);
|
||||
|
||||
@ -1308,11 +1311,11 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
|
||||
print '</tr></table>'."\n";
|
||||
print "</div>\n";
|
||||
|
||||
if ($conf->use_javascript_ajax && $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) print "</div><!-- End top layout -->\n";
|
||||
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print "</div><!-- End top layout -->\n";
|
||||
|
||||
print "<!-- End top horizontal menu -->\n";
|
||||
|
||||
if (! $conf->use_javascript_ajax || ! $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) print '<table width="100%" class="notopnoleftnoright" summary="leftmenutable" id="undertopmenu"><tr>';
|
||||
if (empty($conf->use_javascript_ajax) || empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print '<table width="100%" class="notopnoleftnoright" summary="leftmenutable" id="undertopmenu"><tr>';
|
||||
|
||||
|
||||
}
|
||||
@ -1347,32 +1350,32 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
|
||||
}
|
||||
$hookmanager->initHooks(array('searchform','leftblock'));
|
||||
|
||||
if ($conf->use_javascript_ajax && $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) print "\n".'<div class="ui-layout-west"> <!-- Begin left layout -->'."\n";
|
||||
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print "\n".'<div class="ui-layout-west"> <!-- Begin left layout -->'."\n";
|
||||
else print '<td class="vmenu" valign="top">';
|
||||
|
||||
print "\n";
|
||||
|
||||
// Define $searchform
|
||||
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_SOCIETE && $user->rights->societe->lire)
|
||||
if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire)
|
||||
{
|
||||
$langs->load("companies");
|
||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/societe.php', DOL_URL_ROOT.'/societe/societe.php', img_object('','company').' '.$langs->trans("ThirdParties"), 'soc', 'socname');
|
||||
}
|
||||
|
||||
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_CONTACT && $user->rights->societe->lire)
|
||||
if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_CONTACT) && $user->rights->societe->lire)
|
||||
{
|
||||
$langs->load("companies");
|
||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', img_object('','contact').' '.$langs->trans("Contacts"), 'contact', 'contactname');
|
||||
}
|
||||
|
||||
if ((($conf->product->enabled && $user->rights->produit->lire) || ($conf->service->enabled && $user->rights->service->lire))
|
||||
&& $conf->global->MAIN_SEARCHFORM_PRODUITSERVICE)
|
||||
if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire))
|
||||
&& ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE))
|
||||
{
|
||||
$langs->load("products");
|
||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/product/liste.php', DOL_URL_ROOT.'/product/liste.php', img_object('','product').' '.$langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall');
|
||||
}
|
||||
|
||||
if ($conf->adherent->enabled && $conf->global->MAIN_SEARCHFORM_ADHERENT && $user->rights->adherent->lire)
|
||||
if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $user->rights->adherent->lire)
|
||||
{
|
||||
$langs->load("members");
|
||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/liste.php', DOL_URL_ROOT.'/adherents/liste.php', img_object('','user').' '.$langs->trans("Members"), 'member', 'sall');
|
||||
@ -1504,7 +1507,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
|
||||
$leftblock=$hookmanager->executeHooks('printLeftBlock',$parameters); // Note that $action and $object may have been modified by some hooks
|
||||
print $leftblock;
|
||||
|
||||
if ($conf->use_javascript_ajax && $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) print '</div> <!-- End left layout -->'."\n";
|
||||
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print '</div> <!-- End left layout -->'."\n";
|
||||
else print '</td>';
|
||||
|
||||
print "\n";
|
||||
@ -1527,7 +1530,7 @@ function main_area($title='')
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
if ($conf->use_javascript_ajax && $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)
|
||||
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))
|
||||
{
|
||||
print '<div id="mainContent"><div class="ui-layout-center"> <!-- begin main layout -->'."\n";
|
||||
print '<table width="100%" class="notopnoleftnoright" summary="centermenutable" id="undertopmenu"><tr>';
|
||||
@ -1566,6 +1569,10 @@ function main_area($title='')
|
||||
*/
|
||||
function getHelpParamFor($helppagename,$langs)
|
||||
{
|
||||
$helpbaseurl='';
|
||||
$helppage='';
|
||||
$mode='';
|
||||
|
||||
if (preg_match('/^http/i',$helppagename))
|
||||
{
|
||||
// If complete URL
|
||||
|
||||
@ -1991,11 +1991,15 @@ class Product extends CommonObject
|
||||
{
|
||||
if (is_array($desc_pere)) // If this parent desc is an array, this is an array of childs
|
||||
{
|
||||
if($multiply)
|
||||
$id=(! empty($desc_pere[0]) ? $desc_pere[0] :'');
|
||||
$nb=(! empty($desc_pere[1]) ? $desc_pere[1] :'');
|
||||
$type=(! empty($desc_pere[2]) ? $desc_pere[2] :'');
|
||||
|
||||
if ($multiply)
|
||||
{
|
||||
//print "XXX ".$desc_pere[1]." multiply=".$multiply;
|
||||
$img="";
|
||||
$this->fetch($desc_pere[0]);
|
||||
$this->fetch($id);
|
||||
$this->load_stock();
|
||||
if ($this->stock_warehouse[1]->real < $this->seuil_stock_alerte)
|
||||
{
|
||||
@ -2007,13 +2011,13 @@ class Product extends CommonObject
|
||||
</a> (".$desc_pere[1].")</td><td align=\"center\"> ".($desc_pere[1]*$multiply)."</td><td> </td><td> </td>
|
||||
<td align=\"center\">".$this->stock_entrepot[1]." ".$img."</td></tr>",
|
||||
$desc_pere[0], // Id product
|
||||
*/ 'id'=>$desc_pere[0], // Id product
|
||||
'nb'=>$desc_pere[1], // Nb of units that compose parent product
|
||||
'nb_total'=>$desc_pere[1]*$multiply, // Nb of units for all nb of product
|
||||
*/ 'id'=>$id, // Id product
|
||||
'nb'=>$nb, // Nb of units that compose parent product
|
||||
'nb_total'=>$nb*$multiply, // Nb of units for all nb of product
|
||||
'stock'=>$this->stock_warehouse[1]->real, // Stock
|
||||
'stock_alert'=>$this->seuil_stock_alerte, // Stock alert
|
||||
'fullpath' => $compl_path.$nom_pere, // Label
|
||||
'type'=>$desc_pere[2] // Nb of units that compose parent product
|
||||
'type'=>$type // Nb of units that compose parent product
|
||||
);
|
||||
}
|
||||
else
|
||||
@ -2023,13 +2027,13 @@ class Product extends CommonObject
|
||||
$this->res[]= array(
|
||||
/* $compl_path.$nom_pere." (".$desc_pere[1].")",
|
||||
$desc_pere[0], // Id product
|
||||
*/ 'id'=>$desc_pere[0], // Id product
|
||||
'nb'=>$desc_pere[1], // Nb of units that compose parent product
|
||||
'nb_total'=>$desc_pere[1], // Nb of units for all nb of product
|
||||
*/ 'id'=>$id, // Id product
|
||||
'nb'=>$nb, // Nb of units that compose parent product
|
||||
'nb_total'=>$nb, // Nb of units for all nb of product
|
||||
'stock'=>$this->stock_warehouse[1]->real, // Stock
|
||||
'stock_alert'=>$this->seuil_stock_alerte, // Stock alert
|
||||
'fullpath' => $compl_path.$nom_pere, // Label
|
||||
'type'=>$desc_pere[2] // Nb of units that compose parent product
|
||||
'type'=>$type // Nb of units that compose parent product
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -2423,6 +2427,7 @@ class Product extends CommonObject
|
||||
while ($i < $num)
|
||||
{
|
||||
$row = $this->db->fetch_object($result);
|
||||
$this->stock_warehouse[$row->fk_entrepot] = (object) array();
|
||||
$this->stock_warehouse[$row->fk_entrepot]->real = $row->reel;
|
||||
$this->stock_warehouse[$row->fk_entrepot]->pmp = $row->pmp;
|
||||
$this->stock_reel+=$row->reel;
|
||||
|
||||
@ -66,7 +66,7 @@ class Service extends CommonObject
|
||||
|
||||
$sql = "SELECT count(p.rowid) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
$sql.= ' WHERE p.entity IN ('.getEntity($this->element, 1).')';
|
||||
$sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')';
|
||||
$sql.= " AND p.fk_product_type = 1";
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
@ -35,24 +35,22 @@ require_once(DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php");
|
||||
$langs->load("bills");
|
||||
$langs->load("products");
|
||||
|
||||
$id=GETPOST('id','int');
|
||||
$ref=GETPOST('ref','alpha');
|
||||
$action=GETPOST('action','alpha');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$cancel=GETPOST('cancel','alpha');
|
||||
$key=GETPOST('key');
|
||||
$catMere=GETPOST('catMere');
|
||||
|
||||
// Security check
|
||||
if (isset($_GET["id"]) || isset($_GET["ref"]))
|
||||
{
|
||||
$id = isset($_GET["id"])?$_GET["id"]:(isset($_GET["ref"])?$_GET["ref"]:'');
|
||||
}
|
||||
$fieldid = isset($_GET["ref"])?'ref':'rowid';
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'produit|service',$id,'product','','',$fieldid);
|
||||
if (! empty($user->societe_id)) $socid=$user->societe_id;
|
||||
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
|
||||
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
|
||||
$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype);
|
||||
|
||||
$mesg = '';
|
||||
|
||||
$id=isset($_GET["id"])?$_GET["id"]:$_POST["id"];
|
||||
$ref=isset($_GET["ref"])?$_GET["ref"]:$_POST["ref"];
|
||||
$key=isset($_GET["key"])?$_GET["key"]:$_POST["key"];
|
||||
$catMere=isset($_GET["catMere"])?$_GET["catMere"]:$_POST["catMere"];
|
||||
$action=isset($_GET["action"])?$_GET["action"]:$_POST["action"];
|
||||
$cancel=isset($_GET["cancel"])?$_GET["cancel"]:$_POST["cancel"];
|
||||
|
||||
$product = new Product($db);
|
||||
$productid=0;
|
||||
if ($id || $ref)
|
||||
|
||||
@ -44,7 +44,7 @@ $confirm=GETPOST('confirm','alpha');
|
||||
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
|
||||
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'produit|service',$fielvalue,'product&product','','',$fieldtype);
|
||||
$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype);
|
||||
|
||||
// Get parameters
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
@ -72,7 +72,7 @@ $modulepart='produit';
|
||||
* Action envoie fichier
|
||||
*/
|
||||
|
||||
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
if (dol_mkdir($upload_dir) >= 0)
|
||||
{
|
||||
@ -121,9 +121,8 @@ llxHeader("","",$langs->trans("CardProduct".$object->type));
|
||||
|
||||
if ($object->id)
|
||||
{
|
||||
if ( $error_msg )
|
||||
{
|
||||
echo '<div class="error">'.$error_msg.'</div><br>';
|
||||
if (! empty($mesg)) {
|
||||
dol_htmloutput_mesg($mesg);
|
||||
}
|
||||
|
||||
if ($action=='delete')
|
||||
|
||||
@ -668,7 +668,7 @@ $helpurl='';
|
||||
if (GETPOST("type") == '0') $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
|
||||
if (GETPOST("type") == '1') $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
|
||||
|
||||
llxHeader('',$langs->trans("CardProduct".$_GET["type"]),$helpurl);
|
||||
llxHeader('',$langs->trans("CardProduct".GETPOST("type")),$helpurl);
|
||||
|
||||
$form = new Form($db);
|
||||
$formproduct = new FormProduct($db);
|
||||
@ -1047,7 +1047,7 @@ else
|
||||
dol_fiche_head($head, 'card', $titre, 0, $picto);
|
||||
|
||||
$showphoto=$object->is_photo_available($conf->product->multidir_output[$object->entity]);
|
||||
$showbarcode=$conf->barcode->enabled && $user->rights->barcode->lire;
|
||||
$showbarcode=(! empty($conf->barcode->enabled) && $user->rights->barcode->lire);
|
||||
|
||||
// En mode visu
|
||||
print '<table class="border" width="100%"><tr>';
|
||||
@ -1137,13 +1137,13 @@ else
|
||||
}
|
||||
|
||||
// Accountancy sell code
|
||||
print '<tr><td>'.$form->editfieldkey("ProductAccountancySellCode",'accountancy_code_sell',$object->accountancy_code_sell,$object,$user->rights->produit->creer||$user->rights->service->creer).'</td><td colspan="2">';
|
||||
print $form->editfieldval("ProductAccountancySellCode",'accountancy_code_sell',$object->accountancy_code_sell,$object,$user->rights->produit->creer||$user->rights->service->creer);
|
||||
print '<tr><td>'.$form->editfieldkey("ProductAccountancySellCode",'accountancy_code_sell',$object->accountancy_code_sell,$object,$user->rights->produit->creer||$user->rights->service->creer,'string').'</td><td colspan="2">';
|
||||
print $form->editfieldval("ProductAccountancySellCode",'accountancy_code_sell',$object->accountancy_code_sell,$object,$user->rights->produit->creer||$user->rights->service->creer,'string');
|
||||
print '</td></tr>';
|
||||
|
||||
// Accountancy buy code
|
||||
print '<tr><td>'.$form->editfieldkey("ProductAccountancyBuyCode",'accountancy_code_buy',$object->accountancy_code_buy,$object,$user->rights->produit->creer||$user->rights->service->creer).'</td><td colspan="2">';
|
||||
print $form->editfieldval("ProductAccountancyBuyCode",'accountancy_code_buy',$object->accountancy_code_buy,$object,$user->rights->produit->creer||$user->rights->service->creer);
|
||||
print '<tr><td>'.$form->editfieldkey("ProductAccountancyBuyCode",'accountancy_code_buy',$object->accountancy_code_buy,$object,$user->rights->produit->creer||$user->rights->service->creer,'string').'</td><td colspan="2">';
|
||||
print $form->editfieldval("ProductAccountancyBuyCode",'accountancy_code_buy',$object->accountancy_code_buy,$object,$user->rights->produit->creer||$user->rights->service->creer,'string');
|
||||
print '</td></tr>';
|
||||
|
||||
// Status (to sell)
|
||||
@ -1179,7 +1179,7 @@ else
|
||||
{
|
||||
$dur=array("h"=>$langs->trans("Hour"),"d"=>$langs->trans("Day"),"w"=>$langs->trans("Week"),"m"=>$langs->trans("Month"),"y"=>$langs->trans("Year"));
|
||||
}
|
||||
print $langs->trans($dur[$object->duration_unit])." ";
|
||||
print (! empty($object->duration_unit) && isset($dur[$object->duration_unit]) ? $langs->trans($dur[$object->duration_unit]) : '')." ";
|
||||
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -1302,11 +1302,11 @@ if ($action == '' || $action == 'view')
|
||||
{
|
||||
if ($user->rights->produit->creer || $user->rights->service->creer)
|
||||
{
|
||||
if ($object->no_button_edit <> 1) print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&id='.$object->id.'">'.$langs->trans("Modify").'</a>';
|
||||
if (isset($object->no_button_edit) && $object->no_button_edit <> 1) print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&id='.$object->id.'">'.$langs->trans("Modify").'</a>';
|
||||
|
||||
if ($object->no_button_copy <> 1)
|
||||
if (isset($object->no_button_copy) && $object->no_button_copy <> 1)
|
||||
{
|
||||
if ($conf->use_javascript_ajax)
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print '<span id="action-clone" class="butAction">'.$langs->trans('ToClone').'</span>'."\n";
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneProduct'),$langs->trans('ConfirmCloneProduct',$object->ref),'confirm_clone',$formquestionclone,'yes','action-clone',230,600);
|
||||
@ -1322,9 +1322,9 @@ if ($action == '' || $action == 'view')
|
||||
if (($object->type == 0 && $user->rights->produit->supprimer)
|
||||
|| ($object->type == 1 && $user->rights->service->supprimer))
|
||||
{
|
||||
if (! $object_is_used && $object->no_button_delete <> 1)
|
||||
if (! $object_is_used && isset($object->no_button_delete) && $object->no_button_delete <> 1)
|
||||
{
|
||||
if ($conf->use_javascript_ajax)
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print '<span id="action-delete" class="butActionDelete">'.$langs->trans('Delete').'</span>'."\n";
|
||||
print $form->formconfirm("fiche.php?id=".$object->id,$langs->trans("DeleteProduct"),$langs->trans("ConfirmDeleteProduct"),"confirm_delete",'',0,"action-delete");
|
||||
@ -1357,7 +1357,7 @@ if ($id && ($action == '' || $action == 'view') && $object->status)
|
||||
print '<table width="100%" class="noborder">';
|
||||
|
||||
// Propals
|
||||
if($conf->propal->enabled && $user->rights->propale->creer)
|
||||
if (! empty($conf->propal->enabled) && $user->rights->propale->creer)
|
||||
{
|
||||
$propal = new Propal($db);
|
||||
|
||||
@ -1413,7 +1413,7 @@ if ($id && ($action == '' || $action == 'view') && $object->status)
|
||||
print '<td><input type="hidden" name="propalid" value="'.$objp->propalid.'">';
|
||||
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("ReductionShort");
|
||||
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';
|
||||
print " ".$object->stock_proposition;
|
||||
if (isset($object->stock_proposition)) print " ".$object->stock_proposition;
|
||||
print '</td><td align="right">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
||||
print '</td>';
|
||||
@ -1474,7 +1474,7 @@ if ($id && ($action == '' || $action == 'view') && $object->status)
|
||||
}
|
||||
|
||||
// Commande
|
||||
if($conf->commande->enabled && $user->rights->commande->creer)
|
||||
if (! empty($conf->commande->enabled) && $user->rights->commande->creer)
|
||||
{
|
||||
$commande = new Commande($db);
|
||||
|
||||
@ -1530,7 +1530,7 @@ if ($id && ($action == '' || $action == 'view') && $object->status)
|
||||
print '<td><input type="hidden" name="commandeid" value="'.$objc->commandeid.'">';
|
||||
print '<input type="text" class="flat" name="qty" size="1" value="1"></td><td nowrap>'.$langs->trans("ReductionShort");
|
||||
print '<input type="text" class="flat" name="remise_percent" size="1" value="0">%';
|
||||
print " ".$object->stock_proposition;
|
||||
if (isset($object->stock_proposition)) print " ".$object->stock_proposition;
|
||||
print '</td><td align="right">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';
|
||||
print '</td>';
|
||||
@ -1592,7 +1592,7 @@ if ($id && ($action == '' || $action == 'view') && $object->status)
|
||||
}
|
||||
|
||||
// Factures
|
||||
if ($conf->facture->enabled && $user->rights->facture->creer)
|
||||
if (! empty($conf->facture->enabled) && $user->rights->facture->creer)
|
||||
{
|
||||
print '<tr class="liste_titre"><td width="50%" class="liste_titre">';
|
||||
print $langs->trans("AddToMyBills").'</td>';
|
||||
@ -1743,6 +1743,6 @@ if ($id && ($action == '' || $action == 'view') && $object->status)
|
||||
}
|
||||
|
||||
|
||||
$db->close();
|
||||
llxFooter();
|
||||
$db->close();
|
||||
?>
|
||||
|
||||
@ -171,7 +171,7 @@ if ($action == 'updateprice' && $_POST["cancel"] <> $langs->trans("Cancel"))
|
||||
}
|
||||
}
|
||||
|
||||
if ($_POST["cancel"] == $langs->trans("Cancel"))
|
||||
if (GETPOST('cancel') == $langs->trans("Cancel"))
|
||||
{
|
||||
$action = '';
|
||||
Header("Location: fournisseurs.php?id=".$_GET["id"]);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -74,7 +74,7 @@ print '<tr><td valign="top" width="30%" class="notopnoleft">';
|
||||
* Zone recherche produit/service
|
||||
*/
|
||||
$rowspan=2;
|
||||
if ($conf->barcode->enabled) $rowspan++;
|
||||
if (! empty($conf->barcode->enabled)) $rowspan++;
|
||||
print '<form method="post" action="'.DOL_URL_ROOT.'/product/liste.php">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
@ -83,7 +83,7 @@ print '<td colspan="3">'.$langs->trans("Search").'</td></tr>';
|
||||
print "<tr $bc[0]><td>";
|
||||
print $langs->trans("Ref").':</td><td><input class="flat" type="text" size="14" name="sref"></td>';
|
||||
print '<td rowspan="'.$rowspan.'"><input type="submit" class="button" value="'.$langs->trans("Search").'"></td></tr>';
|
||||
if ($conf->barcode->enabled)
|
||||
if (! empty($conf->barcode->enabled))
|
||||
{
|
||||
print "<tr $bc[0]><td>";
|
||||
print $langs->trans("BarCode").':</td><td><input class="flat" type="text" size="14" name="sbarcode"></td>';
|
||||
|
||||
@ -57,7 +57,7 @@ if ($id > 0 || ! empty($ref))
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($_FILES['userfile']['size'] > 0 && $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
if (isset($_FILES['userfile']) && $_FILES['userfile']['size'] > 0 && GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
if ($object->id) $result = $object->add_photo($dir, $_FILES['userfile']);
|
||||
}
|
||||
@ -82,7 +82,7 @@ $form = new Form($db);
|
||||
if ($object->id)
|
||||
{
|
||||
llxHeader("","",$langs->trans("CardProduct".$object->type));
|
||||
|
||||
|
||||
/*
|
||||
* En mode visu
|
||||
*/
|
||||
@ -90,56 +90,56 @@ if ($object->id)
|
||||
$titre=$langs->trans("CardProduct".$object->type);
|
||||
$picto=($object->type==1?'service':'product');
|
||||
dol_fiche_head($head, 'photos', $titre, 0, $picto);
|
||||
|
||||
|
||||
/*
|
||||
* Confirmation de la suppression de photo
|
||||
*/
|
||||
if ($_GET['action'] == 'delete')
|
||||
if ($action == 'delete')
|
||||
{
|
||||
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete', '', 0, 1);
|
||||
if ($ret == 'html') print '<br>';
|
||||
}
|
||||
|
||||
|
||||
print($mesg);
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
|
||||
// Reference
|
||||
print '<tr>';
|
||||
print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="2">';
|
||||
print $form->showrefnav($object,'ref','',1,'ref');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Libelle
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$object->libelle.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Status (to sell)
|
||||
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td>';
|
||||
print $object->getLibStatut(2,0);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Status (to buy)
|
||||
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td>';
|
||||
print $object->getLibStatut(2,1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
|
||||
print "</div>\n";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Barre d'action */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
||||
print "\n<div class=\"tabsAction\">\n";
|
||||
|
||||
if ($_GET["action"] != 'ajout_photo' && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||
|
||||
if ($action != 'ajout_photo' && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||
{
|
||||
if (! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
@ -152,9 +152,9 @@ if ($object->id)
|
||||
print $langs->trans("AddPhoto").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print "\n</div>\n";
|
||||
|
||||
|
||||
/*
|
||||
* Add a photo
|
||||
*/
|
||||
@ -164,18 +164,18 @@ if ($object->id)
|
||||
$formfile=new FormFile($db);
|
||||
$formfile->form_attach_new_file($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans("AddPhoto"),1);
|
||||
}
|
||||
|
||||
|
||||
// Affiche photos
|
||||
if ($action != 'ajout_photo')
|
||||
{
|
||||
$nbphoto=0;
|
||||
$nbbyrow=5;
|
||||
|
||||
|
||||
$maxWidth = 160;
|
||||
$maxHeight = 120;
|
||||
|
||||
|
||||
print $object->show_photos($dir,1,1000,$nbbyrow,1,1);
|
||||
|
||||
|
||||
if ($object->nbphoto < 1)
|
||||
{
|
||||
print '<br>';
|
||||
|
||||
@ -144,9 +144,9 @@ if ($isphoto)
|
||||
print '</tr>';
|
||||
|
||||
// MultiPrix
|
||||
if ($conf->global->PRODUIT_MULTIPRICES)
|
||||
if (! empty($conf->global->PRODUIT_MULTIPRICES))
|
||||
{
|
||||
if ($socid)
|
||||
if (! empty($socid))
|
||||
{
|
||||
$soc = new Societe($db);
|
||||
$soc->id = $socid;
|
||||
@ -272,8 +272,9 @@ print "</table>\n";
|
||||
|
||||
print "</div>\n";
|
||||
|
||||
|
||||
dol_htmloutput_mesg($mesg);
|
||||
if (! empty($mesg)) {
|
||||
dol_htmloutput_mesg($mesg);
|
||||
}
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
@ -431,7 +432,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."product_price as p,";
|
||||
$sql.= " ".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= " WHERE fk_product = ".$object->id;
|
||||
$sql.= " AND p.fk_user_author = u.rowid";
|
||||
if ($socid && $conf->global->PRODUIT_MULTIPRICES) $sql.= " AND p.price_level = ".$soc->price_level;
|
||||
if (! empty($socid) && ! empty($conf->global->PRODUIT_MULTIPRICES)) $sql.= " AND p.price_level = ".$soc->price_level;
|
||||
$sql.= " ORDER BY p.date_price DESC, p.price_level ASC";
|
||||
//$sql .= $db->plimit();
|
||||
|
||||
|
||||
@ -35,10 +35,12 @@ $langs->load("products");
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
|
||||
$socid='';
|
||||
if (! empty($user->societe_id)) $socid=$user->societe_id;
|
||||
|
||||
// Security check
|
||||
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
|
||||
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype);
|
||||
|
||||
$mesg = '';
|
||||
|
||||
@ -40,10 +40,12 @@ $mode = (GETPOST('mode') ? GETPOST('mode') : 'byunit');
|
||||
$error = 0;
|
||||
$mesg = '';
|
||||
|
||||
$socid='';
|
||||
if (! empty($user->societe_id)) $socid=$user->societe_id;
|
||||
|
||||
// Security check
|
||||
$fieldvalue = (! empty($id) ? $id : $ref);
|
||||
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype);
|
||||
|
||||
|
||||
|
||||
@ -35,6 +35,8 @@ $langs->load("languages");
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$action=GETPOST('action','alpha');
|
||||
$cancel=GETPOST('cancel','alpha');
|
||||
|
||||
// Security check
|
||||
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
|
||||
@ -48,18 +50,18 @@ $result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','',
|
||||
*/
|
||||
|
||||
// retour a l'affichage des traduction si annulation
|
||||
if ($_POST["cancel"] == $langs->trans("Cancel"))
|
||||
if ($cancel == $langs->trans("Cancel"))
|
||||
{
|
||||
$_GET["action"] = '';
|
||||
$action = '';
|
||||
}
|
||||
|
||||
// Validation de l'ajout
|
||||
if ($_POST["action"] == 'vadd' &&
|
||||
$_POST["cancel"] != $langs->trans("Cancel") &&
|
||||
if ($action == 'vadd' &&
|
||||
$cancel != $langs->trans("Cancel") &&
|
||||
($user->rights->produit->creer || $user->rights->service->creer))
|
||||
{
|
||||
$product = new Product($db);
|
||||
$product->fetch($_POST["id"]);
|
||||
$product->fetch($id);
|
||||
$current_lang = $langs->getDefaultLang();
|
||||
|
||||
// update de l'objet
|
||||
@ -79,22 +81,22 @@ $_POST["cancel"] != $langs->trans("Cancel") &&
|
||||
// sauvegarde en base
|
||||
if ( $product->setMultiLangs() > 0 )
|
||||
{
|
||||
$_GET["action"] = '';
|
||||
$action = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$_GET["action"] = 'add';
|
||||
$mesg = $product->mesg_error;
|
||||
$action = 'add';
|
||||
$mesg = '<div class="error">'.$product->error.'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
// Validation de l'edition
|
||||
if ($_POST["action"] == 'vedit' &&
|
||||
$_POST["cancel"] != $langs->trans("Cancel") &&
|
||||
if ($action == 'vedit' &&
|
||||
$cancel != $langs->trans("Cancel") &&
|
||||
($user->rights->produit->creer || $user->rights->service->creer))
|
||||
{
|
||||
$product = new Product($db);
|
||||
$product->fetch($_POST["id"]);
|
||||
$product->fetch($id);
|
||||
$current_lang = $langs->getDefaultLang();
|
||||
|
||||
foreach ( $product->multilangs as $key => $value ) // enregistrement des nouvelles valeurs dans l'objet
|
||||
@ -115,18 +117,17 @@ $_POST["cancel"] != $langs->trans("Cancel") &&
|
||||
|
||||
if ( $product->setMultiLangs() > 0 )
|
||||
{
|
||||
$_GET["action"] = '';
|
||||
$action = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$_GET["action"] = 'edit';
|
||||
$mesg = $product->mesg_error;
|
||||
$action = 'edit';
|
||||
$mesg = '<div class="error">'.$product->error.'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
$product = new Product($db);
|
||||
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
|
||||
if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
|
||||
$result = $product->fetch($id,$ref);
|
||||
|
||||
|
||||
/*
|
||||
@ -143,7 +144,9 @@ $titre=$langs->trans("CardProduct".$product->type);
|
||||
$picto=($product->type==1?'service':'product');
|
||||
dol_fiche_head($head, 'translation', $titre, 0, $picto);
|
||||
|
||||
if ($mesg) print '<div class="error">'.$mesg.'</div>';
|
||||
if (! empty($mesg)) {
|
||||
dol_htmloutput_mesg($mesg);
|
||||
}
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
@ -155,30 +158,33 @@ print '</td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
|
||||
if ($_GET["action"] == 'edit')
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<form action="" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="vedit">';
|
||||
print '<input type="hidden" name="id" value="'.$_GET["id"].'">';
|
||||
print '<input type="hidden" name="id" value="'.$product->id.'">';
|
||||
|
||||
foreach ( $product->multilangs as $key => $value)
|
||||
if (! empty($product->multilangs))
|
||||
{
|
||||
print "<br><b><u>".$langs->trans('Language_'.$key)." :</u></b><br>";
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td valign="top" width="15%" class="fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle-'.$key.'" size="40" value="'.$product->multilangs[$key]["libelle"].'"></td></tr>';
|
||||
print '<tr><td valign="top" width="15%">'.$langs->trans('Description').'</td><td>';
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
|
||||
$doleditor=new DolEditor('desc-'.$key.'',$product->multilangs[$key]["description"],'',160,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_PRODUCTDESC,3,80);
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
print '<tr><td valign="top" width="15%">'.$langs->trans('Note').'</td><td>';
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
|
||||
$doleditor=new DolEditor('note-'.$key.'',$product->multilangs[$key]["note"],'',160,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_PRODUCTDESC,3,80);
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
foreach ($product->multilangs as $key => $value)
|
||||
{
|
||||
print "<br><b><u>".$langs->trans('Language_'.$key)." :</u></b><br>";
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td valign="top" width="15%" class="fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle-'.$key.'" size="40" value="'.$product->multilangs[$key]["libelle"].'"></td></tr>';
|
||||
print '<tr><td valign="top" width="15%">'.$langs->trans('Description').'</td><td>';
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
|
||||
$doleditor=new DolEditor('desc-'.$key.'',$product->multilangs[$key]["description"],'',160,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_PRODUCTDESC,3,80);
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
print '<tr><td valign="top" width="15%">'.$langs->trans('Note').'</td><td>';
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
|
||||
$doleditor=new DolEditor('note-'.$key.'',$product->multilangs[$key]["note"],'',160,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_PRODUCTDESC,3,80);
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
}
|
||||
}
|
||||
|
||||
print '<br><center>';
|
||||
@ -191,18 +197,21 @@ if ($_GET["action"] == 'edit')
|
||||
else
|
||||
{
|
||||
$cnt_trans = 0;
|
||||
foreach ( $product->multilangs as $key => $value)
|
||||
if (! empty($product->multilangs))
|
||||
{
|
||||
$cnt_trans++;
|
||||
$s=picto_from_langcode($key);
|
||||
print "<br>".($s?$s.' ':'')." <b>".$langs->trans('Language_'.$key).":</b><br>";
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td width="15%">'.$langs->trans('Label').'</td><td>'.$product->multilangs[$key]["libelle"].'</td></tr>';
|
||||
print '<tr><td width="15%">'.$langs->trans('Description').'</td><td>'.$product->multilangs[$key]["description"].'</td></tr>';
|
||||
print '<tr><td width="15%">'.$langs->trans('Note').'</td><td>'.$product->multilangs[$key]["note"].'</td></tr>';
|
||||
print '</table>';
|
||||
foreach ($product->multilangs as $key => $value)
|
||||
{
|
||||
$cnt_trans++;
|
||||
$s=picto_from_langcode($key);
|
||||
print "<br>".($s?$s.' ':'')." <b>".$langs->trans('Language_'.$key).":</b><br>";
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td width="15%">'.$langs->trans('Label').'</td><td>'.$product->multilangs[$key]["libelle"].'</td></tr>';
|
||||
print '<tr><td width="15%">'.$langs->trans('Description').'</td><td>'.$product->multilangs[$key]["description"].'</td></tr>';
|
||||
print '<tr><td width="15%">'.$langs->trans('Note').'</td><td>'.$product->multilangs[$key]["note"].'</td></tr>';
|
||||
print '</table>';
|
||||
}
|
||||
}
|
||||
if (!$cnt_trans ) print '<br>'. $langs->trans('NoTranslation');
|
||||
if (! $cnt_trans) print '<br>'. $langs->trans('NoTranslation');
|
||||
}
|
||||
|
||||
print "</div>\n";
|
||||
@ -216,7 +225,7 @@ print "</div>\n";
|
||||
|
||||
print "\n<div class=\"tabsAction\">\n";
|
||||
|
||||
if ($_GET["action"] == '')
|
||||
if ($action == '')
|
||||
if ($user->rights->produit->creer || $user->rights->service->creer)
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/product/traduction.php?action=add&id='.$product->id.'">'.$langs->trans("Add").'</a>';
|
||||
@ -230,7 +239,7 @@ print "\n</div>\n";
|
||||
* Form to add a new translation
|
||||
*/
|
||||
|
||||
if ($_GET["action"] == 'add' && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||
if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service->creer))
|
||||
{
|
||||
print '<br>';
|
||||
print '<form action="" method="post">';
|
||||
@ -264,5 +273,7 @@ if ($_GET["action"] == 'add' && ($user->rights->produit->creer || $user->rights-
|
||||
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
?>
|
||||
$db->close();
|
||||
?>
|
||||
@ -552,19 +552,20 @@ class Task extends CommonObject
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$tasks[$i]->id = $obj->taskid;
|
||||
$tasks[$i]->ref = $obj->taskid;
|
||||
$tasks[$i]->fk_project = $obj->projectid;
|
||||
$tasks[$i]->projectref = $obj->ref;
|
||||
$tasks[$i]->projectlabel = $obj->plabel;
|
||||
$tasks[$i]->label = $obj->label;
|
||||
$tasks[$i]->description = $obj->description;
|
||||
$tasks[$i]->fk_parent = $obj->fk_task_parent;
|
||||
$tasks[$i]->duration = $obj->duration_effective;
|
||||
$tasks[$i]->progress = $obj->progress;
|
||||
$tasks[$i]->public = $obj->public;
|
||||
$tasks[$i]->date_start = $this->db->jdate($obj->date_start);
|
||||
$tasks[$i]->date_end = $this->db->jdate($obj->date_end);
|
||||
$tasks[$i] = (object) array();
|
||||
$tasks[$i]->id = $obj->taskid;
|
||||
$tasks[$i]->ref = $obj->taskid;
|
||||
$tasks[$i]->fk_project = $obj->projectid;
|
||||
$tasks[$i]->projectref = $obj->ref;
|
||||
$tasks[$i]->projectlabel = $obj->plabel;
|
||||
$tasks[$i]->label = $obj->label;
|
||||
$tasks[$i]->description = $obj->description;
|
||||
$tasks[$i]->fk_parent = $obj->fk_task_parent;
|
||||
$tasks[$i]->duration = $obj->duration_effective;
|
||||
$tasks[$i]->progress = $obj->progress;
|
||||
$tasks[$i]->public = $obj->public;
|
||||
$tasks[$i]->date_start = $this->db->jdate($obj->date_start);
|
||||
$tasks[$i]->date_end = $this->db->jdate($obj->date_end);
|
||||
}
|
||||
|
||||
$i++;
|
||||
|
||||
@ -86,7 +86,7 @@ class Address
|
||||
if ($result >= 0)
|
||||
{
|
||||
$now=dol_now();
|
||||
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_address (label, fk_soc, name, datec, fk_user_creat) ";
|
||||
$sql .= " VALUES ('".$this->db->escape($this->label)."', '".$socid."', '".$this->db->escape($this->name)."', ".$this->db->idate($now).", '".$user->id."')";
|
||||
|
||||
@ -188,7 +188,7 @@ class Address
|
||||
if ($result >= 0)
|
||||
{
|
||||
dol_syslog(get_class($this)."::Update verify ok");
|
||||
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."societe_address";
|
||||
@ -203,7 +203,7 @@ class Address
|
||||
$sql.= ", fax = ".($this->fax?"'".$this->db->escape($this->fax)."'":"null");
|
||||
if ($user) $sql .= ",fk_user_modif = '".$user->id."'";
|
||||
$sql .= " WHERE fk_soc = '" . $socid ."' AND rowid = '" . $id ."'";
|
||||
|
||||
|
||||
dol_syslog(get_class($this)."::Update sql=".$sql, LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
@ -216,7 +216,7 @@ class Address
|
||||
{
|
||||
if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||
{
|
||||
|
||||
|
||||
$this->error=$langs->trans("ErrorDuplicateField",$this->name);
|
||||
$result=-1;
|
||||
}
|
||||
@ -302,7 +302,7 @@ class Address
|
||||
$line->phone = $objp->tel;
|
||||
$line->fax = $objp->fax;
|
||||
$line->note = $objp->note;
|
||||
|
||||
|
||||
// deprecated
|
||||
$line->cp = $line->zip;
|
||||
$line->ville = $line->town;
|
||||
@ -381,14 +381,14 @@ class Address
|
||||
$this->phone = $obj->tel;
|
||||
$this->fax = $obj->fax;
|
||||
$this->note = $obj->note;
|
||||
|
||||
|
||||
// deprecated
|
||||
$line->cp = $line->zip;
|
||||
$line->ville = $line->town;
|
||||
$line->pays_id = $line->country_id;
|
||||
$line->pays_code = $line->country_code;
|
||||
$line->pays = $line->country;
|
||||
$line->tel = $line->phone;
|
||||
$this->cp = $this->zip;
|
||||
$this->ville = $this->town;
|
||||
$this->pays_id = $this->country_id;
|
||||
$this->pays_code = $this->country_code;
|
||||
$this->pays = $this->country;
|
||||
$this->tel = $this->phone;
|
||||
|
||||
$result = 1;
|
||||
}
|
||||
@ -435,7 +435,7 @@ class Address
|
||||
print $this->db->error() . '<br>' . $sql;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return name of address with link (and eventually picto)
|
||||
* Use $this->id, $this->label, $this->socid
|
||||
@ -447,12 +447,12 @@ class Address
|
||||
function getNomUrl($withpicto=0,$option='')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
|
||||
$result='';
|
||||
|
||||
|
||||
$lien = '<a href="'.DOL_URL_ROOT.'/comm/address.php?id='.$this->id.'&socid='.$this->socid.'">';
|
||||
$lienfin='</a>';
|
||||
|
||||
|
||||
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowAddress").': '.$this->label,'address').$lienfin.' ');
|
||||
$result.=$lien.$this->label.$lienfin;
|
||||
return $result;
|
||||
|
||||
@ -75,7 +75,12 @@ print "</table></form><br>";
|
||||
/*
|
||||
* Statistics area
|
||||
*/
|
||||
$third = array();
|
||||
$third = array(
|
||||
'customer' => 0,
|
||||
'prospect' => 0,
|
||||
'supplier' => 0,
|
||||
'other' =>0
|
||||
);
|
||||
$total=0;
|
||||
|
||||
$sql = "SELECT s.rowid, s.client, s.fournisseur";
|
||||
@ -92,10 +97,10 @@ if ($result)
|
||||
while ($objp = $db->fetch_object($result))
|
||||
{
|
||||
$found=0;
|
||||
if ($conf->societe->enabled && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS) && ($objp->client == 1 || $objp->client == 3)) { $found=1; $third['customer']++; }
|
||||
if ($conf->societe->enabled && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS) && ($objp->client == 2 || $objp->client == 3)) { $found=1; $third['prospect']++; }
|
||||
if ($conf->fournisseur->enabled && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $objp->fournisseur) { $found=1; $third['supplier']++; }
|
||||
if ($conf->societe->enabled && $objp->client == 0 && $objp->fournisseur == 0) { $found=1; $third['other']++; }
|
||||
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS) && ($objp->client == 1 || $objp->client == 3)) { $found=1; $third['customer']++; }
|
||||
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS) && ($objp->client == 2 || $objp->client == 3)) { $found=1; $third['prospect']++; }
|
||||
if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $objp->fournisseur) { $found=1; $third['supplier']++; }
|
||||
if (! empty($conf->societe->enabled) && $objp->client == 0 && $objp->fournisseur == 0) { $found=1; $third['other']++; }
|
||||
if ($found) $total++;
|
||||
}
|
||||
}
|
||||
@ -103,7 +108,7 @@ else dol_print_error($db);
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").'</th></tr>';
|
||||
if ($conf->use_javascript_ajax && ((round($third['prospect'])?1:0)+(round($third['customer'])?1:0)+(round($third['supplier'])?1:0)+(round($third['other'])?1:0) >= 2))
|
||||
if (! empty($conf->use_javascript_ajax) && ((round($third['prospect'])?1:0)+(round($third['customer'])?1:0)+(round($third['supplier'])?1:0)+(round($third['other'])?1:0) >= 2))
|
||||
{
|
||||
print '<tr><td align="center">';
|
||||
$dataseries=array();
|
||||
|
||||
@ -143,7 +143,9 @@ $fontsizesmaller =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty(
|
||||
|
||||
// Set text color to black or white
|
||||
$tmppart=explode(',',$colorback1);
|
||||
$tmpval=$tmppart[1]+$tmppart[2]+$tmppart[3];
|
||||
$tmpval=(! empty($tmppart[1]) ? $tmppart[1] : '');
|
||||
$tmpval+=(! empty($tmppart[2]) ? $tmppart[2] : '');
|
||||
$tmpval+=(! empty($tmppart[3]) ? $tmppart[3] : '');
|
||||
//print $tmpval;
|
||||
if ($tmpval < 340) $colortextmain='FFFFFF';
|
||||
else $colortextmain='101010';
|
||||
|
||||
@ -531,11 +531,11 @@ class User extends CommonObject
|
||||
|
||||
if ($perms)
|
||||
{
|
||||
if (! is_object($this->rights)) $this->rights = (object) array(); // For avoid error
|
||||
if (! is_object($this->rights->$module)) $this->rights->$module = (object) array();
|
||||
if (! isset($this->rights)) $this->rights = (object) array(); // For avoid error
|
||||
if (! isset($this->rights->$module) || ! is_object($this->rights->$module)) $this->rights->$module = (object) array();
|
||||
if ($subperms)
|
||||
{
|
||||
if (! is_object($this->rights->$module->$perms)) $this->rights->$module->$perms = (object) array();
|
||||
if (! isset($this->rights->$module->$perms) || ! is_object($this->rights->$module->$perms)) $this->rights->$module->$perms = (object) array();
|
||||
$this->rights->$module->$perms->$subperms = 1;
|
||||
}
|
||||
else
|
||||
@ -578,8 +578,11 @@ class User extends CommonObject
|
||||
|
||||
if ($perms)
|
||||
{
|
||||
if (! isset($this->rights)) $this->rights = (object) array(); // For avoid error
|
||||
if (! isset($this->rights->$module) || ! is_object($this->rights->$module)) $this->rights->$module = (object) array();
|
||||
if ($subperms)
|
||||
{
|
||||
if (! isset($this->rights->$module->$perms) || ! is_object($this->rights->$module->$perms)) $this->rights->$module->$perms = (object) array();
|
||||
$this->rights->$module->$perms->$subperms = 1;
|
||||
}
|
||||
else
|
||||
|
||||
@ -470,8 +470,11 @@ class UserGroup extends CommonObject
|
||||
|
||||
if ($perms)
|
||||
{
|
||||
if (! isset($this->rights)) $this->rights = (object) array(); // For avoid error
|
||||
if (! isset($this->rights->$module) || ! is_object($this->rights->$module)) $this->rights->$module = (object) array();
|
||||
if ($subperms)
|
||||
{
|
||||
if (! isset($this->rights->$module->$perms) || ! is_object($this->rights->$module->$perms)) $this->rights->$module->$perms = (object) array();
|
||||
$this->rights->$module->$perms->$subperms = 1;
|
||||
}
|
||||
else
|
||||
|
||||
@ -38,7 +38,7 @@ if ($user->id == $id) // A user can always read its own card
|
||||
{
|
||||
$feature2='';
|
||||
}
|
||||
$result = restrictedArea($user, $feature, $id, '&user', $feature2);
|
||||
$result = restrictedArea($user, 'user', $id, '&user', $feature2);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user