2
0
forked from Wavyzz/dolibarr

Merge branch 'develop' of ssh://git@github.com/Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur
2012-02-13 09:51:41 +01:00
4 changed files with 31 additions and 21 deletions

View File

@@ -1,8 +1,8 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2005-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
@@ -30,13 +30,14 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php");
$langs->load("admin");
$langs->load("workflow");
if (!$user->admin)
accessforbidden();
if (! $user->admin) accessforbidden();
$action = GETPOST('action', 'alpha');
/*
* Actions
*/
if (preg_match('/set(.*)/',$_GET["action"],$reg))
if (preg_match('/set(.*)/',$action,$reg))
{
$code=$reg[1];
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
@@ -50,7 +51,7 @@ if (preg_match('/set(.*)/',$_GET["action"],$reg))
}
}
if (preg_match('/del(.*)/',$_GET["action"],$reg))
if (preg_match('/del(.*)/',$action,$reg))
{
$code=$reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
@@ -82,8 +83,8 @@ print "<br>";
// Choix du module de gestion des codes clients / fournisseurs
print "<table class=\"noborder\" width=\"100%\">\n";
print "<tr class=\"liste_titre\">\n";
print '<table class="noborder" width="100%">'."\n";
print '<tr class="liste_titre">'."\n";
print ' <td>'.$langs->trans("Description").'</td>';
print ' <td align="center">'.$langs->trans("Status").'</td>';
//print ' <td align="center" width="80">'.$langs->trans("Infos").'</td>';
@@ -104,18 +105,27 @@ if (count($workflowcodes) > 0)
$var = !$var;
print "<tr ".$bc[$var].">\n";
print "<td>".$langs->trans('desc'.$code)."</td>\n";
if (! empty($conf->global->$code))
print '<td align="center">';
if ($conf->use_javascript_ajax)
{
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=del'.$code.'">';
print img_picto($langs->trans("Activated"),'switch_on');
print '</a></td>';
print ajax_constantonoff($code);
}
else
{
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=set'.$code.'">';
print img_picto($langs->trans("Disabled"),'switch_off');
print '</a></td>';
if (! empty($conf->global->$code))
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del'.$code.'">';
print img_picto($langs->trans("Activated"),'switch_on');
print '</a>';
}
else
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set'.$code.'">';
print img_picto($langs->trans("Disabled"),'switch_off');
print '</a>';
}
}
print '</td>';
//print '<td align="center">';
//$s=$modCodeTiers->getToolTip($langs,$soc,-1);
@@ -131,8 +141,8 @@ else
}
print '</table>';
llxFooter();
$db->close();
llxFooter();
?>

View File

@@ -47,7 +47,7 @@ print '<!-- Ajax page called with url '.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY
// Registering the location of boxes
if ((isset($_GET['action']) && ! empty($_GET['action'])) && (isset($_GET['name']) && ! empty($_GET['name'])) )
{
$entity = (GETPOST('entity','int') >= 0 ? GETPOST('entity','int') : $conf->entity);
$entity = GETPOST('entity','int');
$action = GETPOST('action', 'alpha');
$name = GETPOST('name', 'alpha');

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2007-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
@@ -229,7 +229,7 @@ function ajax_constantonoff($code,$input=array(),$entity=false)
{
global $conf, $langs;
$entity = ((! empty($entity) && is_numeric($entity) && $entity > 0) || $entity == 0 ? $entity : $conf->entity);
$entity = ((isset($entity) && is_numeric($entity) && $entity >= 0) ? $entity : $conf->entity);
$out= '<script type="text/javascript">
$(function() {

View File

@@ -669,7 +669,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
print '</td></tr>';
$generated_password='';
if (! $ldap_sid) // ldap_sid ?
if (! $ldap_sid) // ldap_sid is for activedirectory
{
require_once(DOL_DOCUMENT_ROOT."/core/lib/security2.lib.php");
$generated_password=getRandomPassword('');