diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 2c0b3c206ec..6eb64f1eae1 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -40,6 +40,14 @@ $langs->load("bills"); $langs->load("members"); $langs->load("users"); +// If socid provided by ajax company selector +if (! empty($_REQUEST['socid_id'])) +{ + $_GET['socid'] = $_GET['socid_id']; + $_POST['socid'] = $_POST['socid_id']; + $_REQUEST['socid'] = $_REQUEST['socid_id']; +} + // Security check if (! $user->rights->adherent->lire) { diff --git a/htdocs/admin/cashdesk.php b/htdocs/admin/cashdesk.php index 40021595071..b1ecb317d07 100644 --- a/htdocs/admin/cashdesk.php +++ b/htdocs/admin/cashdesk.php @@ -27,6 +27,15 @@ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); require_once(DOL_DOCUMENT_ROOT."/html.formproduct.class.php"); +// If socid provided by ajax company selector +if (! empty($_REQUEST['socid_id'])) +{ + $_GET['socid'] = $_GET['socid_id']; + $_POST['socid'] = $_POST['socid_id']; + $_REQUEST['socid'] = $_REQUEST['socid_id']; +} + +// Security check if (!$user->admin) accessforbidden(); @@ -42,11 +51,11 @@ if ($_POST["action"] == 'set') if ($_POST["CASHDESK_ID_THIRDPARTY"] < 0) $_POST["CASHDESK_ID_THIRDPARTY"]=''; if ($_POST["CASHDESK_ID_WAREHOUSE"] < 0) $_POST["CASHDESK_ID_WAREHOUSE"]=''; if ($_POST["CASHDESK_ID_BANKACCOUNT"] < 0) $_POST["CASHDESK_ID_BANKACCOUNT"]=''; - + dolibarr_set_const($db,"CASHDESK_ID_THIRDPARTY",$_POST["CASHDESK_ID_THIRDPARTY"],'chaine',0,'',$conf->entity); dolibarr_set_const($db,"CASHDESK_ID_BANKACCOUNT",$_POST["CASHDESK_ID_BANKACCOUNT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db,"CASHDESK_ID_WAREHOUSE",$_POST["CASHDESK_ID_WAREHOUSE"],'chaine',0,'',$conf->entity); - + dol_syslog("admin/cashdesk: level ".$_POST["level"]); } diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index 42a5aace8f9..0fbd9b93112 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -17,32 +17,37 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ */ /** \file htdocs/categories/edit.php \ingroup category \brief Page d'edition de categorie produit - \version $Revision$ + \version $Id$ */ require "./pre.inc.php"; +// If socid provided by ajax company selector +if (! empty($_REQUEST['socid_id'])) +{ + $_GET['socid'] = $_GET['socid_id']; + $_POST['socid'] = $_POST['socid_id']; + $_REQUEST['socid'] = $_REQUEST['socid_id']; +} + +// Security check if (!$user->rights->categorie->lire) accessforbidden(); $type=$_REQUEST['type']; -// If socid provided by ajax company selector -if (! empty($_POST['socid_id'])) -{ - $_POST['socid'] = $_POST['socid_id']; - $_REQUEST['socid'] = $_REQUEST['socid_id']; -} -// Action mise à jour d'une catégorie +/* + * Actions + */ + +// Action mise a jour d'une categorie if ($_POST["action"] == 'update' && $user->rights->categorie->creer) { $categorie = new Categorie ($db); diff --git a/htdocs/categories/fiche.php b/htdocs/categories/fiche.php index 6ef76012192..7b5ee2df81b 100644 --- a/htdocs/categories/fiche.php +++ b/htdocs/categories/fiche.php @@ -29,6 +29,15 @@ require "./pre.inc.php"; require_once(DOL_DOCUMENT_ROOT."/categories/categorie.class.php"); +// If socid provided by ajax company selector +if (! empty($_REQUEST['socid_id'])) +{ + $_GET['socid'] = $_GET['socid_id']; + $_POST['socid'] = $_POST['socid_id']; + $_REQUEST['socid'] = $_REQUEST['socid_id']; +} + +// Security check if (!$user->rights->categorie->lire) accessforbidden(); if (isset ($_REQUEST['choix'])) @@ -53,8 +62,9 @@ if ($_REQUEST['catorigin']) } // If socid provided by ajax company selector -if (! empty($_POST['socid_id'])) +if (! empty($_REQUEST['socid_id'])) { + $_GET['socid'] = $_GET['socid_id']; $_POST['socid'] = $_POST['socid_id']; $_REQUEST['socid'] = $_REQUEST['socid_id']; } @@ -117,7 +127,7 @@ if ($_POST["action"] == 'add' && $user->rights->categorie->creer) $categorie->error = $langs->trans("ErrorFieldRequired",$langs->transnoentities("Description")); $_GET["action"] = 'create'; } - + if ($categorie->error =="") { $result = $categorie->create(); @@ -202,7 +212,7 @@ if ($user->rights->categorie->creer) print '