Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
bba5057d5d
@ -31,9 +31,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
|||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
|
|
||||||
$mode=isset($_GET["mode"])?GETPOST("mode"):(isset($_SESSION['mode'])?$_SESSION['mode']:0);
|
$mode=GETPOST('mode', 'alpha')?GETPOST('mode', 'alpha'):(isset($_SESSION['mode'])?$_SESSION['mode']:0);
|
||||||
$action=GETPOST('action','alpha');
|
$action=GETPOST('action','alpha');
|
||||||
$value=GETPOST('value');
|
$value=GETPOST('value', 'alpha');
|
||||||
|
|
||||||
if (! $user->admin)
|
if (! $user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
@ -28,12 +28,14 @@ require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php';
|
|||||||
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
|
|
||||||
$action=GETPOST("action");
|
$id=GETPOST("id");
|
||||||
$title=GETPOST("title");
|
$action=GETPOST("action","alpha");
|
||||||
$url=GETPOST("url");
|
$title=GETPOST("title","alpha");
|
||||||
$target=GETPOST("target");
|
$url=GETPOST("url","alpha");
|
||||||
$userid=GETPOST("userid");
|
$target=GETPOST("target","alpha");
|
||||||
$position=GETPOST("position");
|
$userid=GETPOST("userid","int");
|
||||||
|
$position=GETPOST("position","int");
|
||||||
|
$backtopage=GETPOST('backtopage','alpha');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -42,10 +44,10 @@ $position=GETPOST("position");
|
|||||||
|
|
||||||
if ($action == 'add' || $action == 'addproduct' || $action == 'update')
|
if ($action == 'add' || $action == 'addproduct' || $action == 'update')
|
||||||
{
|
{
|
||||||
if ($_POST["cancel"])
|
if (GETPOST("cancel"))
|
||||||
{
|
{
|
||||||
$urlsource=(! empty($_REQUEST["urlsource"]))?$_REQUEST["urlsource"]:((! empty($url))?$url:DOL_URL_ROOT.'/bookmarks/liste.php');
|
if (empty($backtopage)) $backtopage=(GETPOST("urlsource")?GETPOST("urlsource"):((! empty($url))?$url:DOL_URL_ROOT.'/bookmarks/liste.php'));
|
||||||
header("Location: ".$urlsource);
|
header("Location: ".$backtopage);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,8 +73,8 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
|
|||||||
|
|
||||||
if ($res > 0)
|
if ($res > 0)
|
||||||
{
|
{
|
||||||
$urlsource=! empty($_REQUEST["urlsource"])?urldecode($_REQUEST["urlsource"]):DOL_URL_ROOT.'/bookmarks/liste.php';
|
if (empty($backtopage)) $backtopage=(GETPOST("urlsource")?GETPOST("urlsource"):DOL_URL_ROOT.'/bookmarks/liste.php');
|
||||||
header("Location: ".$urlsource);
|
header("Location: ".$backtopage);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -96,7 +98,7 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_GET["action"] == 'delete')
|
if ($action == 'delete')
|
||||||
{
|
{
|
||||||
$bookmark=new Bookmark($db);
|
$bookmark=new Bookmark($db);
|
||||||
$bookmark->id=$_GET["bid"];
|
$bookmark->id=$_GET["bid"];
|
||||||
@ -133,7 +135,7 @@ if ($action == 'create')
|
|||||||
* Fact bookmark creation mode
|
* Fact bookmark creation mode
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print '<form action="fiche.php" method="post" enctype="multipart/form-data">'."\n";
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" enctype="multipart/form-data">'."\n";
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
|
|
||||||
@ -176,24 +178,25 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($_GET["id"] > 0 && ! preg_match('/^add/i',$_GET["action"]))
|
if ($id > 0 && ! preg_match('/^add/i',$action))
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Fact bookmark mode or visually edition
|
* Fact bookmark mode or visually edition
|
||||||
*/
|
*/
|
||||||
$bookmark=new Bookmark($db);
|
$bookmark=new Bookmark($db);
|
||||||
$bookmark->fetch($_GET["id"]);
|
$bookmark->fetch($id);
|
||||||
|
|
||||||
|
|
||||||
dol_fiche_head($head, $hselected, $langs->trans("Bookmark"),0,'bookmark');
|
dol_fiche_head($head, $hselected, $langs->trans("Bookmark"),0,'bookmark');
|
||||||
|
|
||||||
if ($_GET["action"] == 'edit')
|
if ($action == 'edit')
|
||||||
{
|
{
|
||||||
print '<form name="edit" method="POST" action="'.$_SERVER["PHP_SELF"].'" enctype="multipart/form-data">';
|
print '<form name="edit" method="POST" action="'.$_SERVER["PHP_SELF"].'" enctype="multipart/form-data">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
print '<input type="hidden" name="id" value="'.$bookmark->id.'">';
|
print '<input type="hidden" name="id" value="'.$bookmark->id.'">';
|
||||||
print '<input type="hidden" name="urlsource" value="'.DOL_URL_ROOT.'/bookmarks/fiche.php?id='.$bookmark->id.'">';
|
print '<input type="hidden" name="urlsource" value="'.DOL_URL_ROOT.'/bookmarks/fiche.php?id='.$bookmark->id.'">';
|
||||||
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
@ -201,17 +204,17 @@ if ($_GET["id"] > 0 && ! preg_match('/^add/i',$_GET["action"]))
|
|||||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td>'.$bookmark->ref.'</td></tr>';
|
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td>'.$bookmark->ref.'</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("BookmarkTitle").'</td><td>';
|
print '<tr><td>'.$langs->trans("BookmarkTitle").'</td><td>';
|
||||||
if ($_GET["action"] == 'edit') print '<input class="flat" name="title" size="30" value="'.(isset($_POST["title"])?$_POST["title"]:$bookmark->title).'">';
|
if ($action == 'edit') print '<input class="flat" name="title" size="30" value="'.(isset($_POST["title"])?$_POST["title"]:$bookmark->title).'">';
|
||||||
else print $bookmark->title;
|
else print $bookmark->title;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("UrlOrLink").'</td><td>';
|
print '<tr><td>'.$langs->trans("UrlOrLink").'</td><td>';
|
||||||
if ($_GET["action"] == 'edit') print '<input class="flat" name="url" size="80" value="'.(isset($_POST["url"])?$_POST["url"]:$bookmark->url).'">';
|
if ($action == 'edit') print '<input class="flat" name="url" size="80" value="'.(isset($_POST["url"])?$_POST["url"]:$bookmark->url).'">';
|
||||||
else print '<a href="'.(preg_match('/^http/i',$bookmark->url)?$bookmark->url:DOL_URL_ROOT.$bookmark->url).'"'.($bookmark->target?' target="_blank"':'').'>'.$bookmark->url.'</a>';
|
else print '<a href="'.(preg_match('/^http/i',$bookmark->url)?$bookmark->url:DOL_URL_ROOT.$bookmark->url).'"'.($bookmark->target?' target="_blank"':'').'>'.$bookmark->url.'</a>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("BehaviourOnClick").'</td><td>';
|
print '<tr><td>'.$langs->trans("BehaviourOnClick").'</td><td>';
|
||||||
if ($_GET["action"] == 'edit')
|
if ($action == 'edit')
|
||||||
{
|
{
|
||||||
$liste=array(1=>$langs->trans("OpenANewWindow"),0=>$langs->trans("ReplaceWindow"));
|
$liste=array(1=>$langs->trans("OpenANewWindow"),0=>$langs->trans("ReplaceWindow"));
|
||||||
print $form->selectarray('target',$liste,isset($_POST["target"])?$_POST["target"]:$bookmark->target);
|
print $form->selectarray('target',$liste,isset($_POST["target"])?$_POST["target"]:$bookmark->target);
|
||||||
@ -224,7 +227,7 @@ if ($_GET["id"] > 0 && ! preg_match('/^add/i',$_GET["action"]))
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("Owner").'</td><td>';
|
print '<tr><td>'.$langs->trans("Owner").'</td><td>';
|
||||||
if ($_GET["action"] == 'edit' && $user->admin)
|
if ($action == 'edit' && $user->admin)
|
||||||
{
|
{
|
||||||
$form->select_users(isset($_POST['userid'])?$_POST['userid']:($bookmark->fk_user?$bookmark->fk_user:''),'userid',1);
|
$form->select_users(isset($_POST['userid'])?$_POST['userid']:($bookmark->fk_user?$bookmark->fk_user:''),'userid',1);
|
||||||
}
|
}
|
||||||
@ -245,7 +248,7 @@ if ($_GET["id"] > 0 && ! preg_match('/^add/i',$_GET["action"]))
|
|||||||
|
|
||||||
// Position
|
// Position
|
||||||
print '<tr><td>'.$langs->trans("Position").'</td><td>';
|
print '<tr><td>'.$langs->trans("Position").'</td><td>';
|
||||||
if ($_GET["action"] == 'edit') print '<input class="flat" name="position" size="5" value="'.(isset($_POST["position"])?$_POST["position"]:$bookmark->position).'">';
|
if ($action == 'edit') print '<input class="flat" name="position" size="5" value="'.(isset($_POST["position"])?$_POST["position"]:$bookmark->position).'">';
|
||||||
else print $bookmark->position;
|
else print $bookmark->position;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -254,9 +257,9 @@ if ($_GET["id"] > 0 && ! preg_match('/^add/i',$_GET["action"]))
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
if ($_GET["action"] == 'edit') print '<br><div align="center"><input class="button" type="submit" name="save" value="'.$langs->trans("Save").'"> <input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
|
if ($action == 'edit') print '<br><div align="center"><input class="button" type="submit" name="save" value="'.$langs->trans("Save").'"> <input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
|
||||||
|
|
||||||
if ($_GET["action"] == 'edit') print '</form>';
|
if ($action == 'edit') print '</form>';
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
@ -264,13 +267,13 @@ if ($_GET["id"] > 0 && ! preg_match('/^add/i',$_GET["action"]))
|
|||||||
print "<div class=\"tabsAction\">\n";
|
print "<div class=\"tabsAction\">\n";
|
||||||
|
|
||||||
// Edit
|
// Edit
|
||||||
if ($user->rights->bookmark->creer && $_GET["action"] != 'edit')
|
if ($user->rights->bookmark->creer && $action != 'edit')
|
||||||
{
|
{
|
||||||
print " <a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?id=".$bookmark->id."&action=edit\">".$langs->trans("Edit")."</a>\n";
|
print " <a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?id=".$bookmark->id."&action=edit\">".$langs->trans("Edit")."</a>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove
|
// Remove
|
||||||
if ($user->rights->bookmark->supprimer && $_GET["action"] != 'edit')
|
if ($user->rights->bookmark->supprimer && $action != 'edit')
|
||||||
{
|
{
|
||||||
print " <a class=\"butActionDelete\" href=\"liste.php?bid=".$bookmark->id."&action=delete\">".$langs->trans("Delete")."</a>\n";
|
print " <a class=\"butActionDelete\" href=\"liste.php?bid=".$bookmark->id."&action=delete\">".$langs->trans("Delete")."</a>\n";
|
||||||
}
|
}
|
||||||
@ -279,8 +282,8 @@ if ($_GET["id"] > 0 && ! preg_match('/^add/i',$_GET["action"]))
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->close();
|
|
||||||
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
|
$db->close();
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -170,7 +170,11 @@ if ($resql)
|
|||||||
print '<td align="right">'.$obj->position."</td>";
|
print '<td align="right">'.$obj->position."</td>";
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
print '<td align="right">';
|
print '<td align="right" nowrap="nowrap">';
|
||||||
|
if ($user->rights->bookmark->creer)
|
||||||
|
{
|
||||||
|
print "<a href=\"".DOL_URL_ROOT."/bookmarks/fiche.php?action=edit&id=".$obj->bid."&backtopage=".urlencode($_SERVER["PHP_SELF"])."\">".img_edit()."</a> ";
|
||||||
|
}
|
||||||
if ($user->rights->bookmark->supprimer)
|
if ($user->rights->bookmark->supprimer)
|
||||||
{
|
{
|
||||||
print "<a href=\"".$_SERVER["PHP_SELF"]."?action=delete&bid=$obj->bid\">".img_delete()."</a>";
|
print "<a href=\"".$_SERVER["PHP_SELF"]."?action=delete&bid=$obj->bid\">".img_delete()."</a>";
|
||||||
|
|||||||
@ -56,10 +56,19 @@ $search_sale = GETPOST("search_sale");
|
|||||||
$search_categ = GETPOST("search_categ",'int');
|
$search_categ = GETPOST("search_categ",'int');
|
||||||
$catid = GETPOST("catid",'int');
|
$catid = GETPOST("catid",'int');
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||||
|
$hookmanager=new HookManager($db);
|
||||||
|
$hookmanager->initHooks(array('customerlist'));
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
// Do we click on purge search criteria ?
|
// Do we click on purge search criteria ?
|
||||||
if (GETPOST("button_removefilter_x"))
|
if (GETPOST("button_removefilter_x"))
|
||||||
{
|
{
|
||||||
@ -140,8 +149,7 @@ if ($result)
|
|||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
print '<form method="GET" id="formList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||||
print '<table class="liste" width="100%">'."\n";
|
|
||||||
|
|
||||||
// Filter on categories
|
// Filter on categories
|
||||||
$moreforfilter='';
|
$moreforfilter='';
|
||||||
@ -159,12 +167,13 @@ if ($result)
|
|||||||
}
|
}
|
||||||
if ($moreforfilter)
|
if ($moreforfilter)
|
||||||
{
|
{
|
||||||
print '<tr class="liste_titre">';
|
print '<div class="liste_titre">';
|
||||||
print '<td class="liste_titre" colspan="6">';
|
|
||||||
print $moreforfilter;
|
print $moreforfilter;
|
||||||
print '</td></tr>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '<table class="liste" width="100%">'."\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.ville","",$param,"",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.ville","",$param,"",$sortfield,$sortorder);
|
||||||
@ -172,7 +181,11 @@ if ($result)
|
|||||||
print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta","",$param,'align="left"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta","",$param,'align="left"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"datec","",$param,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"datec","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
print "</tr>\n";
|
|
||||||
|
$parameters=array();
|
||||||
|
$formconfirm=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
|
|
||||||
@ -199,6 +212,9 @@ if ($result)
|
|||||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
$parameters=array();
|
||||||
|
$formconfirm=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$var=True;
|
$var=True;
|
||||||
@ -224,6 +240,10 @@ if ($result)
|
|||||||
print '<td align="right">'.dol_print_date($db->jdate($obj->datec),'day').'</td>';
|
print '<td align="right">'.dol_print_date($db->jdate($obj->datec),'day').'</td>';
|
||||||
print '<td align="right">'.$thirdpartystatic->getLibStatut(3);
|
print '<td align="right">'.$thirdpartystatic->getLibStatut(3);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
$parameters=array('obj' => $obj);
|
||||||
|
$formconfirm=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -231,13 +251,15 @@ if ($result)
|
|||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
print "</form>\n";
|
print "</form>\n";
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
|
|
||||||
|
$parameters=array('sql' => $sql);
|
||||||
|
$formconfirm=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->close();
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
$db->close();
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -249,7 +249,7 @@ class Translate
|
|||||||
$tab=explode('=',$line,2);
|
$tab=explode('=',$line,2);
|
||||||
$key=trim($tab[0]);
|
$key=trim($tab[0]);
|
||||||
//print "Domain=$domain, found a string for $tab[0] with value $tab[1]<br>";
|
//print "Domain=$domain, found a string for $tab[0] with value $tab[1]<br>";
|
||||||
if ((! empty($conf->global->MAIN_USE_CUSTOM_TRANSLATION) || empty($this->tab_translate[$key])) && isset($tab[1])) // If data was already found, we must not enter here, even if MAIN_FORCELANGDIR is set (MAIN_FORCELANGDIR is to replace lang dir, not to overwrite)
|
if ((! empty($conf->global->MAIN_USE_CUSTOM_TRANSLATION) || empty($this->tab_translate[$key])) && isset($tab[1])) // If translation was already found, we must not continue, even if MAIN_FORCELANGDIR is set (MAIN_FORCELANGDIR is to replace lang dir, not to overwrite entries)
|
||||||
{
|
{
|
||||||
$value=trim(preg_replace('/\\n/',"\n",$tab[1]));
|
$value=trim(preg_replace('/\\n/',"\n",$tab[1]));
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||||
|
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -362,6 +363,26 @@ class modSociete extends DolibarrModules
|
|||||||
//$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t');
|
//$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t');
|
||||||
$this->import_regex_array[$r]=array('s.birthday'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
|
$this->import_regex_array[$r]=array('s.birthday'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
|
||||||
$this->import_examplevalues_array[$r]=array('s.fk_soc'=>'MyBigCompany','s.civilite'=>"MR",'s.name'=>"Smith",'s.firstname'=>'John','s.address'=>'61 jump street','s.cp'=>'75000','s.ville'=>'Bigtown','s.fk_pays'=>'US, FR, DE...','s.datec'=>'1972-10-10','s.poste'=>"Director",'s.phone'=>"5551122",'s.phone_perso'=>"5551133",'s.phone_mobile'=>"5551144",'s.fax'=>"5551155",'s.email'=>"johnsmith@email.com",'s.note'=>"My comments");
|
$this->import_examplevalues_array[$r]=array('s.fk_soc'=>'MyBigCompany','s.civilite'=>"MR",'s.name'=>"Smith",'s.firstname'=>'John','s.address'=>'61 jump street','s.cp'=>'75000','s.ville'=>'Bigtown','s.fk_pays'=>'US, FR, DE...','s.datec'=>'1972-10-10','s.poste'=>"Director",'s.phone'=>"5551122",'s.phone_perso'=>"5551133",'s.phone_mobile'=>"5551144",'s.fax'=>"5551155",'s.email'=>"johnsmith@email.com",'s.note'=>"My comments");
|
||||||
|
|
||||||
|
// Import Bank Accounts
|
||||||
|
$r++;
|
||||||
|
$this->import_code[$r]=$this->rights_class.'_'.$r;
|
||||||
|
$this->import_label[$r]="ImportDataset_company_3"; // Translation key
|
||||||
|
$this->import_icon[$r]='account';
|
||||||
|
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
|
||||||
|
$this->import_tables_array[$r]=array('sr'=>MAIN_DB_PREFIX.'societe_rib');
|
||||||
|
$this->import_fields_array[$r]=array('sr.fk_soc'=>"ThirdPartyName*",'sr.bank'=>"Bank",
|
||||||
|
'sr.code_banque'=>"BankCode*",'sr.code_guichet'=>"DeskCode*",'sr.number'=>"BankAccountNumber*",
|
||||||
|
'sr.cle_rib'=>"BankAccountNumberKey*",'sr.bic'=>"BIC",'sr.iban_prefix'=>"IBAN"
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->import_convertvalue_array[$r]=array(
|
||||||
|
'sr.fk_soc'=>array('rule'=>'fetchidfromref','classfile'=>'/societe/class/societe.class.php','class'=>'Societe','method'=>'fetch','element'=>'ThirdParty')
|
||||||
|
);
|
||||||
|
$this->import_examplevalues_array[$r]=array('sr.fk_soc'=>"MyBigCompany",'sr.bank'=>"ING",
|
||||||
|
'sr.code_banque'=>"0000", 'sr.code_guichet'=>"1111",'sr.number'=>"3333333333",
|
||||||
|
'sr.cle_rib'=>"22",'sr.bic'=>"USHINGMMXXX",'sr.iban_prefix'=>"US00 0000 1111 22 3333 3333"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -34,11 +34,11 @@ if (empty($conf->global->EXTERNALSITE_URL))
|
|||||||
llxFooter();
|
llxFooter();
|
||||||
}
|
}
|
||||||
|
|
||||||
$mainmenu=GETPOST('mainmenu');
|
$mainmenu=GETPOST('mainmenu', 'alpha');
|
||||||
$leftmenu=GETPOST('leftmenu');
|
$leftmenu=GETPOST('leftmenu', 'alpha');
|
||||||
$idmenu=GETPOST('idmenu');
|
$idmenu=GETPOST('idmenu', 'int');
|
||||||
$theme=GETPOST('theme');
|
$theme=GETPOST('theme', 'alpha');
|
||||||
$codelang=GETPOST('lang');
|
$codelang=GETPOST('lang', 'alpha');
|
||||||
|
|
||||||
print "
|
print "
|
||||||
<html>
|
<html>
|
||||||
|
|||||||
@ -188,7 +188,11 @@ elseif ($action == 'setdate_lim_reglement' && $user->rights->fournisseur->factur
|
|||||||
{
|
{
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$object->date_echeance=dol_mktime(12,0,0,$_POST['date_lim_reglementmonth'],$_POST['date_lim_reglementday'],$_POST['date_lim_reglementyear']);
|
$object->date_echeance=dol_mktime(12,0,0,$_POST['date_lim_reglementmonth'],$_POST['date_lim_reglementday'],$_POST['date_lim_reglementyear']);
|
||||||
if ($object->date_echeance < $object->date) $object->date_echeance=$object->date;
|
if ($object->date_echeance < $object->date)
|
||||||
|
{
|
||||||
|
$object->date_echeance=$object->date;
|
||||||
|
setEventMessage($langs->trans("DatePaymentTermCantBeLowerThanObjectDate"),'warnings');
|
||||||
|
}
|
||||||
$result=$object->update($user);
|
$result=$object->update($user);
|
||||||
if ($result < 0) dol_print_error($db,$object->error);
|
if ($result < 0) dol_print_error($db,$object->error);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
|||||||
|
|
||||||
|
|
||||||
// If not defined, we select menu "home"
|
// If not defined, we select menu "home"
|
||||||
if (! isset($_GET["mainmenu"])) $_GET["mainmenu"]="home";
|
$_GET['mainmenu']=GETPOST('mainmenu', 'alpha')?GETPOST('mainmenu', 'alpha'):'home';
|
||||||
$action=GETPOST('action');
|
$action=GETPOST('action');
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -765,6 +765,7 @@ ALTER TABLE llx_commande_fournisseurdet ADD COLUMN import_key varchar(14) AFTER
|
|||||||
ALTER TABLE llx_entrepot ADD COLUMN import_key varchar(14) AFTER fk_user_author;
|
ALTER TABLE llx_entrepot ADD COLUMN import_key varchar(14) AFTER fk_user_author;
|
||||||
ALTER TABLE llx_product_fournisseur_price ADD COLUMN import_key varchar(14) AFTER fk_user;
|
ALTER TABLE llx_product_fournisseur_price ADD COLUMN import_key varchar(14) AFTER fk_user;
|
||||||
ALTER TABLE llx_product_stock ADD COLUMN import_key varchar(14) AFTER pmp;
|
ALTER TABLE llx_product_stock ADD COLUMN import_key varchar(14) AFTER pmp;
|
||||||
|
ALTER TABLE llx_societe_rib ADD COLUMN import_key varchar(14) AFTER adresse_proprio;
|
||||||
|
|
||||||
-- [ task #146 ] Remove table llx_categorie_association
|
-- [ task #146 ] Remove table llx_categorie_association
|
||||||
ALTER TABLE llx_categorie_association DROP FOREIGN KEY fk_categorie_asso_fk_categorie_mere;
|
ALTER TABLE llx_categorie_association DROP FOREIGN KEY fk_categorie_asso_fk_categorie_mere;
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
-- =============================================================================
|
-- =============================================================================
|
||||||
-- Copyright (C) 2000-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
-- Copyright (C) 2000-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
-- Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
-- Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||||
|
-- Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
--
|
--
|
||||||
-- This program is free software; you can redistribute it and/or modify
|
-- 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
|
-- it under the terms of the GNU General Public License as published by
|
||||||
@ -33,7 +34,8 @@ create table llx_societe_rib
|
|||||||
iban_prefix varchar(34), -- 34 according to ISO 13616
|
iban_prefix varchar(34), -- 34 according to ISO 13616
|
||||||
domiciliation varchar(255),
|
domiciliation varchar(255),
|
||||||
proprio varchar(60),
|
proprio varchar(60),
|
||||||
adresse_proprio varchar(255)
|
adresse_proprio varchar(255),
|
||||||
|
import_key varchar(14) -- import key
|
||||||
|
|
||||||
|
|
||||||
)ENGINE=innodb;
|
)ENGINE=innodb;
|
||||||
|
|||||||
@ -342,6 +342,7 @@ ExportDataset_company_1=Tercers (empreses/institucions) i atributs
|
|||||||
ExportDataset_company_2=Contactes de tercers i atributs
|
ExportDataset_company_2=Contactes de tercers i atributs
|
||||||
ImportDataset_company_1=Tercers (empreses/institucions) i atributs
|
ImportDataset_company_1=Tercers (empreses/institucions) i atributs
|
||||||
ImportDataset_company_2=Contactes (tercers o lliures) i atributs
|
ImportDataset_company_2=Contactes (tercers o lliures) i atributs
|
||||||
|
ImportDataset_company_3=Comptes bancaris
|
||||||
PriceLevel=Nivell de preus
|
PriceLevel=Nivell de preus
|
||||||
DeliveriesAddress=Adreça(es) d'enviament
|
DeliveriesAddress=Adreça(es) d'enviament
|
||||||
DeliveryAddress=Adreça d'enviament
|
DeliveryAddress=Adreça d'enviament
|
||||||
|
|||||||
@ -120,3 +120,7 @@ CsvOptions=Opcions de l'arxiu CSV
|
|||||||
Separator=Separador
|
Separator=Separador
|
||||||
Enclosure=Delimitador de camps
|
Enclosure=Delimitador de camps
|
||||||
SuppliersProducts=Productes de proveïdors
|
SuppliersProducts=Productes de proveïdors
|
||||||
|
BankCode=Codi banc
|
||||||
|
DeskCode=Codi oficina
|
||||||
|
BankAccountNumber=Número compte
|
||||||
|
BankAccountNumberKey=Dígit Control
|
||||||
@ -359,6 +359,7 @@ ExportDataset_company_1=Third parties (Companies/foundations) and properties
|
|||||||
ExportDataset_company_2=Contacts and properties
|
ExportDataset_company_2=Contacts and properties
|
||||||
ImportDataset_company_1=Third parties (Companies/foundations) and properties
|
ImportDataset_company_1=Third parties (Companies/foundations) and properties
|
||||||
ImportDataset_company_2=Contacts (of thirdparties or not) and attributes
|
ImportDataset_company_2=Contacts (of thirdparties or not) and attributes
|
||||||
|
ImportDataset_company_3=Bank details
|
||||||
PriceLevel=Price level
|
PriceLevel=Price level
|
||||||
DeliveriesAddress=Delivery addresses
|
DeliveriesAddress=Delivery addresses
|
||||||
DeliveryAddress=Delivery address
|
DeliveryAddress=Delivery address
|
||||||
|
|||||||
@ -120,3 +120,7 @@ CsvOptions=Csv Options
|
|||||||
Separator=Separator
|
Separator=Separator
|
||||||
Enclosure=Enclosure
|
Enclosure=Enclosure
|
||||||
SuppliersProducts=Suppliers Products
|
SuppliersProducts=Suppliers Products
|
||||||
|
BankCode=Bank code
|
||||||
|
DeskCode=Desk code
|
||||||
|
BankAccountNumber=Account number
|
||||||
|
BankAccountNumberKey=Key
|
||||||
@ -343,6 +343,7 @@ ExportDataset_company_1=Terceros (empresas/instituciones) y atributos
|
|||||||
ExportDataset_company_2=Contactos de terceros y atributos
|
ExportDataset_company_2=Contactos de terceros y atributos
|
||||||
ImportDataset_company_1=Terceros (empresas/instituciones) y atributos
|
ImportDataset_company_1=Terceros (empresas/instituciones) y atributos
|
||||||
ImportDataset_company_2=Contactos (terceros o libres) y atributos
|
ImportDataset_company_2=Contactos (terceros o libres) y atributos
|
||||||
|
ImportDataset_company_3=Cuentas bancarias
|
||||||
PriceLevel=Nivel de precios
|
PriceLevel=Nivel de precios
|
||||||
DeliveriesAddress=Dirección(es) de envío
|
DeliveriesAddress=Dirección(es) de envío
|
||||||
DeliveryAddress=Dirección de envío
|
DeliveryAddress=Dirección de envío
|
||||||
|
|||||||
@ -120,3 +120,7 @@ CsvOptions=Opciones del archivo CSV
|
|||||||
Separator=Separador
|
Separator=Separador
|
||||||
Enclosure=Delimitador de campos
|
Enclosure=Delimitador de campos
|
||||||
SuppliersProducts=Productos de proveedores
|
SuppliersProducts=Productos de proveedores
|
||||||
|
BankCode=Código banco
|
||||||
|
DeskCode=Código oficina
|
||||||
|
BankAccountNumber=Número cuenta
|
||||||
|
BankAccountNumberKey=Dígito Control
|
||||||
@ -360,6 +360,7 @@ ExportDataset_company_1=Tiers (sociétés/institutions) et attributs
|
|||||||
ExportDataset_company_2=Contacts (de tiers) et attributs
|
ExportDataset_company_2=Contacts (de tiers) et attributs
|
||||||
ImportDataset_company_1=Tiers (sociétés/institutions) et attributs
|
ImportDataset_company_1=Tiers (sociétés/institutions) et attributs
|
||||||
ImportDataset_company_2=Contacts (de tiers ou libre) et attributs
|
ImportDataset_company_2=Contacts (de tiers ou libre) et attributs
|
||||||
|
ImportDataset_company_3=Coordonnées bancaires
|
||||||
PriceLevel=Niveau de prix
|
PriceLevel=Niveau de prix
|
||||||
DeliveriesAddress=Adresse(s) de livraison
|
DeliveriesAddress=Adresse(s) de livraison
|
||||||
DeliveryAddress=Adresse de livraison
|
DeliveryAddress=Adresse de livraison
|
||||||
|
|||||||
@ -120,3 +120,7 @@ CsvOptions=Options du fichier Csv
|
|||||||
Separator=Séparateur de champs
|
Separator=Séparateur de champs
|
||||||
Enclosure=Encadrement des chaines de textes
|
Enclosure=Encadrement des chaines de textes
|
||||||
SuppliersProducts=Produits Fournisseurs
|
SuppliersProducts=Produits Fournisseurs
|
||||||
|
BankCode=Code banque
|
||||||
|
DeskCode=Code guichet
|
||||||
|
BankAccountNumber=Numéro compte
|
||||||
|
BankAccountNumberKey=Clé RIB
|
||||||
@ -279,37 +279,3 @@ PDFOursinDescription=Factuurmodel oursin
|
|||||||
|
|
||||||
# tourteau PDF Model
|
# tourteau PDF Model
|
||||||
PDFTourteauDescription=Factuurmodel Tourteau
|
PDFTourteauDescription=Factuurmodel Tourteau
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# NumRef Modules
|
|
||||||
|
|
||||||
# deneb
|
|
||||||
DenebNumRefModelDesc1=Geeft het nummer in de vorm, PREF-31-12-2004-01, waar pref het voorvoegsel is , gevolgd door de datum (31 december 2004) en een teller.
|
|
||||||
DenebNumRefModelDesc2=Indien de constante FACTURE_DENEB_DELTA is gedefiniëerd, een compensatie wordt toegepast op de meter
|
|
||||||
|
|
||||||
# mars
|
|
||||||
MarsNumRefModelDesc1=Numéro de facture sous la forme, PREF-10-2004-005, qui correspond à la 5ème facture d'octobre 2004 et où PREF est le préfix de la société.
|
|
||||||
MarsNumRefModelDesc2=Le nombre final est formaté sur 3 chiffres ou plus.
|
|
||||||
MarsNumRefModelDesc3=Si la constante FACTURE_MARS_DELTA est définie, un offset est appliqué sur le compteur
|
|
||||||
|
|
||||||
# neptune
|
|
||||||
NeptuneNumRefModelDesc1=Renvoie le numéro de facture sous une forme du préfix FA suivi de l'année sur 2 chiffres et d'un compteur simple sur 4 chiffres.
|
|
||||||
NeptuneNumRefModelDesc2=Si la constante FACTURE_NEPTUNE_DELTA est définie, un offset est appliqué sur le compteur
|
|
||||||
|
|
||||||
# orion
|
|
||||||
OrionNumRefModelDesc1=Return the number under the format FAYYNNNNN where YY is the year and NNNNN the increment number starting at 1.
|
|
||||||
OrionNumRefModelDesc2=The year is increased by 1 WITHOUT an initialisation to zero at the start of the fiscal year.
|
|
||||||
OrionNumRefModelDesc3=Define the variable SOCIETE_FISCAL_MONTH_START with the month at the start of the fiscal year, example: 9 for September.
|
|
||||||
OrionNumRefModelDesc4=In this example, we shall have on the 1st of September 2006 an invoice named FA700354.
|
|
||||||
|
|
||||||
# terre
|
|
||||||
TerreNumRefModelDesc1=Renvoie le numéro sous la forme %syymm-nnnn où yy est l'année, mm le mois et nnnn un compteur séquentiel sans rupture et sans remise à 0
|
|
||||||
TerreNumRefModelError=Une facture commençant par $fayymm existe en base et est incompatible avec cette numérotation. Supprimer la ou renommer la pour activer ce module.
|
|
||||||
|
|
||||||
# titan
|
|
||||||
TitanNumRefModelDesc1=Return the number with format FAYYNNNNN where YY is the year and NNNNN is the increment number starting from 1.
|
|
||||||
TitanNumRefModelDesc2=The year is incremented by 1 and the increment number is initialized to zero at the start of the fiscal year.
|
|
||||||
TitanNumRefModelDesc3=Define the variable SOCIETE_FISCAL_MONTH_START with the month at the start of the fiscal year, example: 9 for September.
|
|
||||||
TitanNumRefModelDesc4=In this example, we shall have on the 1st September 2006 an invoice named FA0700001
|
|
||||||
|
|||||||
@ -303,7 +303,7 @@ class User extends CommonObject
|
|||||||
// les caracteristiques (module, perms et subperms) de ce droit.
|
// les caracteristiques (module, perms et subperms) de ce droit.
|
||||||
$sql = "SELECT module, perms, subperms";
|
$sql = "SELECT module, perms, subperms";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."rights_def";
|
$sql.= " FROM ".MAIN_DB_PREFIX."rights_def";
|
||||||
$sql.= " WHERE id = '".$rid."'";
|
$sql.= " WHERE id = '".$this->db->escape($rid)."'";
|
||||||
$sql.= " AND entity = ".$entity;
|
$sql.= " AND entity = ".$entity;
|
||||||
|
|
||||||
$result=$this->db->query($sql);
|
$result=$this->db->query($sql);
|
||||||
@ -319,21 +319,21 @@ class User extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Where pour la liste des droits a ajouter
|
// Where pour la liste des droits a ajouter
|
||||||
$whereforadd="id=".$rid;
|
$whereforadd="id=".$this->db->escape($rid);
|
||||||
// Ajout des droits induits
|
// Ajout des droits induits
|
||||||
if ($subperms) $whereforadd.=" OR (module='$module' AND perms='$perms' AND (subperms='lire' OR subperms='read'))";
|
if (! empty($subperms)) $whereforadd.=" OR (module='$module' AND perms='$perms' AND (subperms='lire' OR subperms='read'))";
|
||||||
else if ($perms) $whereforadd.=" OR (module='$module' AND (perms='lire' OR perms='read') AND subperms IS NULL)";
|
else if (! empty($perms)) $whereforadd.=" OR (module='$module' AND (perms='lire' OR perms='read') AND subperms IS NULL)";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// On a pas demande un droit en particulier mais une liste de droits
|
// On a pas demande un droit en particulier mais une liste de droits
|
||||||
// sur la base d'un nom de module de de perms
|
// sur la base d'un nom de module de de perms
|
||||||
// Where pour la liste des droits a ajouter
|
// Where pour la liste des droits a ajouter
|
||||||
if ($allmodule) $whereforadd="module='$allmodule'";
|
if (! empty($allmodule)) $whereforadd="module='".$this->db->escape($allmodule)."'";
|
||||||
if ($allperms) $whereforadd=" AND perms='$allperms'";
|
if (! empty($allperms)) $whereforadd=" AND perms='".$this->db->escape($allperms)."'";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ajout des droits trouves grace au critere whereforadd
|
// Ajout des droits trouves grace au critere whereforadd
|
||||||
if ($whereforadd)
|
if (! empty($whereforadd))
|
||||||
{
|
{
|
||||||
//print "$module-$perms-$subperms";
|
//print "$module-$perms-$subperms";
|
||||||
$sql = "SELECT id";
|
$sql = "SELECT id";
|
||||||
@ -403,7 +403,7 @@ class User extends CommonObject
|
|||||||
// les caracteristiques module, perms et subperms de ce droit.
|
// les caracteristiques module, perms et subperms de ce droit.
|
||||||
$sql = "SELECT module, perms, subperms";
|
$sql = "SELECT module, perms, subperms";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."rights_def";
|
$sql.= " FROM ".MAIN_DB_PREFIX."rights_def";
|
||||||
$sql.= " WHERE id = '".$rid."'";
|
$sql.= " WHERE id = '".$this->db->escape($rid)."'";
|
||||||
$sql.= " AND entity = ".$entity;
|
$sql.= " AND entity = ".$entity;
|
||||||
|
|
||||||
$result=$this->db->query($sql);
|
$result=$this->db->query($sql);
|
||||||
@ -419,7 +419,7 @@ class User extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Where pour la liste des droits a supprimer
|
// Where pour la liste des droits a supprimer
|
||||||
$wherefordel="id=".$rid;
|
$wherefordel="id=".$this->db->escape($rid);
|
||||||
// Suppression des droits induits
|
// Suppression des droits induits
|
||||||
if ($subperms=='lire' || $subperms=='read') $wherefordel.=" OR (module='$module' AND perms='$perms' AND subperms IS NOT NULL)";
|
if ($subperms=='lire' || $subperms=='read') $wherefordel.=" OR (module='$module' AND perms='$perms' AND subperms IS NOT NULL)";
|
||||||
if ($perms=='lire' || $perms=='read') $wherefordel.=" OR (module='$module')";
|
if ($perms=='lire' || $perms=='read') $wherefordel.=" OR (module='$module')";
|
||||||
@ -427,12 +427,12 @@ class User extends CommonObject
|
|||||||
else {
|
else {
|
||||||
// On a demande suppression d'un droit sur la base d'un nom de module ou perms
|
// On a demande suppression d'un droit sur la base d'un nom de module ou perms
|
||||||
// Where pour la liste des droits a supprimer
|
// Where pour la liste des droits a supprimer
|
||||||
if ($allmodule) $wherefordel="module='$allmodule'";
|
if (! empty($allmodule)) $wherefordel="module='".$this->db->escape($allmodule)."'";
|
||||||
if ($allperms) $wherefordel=" AND perms='$allperms'";
|
if (! empty($allperms)) $wherefordel=" AND perms='".$this->db->escape($allperms)."'";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Suppression des droits selon critere defini dans wherefordel
|
// Suppression des droits selon critere defini dans wherefordel
|
||||||
if ($wherefordel)
|
if (! empty($wherefordel))
|
||||||
{
|
{
|
||||||
//print "$module-$perms-$subperms";
|
//print "$module-$perms-$subperms";
|
||||||
$sql = "SELECT id";
|
$sql = "SELECT id";
|
||||||
|
|||||||
@ -239,13 +239,13 @@ class UserGroup extends CommonObject
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
if ($rid)
|
if (! empty($rid))
|
||||||
{
|
{
|
||||||
// Si on a demande ajout d'un droit en particulier, on recupere
|
// Si on a demande ajout d'un droit en particulier, on recupere
|
||||||
// les caracteristiques (module, perms et subperms) de ce droit.
|
// les caracteristiques (module, perms et subperms) de ce droit.
|
||||||
$sql = "SELECT module, perms, subperms";
|
$sql = "SELECT module, perms, subperms";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."rights_def";
|
$sql.= " FROM ".MAIN_DB_PREFIX."rights_def";
|
||||||
$sql.= " WHERE id = '".$rid."'";
|
$sql.= " WHERE id = '".$this->db->escape($rid)."'";
|
||||||
$sql.= " AND entity = ".$conf->entity;
|
$sql.= " AND entity = ".$conf->entity;
|
||||||
|
|
||||||
$result=$this->db->query($sql);
|
$result=$this->db->query($sql);
|
||||||
@ -261,7 +261,7 @@ class UserGroup extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Where pour la liste des droits a ajouter
|
// Where pour la liste des droits a ajouter
|
||||||
$whereforadd="id=".$rid;
|
$whereforadd="id=".$this->db->escape($rid);
|
||||||
// Ajout des droits induits
|
// Ajout des droits induits
|
||||||
if ($subperms) $whereforadd.=" OR (module='$module' AND perms='$perms' AND (subperms='lire' OR subperms='read'))";
|
if ($subperms) $whereforadd.=" OR (module='$module' AND perms='$perms' AND (subperms='lire' OR subperms='read'))";
|
||||||
else if ($perms) $whereforadd.=" OR (module='$module' AND (perms='lire' OR perms='read') AND subperms IS NULL)";
|
else if ($perms) $whereforadd.=" OR (module='$module' AND (perms='lire' OR perms='read') AND subperms IS NULL)";
|
||||||
@ -272,12 +272,12 @@ class UserGroup extends CommonObject
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Where pour la liste des droits a ajouter
|
// Where pour la liste des droits a ajouter
|
||||||
if ($allmodule) $whereforadd="module='$allmodule'";
|
if (! empty($allmodule)) $whereforadd="module='".$this->db->escape($allmodule)."'";
|
||||||
if ($allperms) $whereforadd=" AND perms='$allperms'";
|
if (! empty($allperms)) $whereforadd=" AND perms='".$this->db->escape($allperms)."'";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ajout des droits de la liste whereforadd
|
// Ajout des droits de la liste whereforadd
|
||||||
if ($whereforadd)
|
if (! empty($whereforadd))
|
||||||
{
|
{
|
||||||
//print "$module-$perms-$subperms";
|
//print "$module-$perms-$subperms";
|
||||||
$sql = "SELECT id";
|
$sql = "SELECT id";
|
||||||
@ -339,13 +339,13 @@ class UserGroup extends CommonObject
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
if ($rid)
|
if (! empty($rid))
|
||||||
{
|
{
|
||||||
// Si on a demande supression d'un droit en particulier, on recupere
|
// Si on a demande supression d'un droit en particulier, on recupere
|
||||||
// les caracteristiques module, perms et subperms de ce droit.
|
// les caracteristiques module, perms et subperms de ce droit.
|
||||||
$sql = "SELECT module, perms, subperms";
|
$sql = "SELECT module, perms, subperms";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."rights_def";
|
$sql.= " FROM ".MAIN_DB_PREFIX."rights_def";
|
||||||
$sql.= " WHERE id = '".$rid."'";
|
$sql.= " WHERE id = '".$this->db->escape($rid)."'";
|
||||||
$sql.= " AND entity = ".$conf->entity;
|
$sql.= " AND entity = ".$conf->entity;
|
||||||
|
|
||||||
$result=$this->db->query($sql);
|
$result=$this->db->query($sql);
|
||||||
@ -361,7 +361,7 @@ class UserGroup extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Where pour la liste des droits a supprimer
|
// Where pour la liste des droits a supprimer
|
||||||
$wherefordel="id=".$rid;
|
$wherefordel="id=".$this->db->escape($rid);
|
||||||
// Suppression des droits induits
|
// Suppression des droits induits
|
||||||
if ($subperms=='lire' || $subperms=='read') $wherefordel.=" OR (module='$module' AND perms='$perms' AND subperms IS NOT NULL)";
|
if ($subperms=='lire' || $subperms=='read') $wherefordel.=" OR (module='$module' AND perms='$perms' AND subperms IS NOT NULL)";
|
||||||
if ($perms=='lire' || $perms=='read') $wherefordel.=" OR (module='$module')";
|
if ($perms=='lire' || $perms=='read') $wherefordel.=" OR (module='$module')";
|
||||||
@ -372,12 +372,12 @@ class UserGroup extends CommonObject
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Where pour la liste des droits a supprimer
|
// Where pour la liste des droits a supprimer
|
||||||
if ($allmodule) $wherefordel="module='$allmodule'";
|
if (! empty($allmodule)) $wherefordel="module='".$this->db->escape($allmodule)."'";
|
||||||
if ($allperms) $wherefordel=" AND perms='$allperms'";
|
if (! empty($allperms)) $wherefordel=" AND perms='".$this->db->escape($allperms)."'";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Suppression des droits de la liste wherefordel
|
// Suppression des droits de la liste wherefordel
|
||||||
if ($wherefordel)
|
if (! empty($wherefordel))
|
||||||
{
|
{
|
||||||
//print "$module-$perms-$subperms";
|
//print "$module-$perms-$subperms";
|
||||||
$sql = "SELECT id";
|
$sql = "SELECT id";
|
||||||
|
|||||||
@ -33,9 +33,10 @@ $langs->load("users");
|
|||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
|
|
||||||
$id=GETPOST('id','int');
|
$id=GETPOST('id','int');
|
||||||
$action=GETPOST("action");
|
$action=GETPOST('action', 'alpha');
|
||||||
$confirm=GETPOST("confirm");
|
$confirm=GETPOST('confirm', 'alpha');
|
||||||
$module=GETPOST("module");
|
$module=GETPOST('module', 'alpha');
|
||||||
|
$rights=GETPOST('rights', 'int');
|
||||||
|
|
||||||
// Defini si peux lire les permissions
|
// Defini si peux lire les permissions
|
||||||
$canreadperms=($user->admin || $user->rights->user->user->lire);
|
$canreadperms=($user->admin || $user->rights->user->user->lire);
|
||||||
@ -60,14 +61,14 @@ if ($action == 'addrights' && $caneditperms)
|
|||||||
{
|
{
|
||||||
$editgroup = new Usergroup($db);
|
$editgroup = new Usergroup($db);
|
||||||
$result=$editgroup->fetch($id);
|
$result=$editgroup->fetch($id);
|
||||||
if ($result > 0) $editgroup->addrights($_GET["rights"],$module);
|
if ($result > 0) $editgroup->addrights($rights, $module);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'delrights' && $caneditperms)
|
if ($action == 'delrights' && $caneditperms)
|
||||||
{
|
{
|
||||||
$editgroup = new Usergroup($db);
|
$editgroup = new Usergroup($db);
|
||||||
$result=$editgroup->fetch($id);
|
$result=$editgroup->fetch($id);
|
||||||
if ($result > 0) $editgroup->delrights($_GET["rights"],$module);
|
if ($result > 0) $editgroup->delrights($rights, $module);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -35,8 +35,8 @@ $langs->load("admin");
|
|||||||
$id=GETPOST('id', 'int');
|
$id=GETPOST('id', 'int');
|
||||||
$action=GETPOST('action', 'alpha');
|
$action=GETPOST('action', 'alpha');
|
||||||
$confirm=GETPOST('confirm', 'alpha');
|
$confirm=GETPOST('confirm', 'alpha');
|
||||||
$rights=GETPOST('rights','int');
|
$module=GETPOST('module', 'alpha');
|
||||||
$module=GETPOST('module');
|
$rights=GETPOST('rights', 'int');
|
||||||
$entity=(GETPOST('entity','int')?GETPOST('entity','int'):$conf->entity);
|
$entity=(GETPOST('entity','int')?GETPOST('entity','int'):$conf->entity);
|
||||||
|
|
||||||
if (! isset($id) || empty($id)) accessforbidden();
|
if (! isset($id) || empty($id)) accessforbidden();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user