Qual: Uniformize code. Actions canvas conflicts with actions hook. So now we always hook to intercept actions. Name of hook must also be unique for each tab.
This commit is contained in:
parent
6d407b58d4
commit
2510fa1277
@ -27,7 +27,7 @@
|
|||||||
* \file htdocs/comm/propal.php
|
* \file htdocs/comm/propal.php
|
||||||
* \ingroup propale
|
* \ingroup propale
|
||||||
* \brief Page of commercial proposals card and list
|
* \brief Page of commercial proposals card and list
|
||||||
* \version $Id$
|
* \version $Id: propal.php,v 1.605 2011/06/29 22:29:51 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("../main.inc.php");
|
require("../main.inc.php");
|
||||||
@ -59,6 +59,11 @@ $mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg"));
|
|||||||
$year=GETPOST("year");
|
$year=GETPOST("year");
|
||||||
$month=GETPOST("month");
|
$month=GETPOST("month");
|
||||||
|
|
||||||
|
// Nombre de ligne pour choix de produit/service predefinis
|
||||||
|
$NBLINES=4;
|
||||||
|
|
||||||
|
$object = new Propal($db);
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$module='propale';
|
$module='propale';
|
||||||
if (isset($socid))
|
if (isset($socid))
|
||||||
@ -76,15 +81,10 @@ else if (isset($id) && $id > 0)
|
|||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
$result = restrictedArea($user, $module, $objectid, $dbtable);
|
$result = restrictedArea($user, $module, $objectid, $dbtable);
|
||||||
|
|
||||||
// Nombre de ligne pour choix de produit/service predefinis
|
|
||||||
$NBLINES=4;
|
|
||||||
|
|
||||||
$object = new Propal($db);
|
|
||||||
|
|
||||||
// Instantiate hooks of thirdparty module
|
// Instantiate hooks of thirdparty module
|
||||||
if (is_array($conf->hooks_modules) && !empty($conf->hooks_modules))
|
if (is_array($conf->hooks_modules) && !empty($conf->hooks_modules))
|
||||||
{
|
{
|
||||||
$object->callHooks('objectcard');
|
$object->callHooks('propalcard');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -93,12 +93,17 @@ if (is_array($conf->hooks_modules) && !empty($conf->hooks_modules))
|
|||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
// Hook of thirdparty module
|
// Hook of thirdparty module
|
||||||
if (! empty($object->hooks['objectcard']))
|
if (! empty($object->hooks['propalcard']))
|
||||||
{
|
{
|
||||||
foreach($object->hooks['objectcard'] as $module)
|
foreach($object->hooks['propalcard'] as $module)
|
||||||
{
|
{
|
||||||
$module->doActions($object);
|
$reshook+=$module->doActions($object);
|
||||||
$mesg = $module->error;
|
if (! empty($module->error) || (! empty($module->errors) && sizeof($module->errors) > 0))
|
||||||
|
{
|
||||||
|
$error=$module->error; $errors[]=$module->errors;
|
||||||
|
if ($action=='add') $action='create';
|
||||||
|
if ($action=='update') $action='edit';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1950,6 +1955,6 @@ else
|
|||||||
}
|
}
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date$ - $Revision$');
|
llxFooter('$Date: 2011/06/29 22:29:51 $ - $Revision: 1.605 $');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
* \file htdocs/commande/fiche.php
|
* \file htdocs/commande/fiche.php
|
||||||
* \ingroup commande
|
* \ingroup commande
|
||||||
* \brief Page to show customer order
|
* \brief Page to show customer order
|
||||||
* \version $Id$
|
* \version $Id: fiche.php,v 1.520 2011/06/29 22:29:51 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("../main.inc.php");
|
require("../main.inc.php");
|
||||||
@ -57,19 +57,18 @@ $socid = GETPOST('socid');
|
|||||||
$action = GETPOST('action');
|
$action = GETPOST('action');
|
||||||
$confirm = GETPOST('confirm');
|
$confirm = GETPOST('confirm');
|
||||||
$lineid = GETPOST('lineid');
|
$lineid = GETPOST('lineid');
|
||||||
|
$mesg = GETPOST('mesg');
|
||||||
|
|
||||||
|
$object = new Commande($db);
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
$result=restrictedArea($user,'commande',$id,'');
|
$result=restrictedArea($user,'commande',$id,'');
|
||||||
|
|
||||||
$mesg=isset($_GET['mesg'])?$_GET['mesg']:'';
|
|
||||||
|
|
||||||
$object = new Commande($db);
|
|
||||||
|
|
||||||
// Instantiate hooks of thirdparty module
|
// Instantiate hooks of thirdparty module
|
||||||
if (is_array($conf->hooks_modules) && !empty($conf->hooks_modules))
|
if (is_array($conf->hooks_modules) && !empty($conf->hooks_modules))
|
||||||
{
|
{
|
||||||
$object->callHooks('objectcard');
|
$object->callHooks('ordercard');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -77,13 +76,18 @@ if (is_array($conf->hooks_modules) && !empty($conf->hooks_modules))
|
|||||||
/* Actions */
|
/* Actions */
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
// Hook of thirdparty module
|
// Hook of actions
|
||||||
if (! empty($object->hooks['objectcard']))
|
if (! empty($object->hooks['ordercard']))
|
||||||
{
|
{
|
||||||
foreach($object->hooks['objectcard'] as $module)
|
foreach($object->hooks['ordercard'] as $module)
|
||||||
{
|
{
|
||||||
$module->doActions($object);
|
$reshook+=$module->doActions($object);
|
||||||
$mesg = $module->error;
|
if (! empty($module->error) || (! empty($module->errors) && sizeof($module->errors) > 0))
|
||||||
|
{
|
||||||
|
$error=$module->error; $errors[]=$module->errors;
|
||||||
|
if ($action=='add') $action='create';
|
||||||
|
if ($action=='update') $action='edit';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2097,5 +2101,5 @@ else
|
|||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date$ - $Revision$');
|
llxFooter('$Date: 2011/06/29 22:29:51 $ - $Revision: 1.520 $');
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
* \file htdocs/compta/facture.php
|
* \file htdocs/compta/facture.php
|
||||||
* \ingroup facture
|
* \ingroup facture
|
||||||
* \brief Page to create/see an invoice
|
* \brief Page to create/see an invoice
|
||||||
* \version $Id: facture.php,v 1.839 2011/06/29 15:48:02 grandoc Exp $
|
* \version $Id: facture.php,v 1.840 2011/06/29 22:29:50 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require('../main.inc.php');
|
require('../main.inc.php');
|
||||||
@ -77,7 +77,7 @@ $object=new Facture($db);
|
|||||||
// Instantiate hooks of thirdparty module
|
// Instantiate hooks of thirdparty module
|
||||||
if (is_array($conf->hooks_modules) && !empty($conf->hooks_modules))
|
if (is_array($conf->hooks_modules) && !empty($conf->hooks_modules))
|
||||||
{
|
{
|
||||||
$object->callHooks('objectcard');
|
$object->callHooks('invoicecard');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -86,13 +86,18 @@ if (is_array($conf->hooks_modules) && !empty($conf->hooks_modules))
|
|||||||
/* Actions */
|
/* Actions */
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
// Hook of thirdparty module
|
// Hook of actions
|
||||||
if (! empty($object->hooks['objectcard']))
|
if (! empty($object->hooks['invoicecard']))
|
||||||
{
|
{
|
||||||
foreach($object->hooks['objectcard'] as $module)
|
foreach($object->hooks['invoicecard'] as $module)
|
||||||
{
|
{
|
||||||
$module->doActions($object);
|
$reshook+=$module->doActions($object);
|
||||||
$mesg = $module->error;
|
if (! empty($module->error) || (! empty($module->errors) && sizeof($module->errors) > 0))
|
||||||
|
{
|
||||||
|
$error=$module->error; $errors[]=$module->errors;
|
||||||
|
if ($action=='add') $action='create';
|
||||||
|
if ($action=='update') $action='edit';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3196,5 +3201,5 @@ else
|
|||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date: 2011/06/29 15:48:02 $ - $Revision: 1.839 $');
|
llxFooter('$Date: 2011/06/29 22:29:50 $ - $Revision: 1.840 $');
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
* \file htdocs/contact/fiche.php
|
* \file htdocs/contact/fiche.php
|
||||||
* \ingroup societe
|
* \ingroup societe
|
||||||
* \brief Card of a contact
|
* \brief Card of a contact
|
||||||
* \version $Id$
|
* \version $Id: fiche.php,v 1.214 2011/06/29 22:29:51 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("../main.inc.php");
|
require("../main.inc.php");
|
||||||
@ -45,11 +45,11 @@ $action = GETPOST('action');
|
|||||||
$socid = GETPOST("socid");
|
$socid = GETPOST("socid");
|
||||||
$id = GETPOST("id");
|
$id = GETPOST("id");
|
||||||
|
|
||||||
|
$object = new Contact($db);
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
|
|
||||||
$object = new Contact($db);
|
|
||||||
|
|
||||||
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||||
if (!empty($id)) $object->getCanvas($id);
|
if (!empty($id)) $object->getCanvas($id);
|
||||||
$canvas = (!empty($object->canvas)?$object->canvas:GETPOST("canvas"));
|
$canvas = (!empty($object->canvas)?$object->canvas:GETPOST("canvas"));
|
||||||
@ -68,40 +68,36 @@ else
|
|||||||
$result = restrictedArea($user, 'contact', $id, 'socpeople'); // If we create a contact with no company (shared contacts), no check on write permission
|
$result = restrictedArea($user, 'contact', $id, 'socpeople'); // If we create a contact with no company (shared contacts), no check on write permission
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Instantiate hooks of thirdparty module
|
||||||
|
if (is_array($conf->hooks_modules) && !empty($conf->hooks_modules))
|
||||||
|
{
|
||||||
|
$object->callHooks('contactcard');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// If canvas actions are defined, because on url, or because contact was created with canvas feature on, we use the canvas feature.
|
// Hook of actions
|
||||||
// If canvas actions are not defined, we use standard feature.
|
if (! empty($object->hooks['contactcard']))
|
||||||
if (method_exists($objcanvas->control,'doActions'))
|
|
||||||
{
|
{
|
||||||
// -----------------------------------------
|
foreach($object->hooks['contactcard'] as $module)
|
||||||
// When used with CANVAS
|
|
||||||
// -----------------------------------------
|
|
||||||
$objcanvas->doActions($id);
|
|
||||||
if (empty($objcanvas->error) && (empty($objcanvas->errors) || sizeof($objcanvas->errors) == 0))
|
|
||||||
{
|
{
|
||||||
if ($action=='add') { $objcanvas->action='create'; $action='create'; }
|
$reshook+=$module->doActions($object);
|
||||||
if ($action=='update') { $objcanvas->action='view'; $action='view'; }
|
if (! empty($module->error) || (! empty($module->errors) && sizeof($module->errors) > 0))
|
||||||
|
{
|
||||||
|
$error=$module->error; $errors[]=$module->errors;
|
||||||
|
if ($action=='add') $action='create';
|
||||||
|
if ($action=='update') $action='edit';
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$error=$objcanvas->error; $errors=$objcanvas->errors;
|
|
||||||
if ($action=='add') { $objcanvas->action='create'; $action='create'; }
|
|
||||||
if ($action=='update') { $objcanvas->action='edit'; $action='edit'; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// -----------------------------------------
|
|
||||||
// When used in standard mode
|
|
||||||
// -----------------------------------------
|
|
||||||
|
|
||||||
// Creation utilisateur depuis contact
|
// Creation utilisateur depuis contact
|
||||||
if ($_POST["action"] == 'confirm_create_user' && $_POST["confirm"] == 'yes' && $user->rights->user->user->creer)
|
if ($_POST["action"] == 'confirm_create_user' && $_POST["confirm"] == 'yes' && $user->rights->user->user->creer)
|
||||||
{
|
{
|
||||||
// Recuperation contact actuel
|
// Recuperation contact actuel
|
||||||
$result = $object->fetch($_GET["id"]);
|
$result = $object->fetch($_GET["id"]);
|
||||||
|
|
||||||
@ -136,18 +132,18 @@ else
|
|||||||
{
|
{
|
||||||
$error=$object->error; $errors=$object->errors;
|
$error=$object->error; $errors=$object->errors;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cancel
|
// Cancel
|
||||||
if (GETPOST("cancel") && GETPOST('backtopage'))
|
if (GETPOST("cancel") && GETPOST('backtopage'))
|
||||||
{
|
{
|
||||||
header("Location: ".GETPOST('backtopage'));
|
header("Location: ".GETPOST('backtopage'));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add contact
|
// Add contact
|
||||||
if (GETPOST("action") == 'add' && $user->rights->societe->contact->creer)
|
if (GETPOST("action") == 'add' && $user->rights->societe->contact->creer)
|
||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
if ($canvas) $object->canvas=$canvas;
|
if ($canvas) $object->canvas=$canvas;
|
||||||
@ -203,10 +199,10 @@ else
|
|||||||
{
|
{
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST("action") == 'confirm_delete' && GETPOST("confirm") == 'yes' && $user->rights->societe->contact->supprimer)
|
if (GETPOST("action") == 'confirm_delete' && GETPOST("confirm") == 'yes' && $user->rights->societe->contact->supprimer)
|
||||||
{
|
{
|
||||||
$result=$object->fetch($_GET["id"]);
|
$result=$object->fetch($_GET["id"]);
|
||||||
|
|
||||||
$object->old_name = $_POST["old_name"];
|
$object->old_name = $_POST["old_name"];
|
||||||
@ -222,10 +218,10 @@ else
|
|||||||
{
|
{
|
||||||
$error=$object->error; $errors[]=$object->errors;
|
$error=$object->error; $errors[]=$object->errors;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST["action"] == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact->creer)
|
if ($_POST["action"] == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact->creer)
|
||||||
{
|
{
|
||||||
if (empty($_POST["name"]))
|
if (empty($_POST["name"]))
|
||||||
{
|
{
|
||||||
$error++; $errors=array($langs->trans("ErrorFieldRequired",$langs->transnoentities("Name").' / '.$langs->transnoentities("Label")));
|
$error++; $errors=array($langs->trans("ErrorFieldRequired",$langs->transnoentities("Name").' / '.$langs->transnoentities("Label")));
|
||||||
@ -274,7 +270,6 @@ else
|
|||||||
$error=$object->error; $errors=$object->errors;
|
$error=$object->error; $errors=$object->errors;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -950,5 +945,5 @@ else
|
|||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date$ - $Revision$');
|
llxFooter('$Date: 2011/06/29 22:29:51 $ - $Revision: 1.214 $');
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
* \file htdocs/societe/soc.php
|
* \file htdocs/societe/soc.php
|
||||||
* \ingroup societe
|
* \ingroup societe
|
||||||
* \brief Third party card page
|
* \brief Third party card page
|
||||||
* \version $Id: soc.php,v 1.111 2011/06/25 19:55:36 eldy Exp $
|
* \version $Id: soc.php,v 1.112 2011/06/29 22:29:51 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("../main.inc.php");
|
require("../main.inc.php");
|
||||||
@ -50,11 +50,17 @@ if ($conf->notification->enabled) $langs->load("mails");
|
|||||||
$action = GETPOST('action');
|
$action = GETPOST('action');
|
||||||
$confirm = GETPOST('confirm');
|
$confirm = GETPOST('confirm');
|
||||||
|
|
||||||
|
$error=0; $errors=array();
|
||||||
|
|
||||||
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
|
$soc = new Societe($db); // TODO Replace this wit object
|
||||||
|
$object = new Societe($db);
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid = GETPOST("socid");
|
$socid = GETPOST("socid");
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
|
|
||||||
$soc = new Societe($db);
|
|
||||||
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||||
if (!empty($socid)) $soc->getCanvas($socid);
|
if (!empty($socid)) $soc->getCanvas($socid);
|
||||||
$canvas = (!empty($soc->canvas)?$soc->canvas:GETPOST("canvas"));
|
$canvas = (!empty($soc->canvas)?$soc->canvas:GETPOST("canvas"));
|
||||||
@ -73,58 +79,50 @@ else
|
|||||||
$result = restrictedArea($user, 'societe', $socid);
|
$result = restrictedArea($user, 'societe', $socid);
|
||||||
}
|
}
|
||||||
|
|
||||||
$error=0; $errors=array();
|
// Instantiate hooks of thirdparty module
|
||||||
|
if (is_array($conf->hooks_modules) && !empty($conf->hooks_modules))
|
||||||
|
{
|
||||||
|
$object->callHooks('thirdpartycard');
|
||||||
|
}
|
||||||
|
|
||||||
$extrafields = new ExtraFields($db);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// If canvas actions are defined, because on url, or because contact was created with canvas feature on, we use the canvas feature.
|
// Hook of actions
|
||||||
// If canvas actions are not defined, we use standard feature.
|
if (! empty($object->hooks['thirdpartycard']))
|
||||||
if (method_exists($objcanvas->control,'doActions'))
|
|
||||||
{
|
{
|
||||||
// -----------------------------------------
|
foreach($object->hooks['thirdpartycard'] as $module)
|
||||||
// When used with CANVAS
|
|
||||||
// -----------------------------------------
|
|
||||||
$objcanvas->doActions($socid);
|
|
||||||
|
|
||||||
if (empty($objcanvas->error) && (empty($objcanvas->errors) || sizeof($objcanvas->errors) == 0))
|
|
||||||
{
|
{
|
||||||
if ($action=='add') { $objcanvas->action='create'; $action='create'; }
|
$reshook+=$module->doActions($object);
|
||||||
if ($action=='update') { $objcanvas->action='view'; $action='view'; }
|
if (! empty($module->error) || (! empty($module->errors) && sizeof($module->errors) > 0))
|
||||||
|
{
|
||||||
|
$error=$module->error; $errors[]=$module->errors;
|
||||||
|
if ($action=='add') $action='create';
|
||||||
|
if ($action=='update') $action='edit';
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$error=$objcanvas->error; $errors=$objcanvas->errors;
|
|
||||||
if ($action=='add') { $objcanvas->action='create'; $action='create'; }
|
|
||||||
if ($action=='update') { $objcanvas->action='edit'; $action='edit'; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// -----------------------------------------
|
|
||||||
// When used in standard mode
|
|
||||||
// -----------------------------------------
|
|
||||||
|
|
||||||
if ($_POST["getcustomercode"])
|
|
||||||
{
|
if ($_POST["getcustomercode"])
|
||||||
|
{
|
||||||
// We defined value code_client
|
// We defined value code_client
|
||||||
$_POST["code_client"]="Acompleter";
|
$_POST["code_client"]="Acompleter";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_POST["getsuppliercode"])
|
if ($_POST["getsuppliercode"])
|
||||||
{
|
{
|
||||||
// We defined value code_fournisseur
|
// We defined value code_fournisseur
|
||||||
$_POST["code_fournisseur"]="Acompleter";
|
$_POST["code_fournisseur"]="Acompleter";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add new third party
|
// Add new third party
|
||||||
if ((! $_POST["getcustomercode"] && ! $_POST["getsuppliercode"])
|
if ((! $_POST["getcustomercode"] && ! $_POST["getsuppliercode"])
|
||||||
&& ($action == 'add' || $action == 'update') && $user->rights->societe->creer)
|
&& ($action == 'add' || $action == 'update') && $user->rights->societe->creer)
|
||||||
{
|
{
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
|
||||||
|
|
||||||
if ($action == 'update')
|
if ($action == 'update')
|
||||||
@ -403,11 +401,11 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete third party
|
// Delete third party
|
||||||
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->societe->supprimer)
|
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->societe->supprimer)
|
||||||
{
|
{
|
||||||
$soc->fetch($socid);
|
$soc->fetch($socid);
|
||||||
$result = $soc->delete($socid);
|
$result = $soc->delete($socid);
|
||||||
|
|
||||||
@ -422,14 +420,14 @@ else
|
|||||||
$error=$langs->trans($soc->error); $errors = $soc->errors;
|
$error=$langs->trans($soc->error); $errors = $soc->errors;
|
||||||
$action='';
|
$action='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Generate document
|
* Generate document
|
||||||
*/
|
*/
|
||||||
if ($action == 'builddoc') // En get ou en post
|
if ($action == 'builddoc') // En get ou en post
|
||||||
{
|
{
|
||||||
if (is_numeric(GETPOST('model')))
|
if (is_numeric(GETPOST('model')))
|
||||||
{
|
{
|
||||||
$error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Model"));
|
$error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Model"));
|
||||||
@ -464,7 +462,6 @@ else
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1946,5 +1943,5 @@ else
|
|||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date: 2011/06/25 19:55:36 $ - $Revision: 1.111 $');
|
llxFooter('$Date: 2011/06/29 22:29:51 $ - $Revision: 1.112 $');
|
||||||
?>
|
?>
|
||||||
Loading…
Reference in New Issue
Block a user