forked from Wavyzz/dolibarr
Fix: Supprime warnings mode error E_ALL
This commit is contained in:
@@ -23,7 +23,8 @@
|
||||
* $Source$
|
||||
*/
|
||||
|
||||
/*! \file htdocs/admin/adherent.php
|
||||
/**
|
||||
\file htdocs/admin/adherent.php
|
||||
\ingroup adherent
|
||||
\brief Page d'administration/configuration du module Adherent
|
||||
\version $Revision$
|
||||
@@ -117,9 +118,51 @@ llxHeader();
|
||||
* Interface de configuration de certaines variables de la partie adherent
|
||||
*/
|
||||
|
||||
print_titre("Gestion des adh<64>rents : Configurations de parametres");
|
||||
print_titre($langs->trans("MembersSetup"));
|
||||
print "<br>";
|
||||
|
||||
|
||||
print_fiche_titre($langs->trans("MemberMainOptions"));
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td>'.$langs->trans("Value").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Action").'</td>';
|
||||
print "</tr>\n";
|
||||
$var=true;
|
||||
$form = new Form($db);
|
||||
|
||||
// Mail obligatoire
|
||||
$var=!$var;
|
||||
print '<form action="adherent.php" method="POST">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||
print '<input type="hidden" name="constname" value="ADHERENT_MAIL_REQUIRED">';
|
||||
print "<tr $bc[$var] class=value><td>".$langs->trans("AdherentMailRequired").'</td><td>';
|
||||
$form->selectyesnonum('constvalue',ADHERENT_MAIL_REQUIRED);
|
||||
print '</td><td align="center" width="80">';
|
||||
print '<input type="Submit" value="'.$langs->trans("Update").'" name="Button">';
|
||||
print "</td></tr>\n";
|
||||
print '</form>';
|
||||
|
||||
// Insertion cotisations dans compte financier
|
||||
if ($conf->banque->enabled)
|
||||
{
|
||||
$var=!$var;
|
||||
print '<form action="adherent.php" method="POST">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||
print '<input type="hidden" name="constname" value="ADHERENT_BANK_USE">';
|
||||
print "<tr $bc[$var] class=value><td>".$langs->trans("AddSubscriptionIntoAccount").'</td><td>';
|
||||
$form->selectyesnonum('constvalue',ADHERENT_BANK_USE);
|
||||
print '</td><td align="center" width="80">';
|
||||
print '<input type="Submit" value="'.$langs->trans("Update").'" name="Button">';
|
||||
print "</td></tr>\n";
|
||||
print '</form>';
|
||||
}
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
/*
|
||||
* Mailman
|
||||
*/
|
||||
@@ -146,29 +189,6 @@ else
|
||||
|
||||
print "<hr>\n";
|
||||
|
||||
/*
|
||||
* Gestion banquaire
|
||||
*/
|
||||
if (defined("ADHERENT_BANK_USE") && ADHERENT_BANK_USE == 1)
|
||||
{
|
||||
$lien=img_tick().' ';
|
||||
$lien.='<a href="adherent.php?action=unset&value=0&name=ADHERENT_BANK_USE">'.$langs->trans("Disable").'</a>';
|
||||
// Edition des varibales globales rattache au theme Mailman
|
||||
$constantes=array('ADHERENT_BANK_USE_AUTO',
|
||||
'ADHERENT_BANK_ACCOUNT',
|
||||
'ADHERENT_BANK_CATEGORIE'
|
||||
);
|
||||
print_fiche_titre("Gestion banquaire des adherents",$lien);
|
||||
form_constantes($constantes);
|
||||
}
|
||||
else
|
||||
{
|
||||
$lien='<a href="adherent.php?action=set&value=1&name=ADHERENT_BANK_USE">'.$langs->trans("Activate").'</a>';
|
||||
print_fiche_titre("Gestion banquaire des adherents",$lien);
|
||||
}
|
||||
|
||||
print "<hr>\n";
|
||||
|
||||
/*
|
||||
* Spip
|
||||
*/
|
||||
@@ -219,12 +239,11 @@ else
|
||||
}
|
||||
|
||||
print "<hr>\n";
|
||||
$var=!$var;
|
||||
|
||||
/*
|
||||
* Edition des varibales globales non rattache a un theme specifique
|
||||
*/
|
||||
$constantes=array(
|
||||
'ADHERENT_MAIL_REQUIRED',
|
||||
'ADHERENT_TEXT_NEW_ADH',
|
||||
'ADHERENT_MAIL_COTIS_SUBJECT',
|
||||
'ADHERENT_MAIL_COTIS',
|
||||
@@ -258,14 +277,14 @@ function form_constantes($tableau){
|
||||
// Variables globales
|
||||
global $db,$bc,$langs;
|
||||
$form = new Form($db);
|
||||
print '<table class="noborder">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td>'.$langs->trans("Value").'</td>';
|
||||
print '<td>'.$langs->trans("Type").'</td>';
|
||||
print '<td>'.$langs->trans("Action").'</td>';
|
||||
print '<td align="center" width="80">'.$langs->trans("Action").'</td>';
|
||||
print "</tr>\n";
|
||||
$var=True;
|
||||
$var=true;
|
||||
|
||||
foreach($tableau as $const){
|
||||
$sql = "SELECT rowid, name, value, type, note FROM ".MAIN_DB_PREFIX."const WHERE name='$const'";
|
||||
@@ -302,9 +321,9 @@ function form_constantes($tableau){
|
||||
print '</td><td>';
|
||||
$form->select_array('consttype',array('yesno','texte','chaine'),2);
|
||||
}
|
||||
print '</td><td>';
|
||||
print '</td><td align="center">';
|
||||
|
||||
print '<input type="Submit" value="Update" name="Button"> ';
|
||||
print '<input type="Submit" value="'.$langs->trans("Update").'" name="Button"> ';
|
||||
// print '<a href="adherent.php?name='.$const.'&action=unset">'.img_delete().'</a>';
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
@@ -37,32 +37,36 @@ if (!$user->admin)
|
||||
accessforbidden();
|
||||
|
||||
|
||||
if (! defined("MAIN_MOTD")) define("MAIN_MOTD","");
|
||||
|
||||
|
||||
$dirtop = "../includes/menus/barre_top";
|
||||
$dirleft = "../includes/menus/barre_left";
|
||||
$dirtheme = "../theme";
|
||||
|
||||
// Liste des zone de recherche permanantes support<72>es
|
||||
$searchform=array("main_searchform_societe","main_searchform_contact","main_searchform_produitservice");
|
||||
$searchformconst=array(MAIN_SEARCHFORM_SOCIETE,MAIN_SEARCHFORM_CONTACT,MAIN_SEARCHFORM_PRODUITSERVICE);
|
||||
$searchformconst=array($conf->global->MAIN_SEARCHFORM_SOCIETE,$conf->global->MAIN_SEARCHFORM_CONTACT,$conf->global->MAIN_SEARCHFORM_PRODUITSERVICE);
|
||||
$searchformtitle=array($langs->trans("Companies"),$langs->trans("Contacts"),$langs->trans("ProductsAndServices"));
|
||||
|
||||
|
||||
|
||||
if ($_POST["action"] == 'update')
|
||||
if (isset($_POST["action"]) && $_POST["action"] == 'update')
|
||||
{
|
||||
dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["main_lang_default"]);
|
||||
dolibarr_set_const($db, "MAIN_MENU_BARRETOP", $_POST["main_menu_barretop"]);
|
||||
dolibarr_set_const($db, "MAIN_MENU_BARRELEFT", $_POST["main_menu_barreleft"]);
|
||||
dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"]);
|
||||
|
||||
dolibarr_set_const($db, "SIZE_LISTE_LIMIT", $_POST["size_liste_limit"]);
|
||||
dolibarr_set_const($db, "MAIN_MOTD", trim($_POST["main_motd"]));
|
||||
|
||||
dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"]);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT",$_POST["main_searchform_contact"]);
|
||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_SOCIETE",$_POST["main_searchform_societe"]);
|
||||
dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE",$_POST["main_searchform_produitservice"]);
|
||||
|
||||
$_SESSION["mainmenu"]="";
|
||||
dolibarr_set_const($db, "MAIN_MOTD", trim($_POST["main_motd"]));
|
||||
|
||||
$_SESSION["mainmenu"]=""; // Le gestionnaire de menu a pu changer
|
||||
|
||||
Header("Location: ihm.php?mainmenu=home&leftmenu=setup");
|
||||
}
|
||||
@@ -70,10 +74,6 @@ if ($_POST["action"] == 'update')
|
||||
|
||||
llxHeader();
|
||||
|
||||
if (!defined("MAIN_MOTD") && strlen(trim(MAIN_MOTD)))
|
||||
{
|
||||
define("MAIN_MOTD","");
|
||||
}
|
||||
|
||||
print_titre($langs->trans("GUISetup"));
|
||||
|
||||
@@ -81,7 +81,7 @@ print "<br>\n";
|
||||
|
||||
|
||||
|
||||
if ($_GET["action"] == 'edit')
|
||||
if (isset($_GET["action"]) && $_GET["action"] == 'edit')
|
||||
{
|
||||
print '<form method="post" action="ihm.php">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
@@ -94,14 +94,14 @@ if ($_GET["action"] == 'edit')
|
||||
|
||||
// Langue par defaut
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="30%">'.$langs->trans("DefaultLanguage").'</td><td>';
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DefaultLanguage").'</td><td>';
|
||||
$html=new Form($db);
|
||||
$html->select_lang(MAIN_LANG_DEFAULT,'main_lang_default');
|
||||
$html->select_lang($conf->global->MAIN_LANG_DEFAULT,'main_lang_default');
|
||||
print '</td></tr>';
|
||||
|
||||
// Menu top
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("MenuTopManager").'</td>';
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMenuTopManager").'</td>';
|
||||
print '<td><select class="flat" name="main_menu_barretop">';
|
||||
$handle=opendir($dirtop);
|
||||
while (($file = readdir($handle))!==false)
|
||||
@@ -109,7 +109,7 @@ if ($_GET["action"] == 'edit')
|
||||
if (is_file($dirtop."/".$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
|
||||
{
|
||||
$filelib=eregi_replace('\.php$','',$file);
|
||||
if ($file == MAIN_MENU_BARRETOP)
|
||||
if ($file == $conf->global->MAIN_MENU_BARRETOP)
|
||||
{
|
||||
print '<option value="'.$file.'" selected>'.$filelib.'</option>';
|
||||
}
|
||||
@@ -125,7 +125,7 @@ if ($_GET["action"] == 'edit')
|
||||
|
||||
// Menu left
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("MenuLeftManager").'</td>';
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMenuLeftManager").'</td>';
|
||||
print '<td><select class="flat" name="main_menu_barreleft">';
|
||||
$handle=opendir($dirleft);
|
||||
while (($file = readdir($handle))!==false)
|
||||
@@ -133,7 +133,7 @@ if ($_GET["action"] == 'edit')
|
||||
if (is_file($dirleft."/".$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')
|
||||
{
|
||||
$filelib=eregi_replace('\.php$','',$file);
|
||||
if ($file == MAIN_MENU_BARRELEFT)
|
||||
if ($file == $conf->global->MAIN_MENU_BARRELEFT)
|
||||
{
|
||||
print '<option value="'.$file.'" selected>'.$filelib.'</option>';
|
||||
}
|
||||
@@ -149,11 +149,7 @@ if ($_GET["action"] == 'edit')
|
||||
|
||||
// Taille max des listes
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("MaxSizeList").'</td><td><input class="flat" name="size_liste_limit" size="4" value="' . SIZE_LISTE_LIMIT . '"></td></tr>';
|
||||
|
||||
// Message of the day
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("MessageOfDay").'</td><td><textarea cols="60" rows="3" name="main_motd" size="20">' .stripslashes(MAIN_MOTD) . '</textarea></td></tr>';
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMaxSizeList").'</td><td><input class="flat" name="size_liste_limit" size="4" value="' . SIZE_LISTE_LIMIT . '"></td></tr>';
|
||||
|
||||
print '</table><br>';
|
||||
|
||||
@@ -169,11 +165,22 @@ if ($_GET["action"] == 'edit')
|
||||
$var=True;
|
||||
foreach ($searchform as $key => $value) {
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'"><td>'.$searchformtitle[$key].'</td><td>';
|
||||
print '<tr '.$bc[$var].'"><td width="35%">'.$searchformtitle[$key].'</td><td>';
|
||||
$html->selectyesnonum($searchform[$key],$searchformconst[$key]);
|
||||
print '</td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
// Message of the day
|
||||
$var=true;
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageOfDay").'</td><td><textarea cols="60" rows="3" name="main_motd" size="20">' . stripslashes($conf->global->MAIN_MOTD) . '</textarea></td></tr>';
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
print '<input class="tabAction" type="submit" value="'.$langs->trans("Save").'">';
|
||||
@@ -189,25 +196,22 @@ else
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="30%">'.$langs->trans("DefaultLanguage").'</td><td>' . MAIN_LANG_DEFAULT . '</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DefaultLanguage").'</td><td>' . $conf->global->MAIN_LANG_DEFAULT . '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("MenuTopManager").'</td><td>';
|
||||
$filelib=eregi_replace('\.php$','',MAIN_MENU_BARRETOP);
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMenuTopManager").'</td><td>';
|
||||
$filelib=eregi_replace('\.php$','',$conf->global->MAIN_MENU_BARRETOP);
|
||||
print $filelib;
|
||||
print '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("MenuLeftManager").'</td><td>';
|
||||
$filelib=eregi_replace('\.php$','',MAIN_MENU_BARRELEFT);
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMenuLeftManager").'</td><td>';
|
||||
$filelib=eregi_replace('\.php$','',$conf->global->MAIN_MENU_BARRELEFT);
|
||||
print $filelib;
|
||||
print '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("MaxSizeList").'</td><td>' . SIZE_LISTE_LIMIT . '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("MessageOfDay").'</td><td>' . stripslashes(nl2br(MAIN_MOTD)) . '</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("DefaultMaxSizeList").'</td><td>' . $conf->global->SIZE_LISTE_LIMIT . '</td></tr>';
|
||||
|
||||
print '</table><br>';
|
||||
|
||||
@@ -219,12 +223,20 @@ else
|
||||
// Liste des zone de recherche permanantes support<72>es
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("PermanentLeftSearchForm").'</td><td>'.$langs->trans("Activated").'</td></tr>';
|
||||
$var=True;
|
||||
$var=true;
|
||||
foreach ($searchform as $key => $value) {
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'"><td>'.$searchformtitle[$key].'</td><td>' . ($searchformconst[$key]?$langs->trans("yes"):$langs->trans("no")) . '</td></tr>';
|
||||
print '<tr '.$bc[$var].'"><td width="35%">'.$searchformtitle[$key].'</td><td>' . ($searchformconst[$key]?$langs->trans("yes"):$langs->trans("no")) . '</td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
$var=true;
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("MessageOfDay").'</td><td>' . stripslashes(nl2br($conf->global->MAIN_MOTD)) . '</td></tr>';
|
||||
print '</table><br>';
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="tabAction" href="ihm.php?action=edit">'.$langs->trans("Edit").'</a>';
|
||||
@@ -235,11 +247,11 @@ else
|
||||
|
||||
function show_theme($edit=0)
|
||||
{
|
||||
global $langs,$dirtheme,$bc;
|
||||
global $conf,$langs,$dirtheme,$bc;
|
||||
|
||||
$nbofthumbs=5;
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="'.$nbofthumbs.'">'.$langs->trans("Skin").'</td></tr>';
|
||||
print '<tr class="liste_titre"><td colspan="'.$nbofthumbs.'">'.$langs->trans("DefaultSkin").'</td></tr>';
|
||||
|
||||
$handle=opendir($dirtheme);
|
||||
$var=false;
|
||||
@@ -256,7 +268,7 @@ function show_theme($edit=0)
|
||||
$file=$dirtheme."/".$subdir."/thumb.png";
|
||||
if (! file_exists($file)) $file=$dirtheme."/nophoto.jpg";
|
||||
print '<table><tr><td><img src="'.$file.'" width="80" height="60"></td></tr><tr><td align="center">';
|
||||
if ($subdir == MAIN_THEME)
|
||||
if ($subdir == $conf->global->MAIN_THEME)
|
||||
{
|
||||
print '<input '.($edit?'':'disabled').' type="radio" '.$bc[$var].' style="border: 0px;" checked name="main_theme" value="'.$subdir.'"> <b>'.$subdir.'</b>';
|
||||
}
|
||||
|
||||
@@ -69,29 +69,37 @@ while (($file = readdir($handle))!==false)
|
||||
include_once("../../includes/modules/$file");
|
||||
$objMod = new $modName($db);
|
||||
|
||||
$modules[$objMod->numero]=$objMod->name;
|
||||
$picto[$objMod->numero]=$objMod->picto?$objMod->picto:'generic';
|
||||
$permissions[$objMod->numero]=$objMod->rights;
|
||||
$modules[$objMod->numero]=$objMod;
|
||||
$modules_names[$objMod->numero]=$objMod->name;
|
||||
|
||||
$picto[$objMod->numero]=(isset($objMod->picto) && $objMod->picto)?$objMod->picto:'generic';
|
||||
}
|
||||
}
|
||||
}
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Modules").'</td>';
|
||||
print '<td>'.$langs->trans("Id").'</td>';
|
||||
print '<td>'.$langs->trans("Version").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Id Module").'</td>';
|
||||
print '<td>'.$langs->trans("Id Permissions").'</td>';
|
||||
print '</tr>';
|
||||
$var=false;
|
||||
$sortorder=$modules;
|
||||
$sortorder=$modules_names;
|
||||
ksort($sortorder);
|
||||
foreach($sortorder as $numero=>$name)
|
||||
{
|
||||
$idperms="";
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td width=\"240\">".img_object("",$picto[$numero]).' '.$modules[$numero]."</td><td>".$numero."</td>";
|
||||
if ($permissions[$numero])
|
||||
// Module
|
||||
print "<tr $bc[$var]><td width=\"240\">".img_object("",$picto[$numero]).' '.$modules[$numero]->getName()."</td>";
|
||||
// Version
|
||||
print '<td>'.$modules[$numero]->getVersion().'</td>';
|
||||
// Id
|
||||
print '<td align="center">'.$numero.'</td>';
|
||||
// Permissions
|
||||
if ($modules[$numero]->rights)
|
||||
{
|
||||
foreach($permissions[$numero] as $rights)
|
||||
foreach($modules[$numero]->rights as $rights)
|
||||
{
|
||||
$idperms.=($idperms?",":"").$rights[0];
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ $chaine = eregi_replace('</h2>','</div>',$chaine);
|
||||
$chaine = eregi_replace('<td class="e">','<td class="impair">',$chaine);
|
||||
$chaine = eregi_replace('<td class="v">','<td class="pair">',$chaine);
|
||||
|
||||
if ($title)
|
||||
if (isset($title))
|
||||
{
|
||||
print_titre($title);
|
||||
print '<br>';
|
||||
|
||||
@@ -260,10 +260,10 @@ else
|
||||
|
||||
|
||||
/*
|
||||
* Mise a jour des date de cr<63>ation de contrat
|
||||
* Mise a jour des dates de cr<63>ation de contrat
|
||||
*/
|
||||
print '<br>';
|
||||
print "<b>Mise a jour des dates de cr<63>ation de contrat qui ont une valeur incoh<6F>rentes</b><br>\n";
|
||||
print "<b>Mise a jour des dates de cr<63>ation de contrat qui ont une valeur incoh<6F>rente</b><br>\n";
|
||||
|
||||
$sql="update llx_contrat set datec=date_contrat where datec is null or datec > date_contrat";
|
||||
$resql = $db->query($sql);
|
||||
@@ -272,6 +272,51 @@ if ($db->affected_rows() > 0) print "Ok<br>\n";
|
||||
else print "Pas ou plus de date de contrats <20> corriger.<br>\n";
|
||||
|
||||
|
||||
/*
|
||||
* Reouverture des contrats qui ont au moins une ligne non ferm<72>e
|
||||
*/
|
||||
print '<br>';
|
||||
print "<b>Reouverture des contrats qui ont au moins un service actif non ferm<72>e</b><br>\n";
|
||||
|
||||
$sql = "SELECT c.rowid as cref FROM llx_contrat as c, llx_contratdet as cd";
|
||||
$sql.= " WHERE cd.statut = 4 AND c.statut=2 AND c.rowid=cd.fk_contrat";
|
||||
$resql = $db->query($sql);
|
||||
if (! $resql) dolibarr_print_error($db);
|
||||
if ($db->affected_rows() > 0) {
|
||||
$i = 0;
|
||||
$row = array();
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
if ($num)
|
||||
{
|
||||
$nbcontratsmodifie=0;
|
||||
$db->begin();
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
print "R<EFBFBD>ouverture contrat ".$obj->cref."<br>\n";
|
||||
$sql ="UPDATE ".MAIN_DB_PREFIX."contrat";
|
||||
$sql.=" SET statut=1";
|
||||
$sql.=" WHERE rowid=".$obj->cref;
|
||||
$resql2=$db->query($sql);
|
||||
if (! $resql2) dolibarr_print_error($db);
|
||||
|
||||
$nbcontratsmodifie++;
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
$db->commit();
|
||||
|
||||
if ($nbcontratsmodifie) print "$nbcontratsmodifie contrats modifi<66>s<br>\n";
|
||||
else print "Pas ou plus de contrats <20> corriger.<br>\n";
|
||||
}
|
||||
}
|
||||
else print "Pas ou plus de contrats <20> r<>ouvrir.<br>\n";
|
||||
|
||||
|
||||
print "<br>";
|
||||
$db->close();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user