mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix: strict mode killer
This commit is contained in:
parent
ed61508b3f
commit
7eef637776
|
|
@ -111,7 +111,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
|
|||
print_fiche_titre($langs->trans("MembersSetup"),$linkback,'setup');
|
||||
|
||||
|
||||
$head = member_admin_prepare_head($adh);
|
||||
$head = member_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'general', $langs->trans("Member"), 0, 'user');
|
||||
|
||||
|
|
@ -136,10 +136,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0)
|
|||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||
print '<input type="hidden" name="constname" value="ADHERENT_LOGIN_NOT_REQUIRED">';
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("AdherentLoginRequired").'</td><td>';
|
||||
print $form->selectyesno('constvalue',!$conf->global->ADHERENT_LOGIN_NOT_REQUIRED,1);
|
||||
print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)?$conf->global->ADHERENT_LOGIN_NOT_REQUIRED:1),1);
|
||||
print '</td><td align="center" width="80">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||
print "</td></tr>\n";
|
||||
|
|
@ -151,10 +150,9 @@ $var=!$var;
|
|||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
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].'><td>'.$langs->trans("AdherentMailRequired").'</td><td>';
|
||||
print $form->selectyesno('constvalue',$conf->global->ADHERENT_MAIL_REQUIRED,1);
|
||||
print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_MAIL_REQUIRED)?$conf->global->ADHERENT_MAIL_REQUIRED:0),1);
|
||||
print '</td><td align="center" width="80">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||
print "</td></tr>\n";
|
||||
|
|
@ -165,10 +163,9 @@ $var=!$var;
|
|||
print '<form action="adherent.php" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||
print '<input type="hidden" name="constname" value="ADHERENT_DEFAULT_SENDINFOBYMAIL">';
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("MemberSendInformationByMailByDefault").'</td><td>';
|
||||
print $form->selectyesno('constvalue',$conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL,1);
|
||||
print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?$conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL:0),1);
|
||||
print '</td><td align="center" width="80">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||
print "</td></tr>\n";
|
||||
|
|
@ -179,7 +176,6 @@ $var=!$var;
|
|||
print '<form action="adherent.php" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
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].'><td>'.$langs->trans("AddSubscriptionIntoAccount").'</td>';
|
||||
if ($conf->banque->enabled)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 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
|
||||
|
|
@ -38,7 +39,8 @@ $tmptype2label=getStaticMember(get_class($extrafields),'type2label');
|
|||
$type2label=array('');
|
||||
foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
|
||||
|
||||
$action=GETPOST("action");
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$attrname=GETPOST('attrname', 'alpha');
|
||||
$elementtype='member';
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
|
@ -66,7 +68,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
|
|||
print_fiche_titre($langs->trans("MembersSetup"),$linkback,'setup');
|
||||
|
||||
|
||||
$head = member_admin_prepare_head($adh);
|
||||
$head = member_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'attributes', $langs->trans("Member"), 0, 'user');
|
||||
|
||||
|
|
@ -161,32 +163,32 @@ if ($action == 'create')
|
|||
/* Edition d'un champ optionnel */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($_GET["attrname"] && $action == 'edit')
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
{
|
||||
print "<br>";
|
||||
print_titre($langs->trans("FieldEdition",$_GET["attrname"]));
|
||||
print_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
/*
|
||||
* formulaire d'edition
|
||||
*/
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?attrname='.$_GET["attrname"].'">';
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?attrname='.$attrname.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="attrname" value="'.$_GET["attrname"].'">';
|
||||
print '<input type="hidden" name="attrname" value="'.$attrname.'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<table summary="listofattributes" class="border" width="100%">';
|
||||
|
||||
// Label
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired" required>'.$langs->trans("Label").'</td><td class="valeur"><input type="text" name="label" size="40" value="'.$extrafields->attribute_label[$_GET["attrname"]].'"></td>';
|
||||
print '<td class="fieldrequired" required>'.$langs->trans("Label").'</td><td class="valeur"><input type="text" name="label" size="40" value="'.$extrafields->attribute_label[$attrname].'"></td>';
|
||||
print '</tr>';
|
||||
// Code
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired" required>'.$langs->trans("AttributeCode").'</td>';
|
||||
print '<td class="valeur">'.$_GET["attrname"].' </td>';
|
||||
print '<td class="valeur">'.$attrname.' </td>';
|
||||
print '</tr>';
|
||||
// Type
|
||||
$type=$extrafields->attribute_type[$_GET["attrname"]];
|
||||
$size=$extrafields->attribute_size[$_GET["attrname"]];
|
||||
$type=$extrafields->attribute_type[$attrname];
|
||||
$size=$extrafields->attribute_size[$attrname];
|
||||
print '<tr><td class="fieldrequired" required>'.$langs->trans("Type").'</td>';
|
||||
print '<td class="valeur">';
|
||||
print $type2label[$type];
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
|
|||
print_fiche_titre($langs->trans("MailmanSpipSetup"),$linkback,'setup');
|
||||
|
||||
|
||||
$head = mailmanspip_admin_prepare_head($adh);
|
||||
$head = mailmanspip_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -32,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
|||
$langs->load("members");
|
||||
$langs->load("admin");
|
||||
|
||||
$action=GETPOST('action');
|
||||
$action=GETPOST('action', 'alpha');
|
||||
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
|
|
@ -43,10 +44,15 @@ if (! $user->admin) accessforbidden();
|
|||
|
||||
if ($action == 'update')
|
||||
{
|
||||
$res=dolibarr_set_const($db, "MEMBER_ENABLE_PUBLIC",$_POST["MEMBER_ENABLE_PUBLIC"],'chaine',0,'',$conf->entity);
|
||||
$res=dolibarr_set_const($db, "MEMBER_NEWFORM_AMOUNT",$_POST["MEMBER_NEWFORM_AMOUNT"],'chaine',0,'',$conf->entity);
|
||||
$res=dolibarr_set_const($db, "MEMBER_NEWFORM_EDITAMOUNT",$_POST["MEMBER_NEWFORM_EDITAMOUNT"],'chaine',0,'',$conf->entity);
|
||||
$res=dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE",$_POST["MEMBER_NEWFORM_PAYONLINE"],'chaine',0,'',$conf->entity);
|
||||
$public=GETPOST('MEMBER_ENABLE_PUBLIC');
|
||||
$amount=GETPOST('MEMBER_NEWFORM_AMOUNT');
|
||||
$editamount=GETPOST('MEMBER_NEWFORM_EDITAMOUNT');
|
||||
$payonline=GETPOST('MEMBER_NEWFORM_PAYONLINE');
|
||||
|
||||
$res=dolibarr_set_const($db, "MEMBER_ENABLE_PUBLIC",$public,'chaine',0,'',$conf->entity);
|
||||
$res=dolibarr_set_const($db, "MEMBER_NEWFORM_AMOUNT",$amount,'chaine',0,'',$conf->entity);
|
||||
$res=dolibarr_set_const($db, "MEMBER_NEWFORM_EDITAMOUNT",$editamount,'chaine',0,'',$conf->entity);
|
||||
$res=dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE",$payonline,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
|
|
@ -74,7 +80,7 @@ llxHeader('',$langs->trans("MembersSetup"),$help_url);
|
|||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print_fiche_titre($langs->trans("MembersSetup"),$linkback,'setup');
|
||||
|
||||
$head = member_admin_prepare_head($adh);
|
||||
$head = member_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'public', $langs->trans("Member"), 0, 'user');
|
||||
|
||||
|
|
@ -123,7 +129,7 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|||
print '<tr '.$bc[$var].'><td>';
|
||||
print $langs->trans("EnablePublicSubscriptionForm");
|
||||
print '</td><td width="60" align="right">';
|
||||
print $form->selectyesno("MEMBER_ENABLE_PUBLIC",$conf->global->MEMBER_ENABLE_PUBLIC,1);
|
||||
print $form->selectyesno("MEMBER_ENABLE_PUBLIC",(! empty($conf->global->MEMBER_ENABLE_PUBLIC)?$conf->global->MEMBER_ENABLE_PUBLIC:0),1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Type
|
||||
|
|
@ -141,7 +147,7 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|||
print '<tr '.$bcdd[$var].'><td>';
|
||||
print $langs->trans("DefaultAmount");
|
||||
print '</td><td width="60" align="right">';
|
||||
print '<input type="text" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" size="5" value="'.$conf->global->MEMBER_NEWFORM_AMOUNT.'">';;
|
||||
print '<input type="text" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" size="5" value="'.(! empty($conf->global->MEMBER_NEWFORM_AMOUNT)?$conf->global->MEMBER_NEWFORM_AMOUNT:'').'">';;
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Can edit
|
||||
|
|
@ -150,10 +156,10 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
|||
print '<tr '.$bcdd[$var].'><td>';
|
||||
print $langs->trans("CanEditAmount");
|
||||
print '</td><td width="60" align="right">';
|
||||
print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT",$conf->global->MEMBER_NEWFORM_EDITAMOUNT,1);
|
||||
print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT",(! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)?$conf->global->MEMBER_NEWFORM_EDITAMOUNT:0),1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
if ($conf->paybox->enabled || $conf->paypal->enabled)
|
||||
if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled))
|
||||
{
|
||||
// Jump to an online payment page
|
||||
$var=! $var;
|
||||
|
|
@ -163,7 +169,7 @@ if ($conf->paybox->enabled || $conf->paypal->enabled)
|
|||
$listofval=array();
|
||||
if ($conf->paybox->enabled) $listofval['paybox']='Paybox';
|
||||
if ($conf->paypal->enabled) $listofval['paypal']='PayPal';
|
||||
print $form->selectarray("MEMBER_NEWFORM_PAYONLINE",$listofval,$conf->global->MEMBER_NEWFORM_PAYONLINE,1);
|
||||
print $form->selectarray("MEMBER_NEWFORM_PAYONLINE",$listofval,(! empty($conf->global->MEMBER_NEWFORM_PAYONLINE)?$conf->global->MEMBER_NEWFORM_PAYONLINE:''),1);
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
|
|||
print_fiche_titre($langs->trans("MailmanSpipSetup"),$linkback,'setup');
|
||||
|
||||
|
||||
$head = mailmanspip_admin_prepare_head($adh);
|
||||
$head = mailmanspip_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user');
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
|
||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -1024,7 +1024,7 @@ function form_constantes($tableau)
|
|||
$sql.= ", note";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."const";
|
||||
$sql.= " WHERE ".$db->decrypt('name')." = '".$const."'";
|
||||
$sql.= " AND entity in (0, ".$conf->entity.")";
|
||||
$sql.= " AND entity IN (0, ".$conf->entity.")";
|
||||
$sql.= " ORDER BY name ASC, entity DESC";
|
||||
$result = $db->query($sql);
|
||||
|
||||
|
|
@ -1034,6 +1034,11 @@ function form_constantes($tableau)
|
|||
$obj = $db->fetch_object($result); // Take first result of select
|
||||
$var=!$var;
|
||||
|
||||
// For avoid warning in strict mode
|
||||
if (empty($obj)) {
|
||||
$obj = (object) array('rowid'=>'','name'=>'','value'=>'','type'=>'','note'=>'');
|
||||
}
|
||||
|
||||
print "\n".'<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
|
||||
print "<tr ".$bc[$var].">";
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ function member_prepare_head($object)
|
|||
* @param Object $object Member
|
||||
* @return array head
|
||||
*/
|
||||
function member_admin_prepare_head($object)
|
||||
function member_admin_prepare_head()
|
||||
{
|
||||
global $langs, $conf, $user;
|
||||
|
||||
|
|
@ -122,7 +122,7 @@ function member_admin_prepare_head($object)
|
|||
// Entries must be declared in modules descriptor with line
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'member_admin');
|
||||
complete_head_from_modules($conf,$langs,'',$head,$h,'member_admin');
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/adherents/admin/adherent_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFields");
|
||||
|
|
@ -134,7 +134,7 @@ function member_admin_prepare_head($object)
|
|||
$head[$h][2] = 'public';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'member_admin','remove');
|
||||
complete_head_from_modules($conf,$langs,'',$head,$h,'member_admin','remove');
|
||||
|
||||
return $head;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 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
|
||||
|
|
@ -40,7 +41,8 @@ $tmptype2label=getStaticMember(get_class($extrafields),'type2label');
|
|||
$type2label=array('');
|
||||
foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
|
||||
|
||||
$action=GETPOST("action");
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$attrname=GETPOST('attrname', 'alpha');
|
||||
$elementtype='product';
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
|
@ -174,32 +176,32 @@ if ($action == 'create')
|
|||
/* Edition d'un champ optionnel */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($_GET["attrname"] && $action == 'edit')
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
{
|
||||
print "<br>";
|
||||
print_titre($langs->trans("FieldEdition",$_GET["attrname"]));
|
||||
print_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
/*
|
||||
* formulaire d'edition
|
||||
*/
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?attrname='.$_GET["attrname"].'">';
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?attrname='.$attrname.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="attrname" value="'.$_GET["attrname"].'">';
|
||||
print '<input type="hidden" name="attrname" value="'.$attrname.'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<table summary="listofattributes" class="border" width="100%">';
|
||||
|
||||
// Label
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired" required>'.$langs->trans("Label").'</td><td class="valeur"><input type="text" name="label" size="40" value="'.$extrafields->attribute_label[$_GET["attrname"]].'"></td>';
|
||||
print '<td class="fieldrequired" required>'.$langs->trans("Label").'</td><td class="valeur"><input type="text" name="label" size="40" value="'.$extrafields->attribute_label[$attrname].'"></td>';
|
||||
print '</tr>';
|
||||
// Code
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired" required>'.$langs->trans("AttributeCode").'</td>';
|
||||
print '<td class="valeur">'.$_GET["attrname"].' </td>';
|
||||
print '<td class="valeur">'.$attrname.' </td>';
|
||||
print '</tr>';
|
||||
// Type
|
||||
$type=$extrafields->attribute_type[$_GET["attrname"]];
|
||||
$size=$extrafields->attribute_size[$_GET["attrname"]];
|
||||
$type=$extrafields->attribute_type[$attrname];
|
||||
$size=$extrafields->attribute_size[$attrname];
|
||||
print '<tr><td class="fieldrequired" required>'.$langs->trans("Type").'</td>';
|
||||
print '<td class="valeur">';
|
||||
print $type2label[$type];
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 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
|
||||
|
|
@ -38,7 +39,8 @@ $tmptype2label=getStaticMember(get_class($extrafields),'type2label');
|
|||
$type2label=array('');
|
||||
foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
|
||||
|
||||
$action=GETPOST("action");
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$attrname=GETPOST('attrname', 'alpha');
|
||||
$elementtype='company';
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
|
@ -161,32 +163,32 @@ if ($action == 'create')
|
|||
/* Edition d'un champ optionnel */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
if ($_GET["attrname"] && $action == 'edit')
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
{
|
||||
print "<br>";
|
||||
print_titre($langs->trans("FieldEdition",$_GET["attrname"]));
|
||||
print_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
/*
|
||||
* formulaire d'edition
|
||||
*/
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?attrname='.$_GET["attrname"].'">';
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?attrname='.$attrname.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="attrname" value="'.$_GET["attrname"].'">';
|
||||
print '<input type="hidden" name="attrname" value="'.$attrname.'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<table summary="listofattributes" class="border" width="100%">';
|
||||
|
||||
// Label
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired" required>'.$langs->trans("Label").'</td><td class="valeur"><input type="text" name="label" size="40" value="'.$extrafields->attribute_label[$_GET["attrname"]].'"></td>';
|
||||
print '<td class="fieldrequired" required>'.$langs->trans("Label").'</td><td class="valeur"><input type="text" name="label" size="40" value="'.$extrafields->attribute_label[$attrname].'"></td>';
|
||||
print '</tr>';
|
||||
// Code
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired" required>'.$langs->trans("AttributeCode").'</td>';
|
||||
print '<td class="valeur">'.$_GET["attrname"].' </td>';
|
||||
print '<td class="valeur">'.$attrname.' </td>';
|
||||
print '</tr>';
|
||||
// Type
|
||||
$type=$extrafields->attribute_type[$_GET["attrname"]];
|
||||
$size=$extrafields->attribute_size[$_GET["attrname"]];
|
||||
$type=$extrafields->attribute_type[$attrname];
|
||||
$size=$extrafields->attribute_size[$attrname];
|
||||
print '<tr><td class="fieldrequired" required>'.$langs->trans("Type").'</td>';
|
||||
print '<td class="valeur">';
|
||||
print $type2label[$type];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user