2006-02-25 00:16:35 +01:00
< ? php
/* Copyright ( C ) 2004 - 2005 Rodolphe Quiedeville < rodolphe @ quiedeville . org >
2013-09-10 13:45:39 +02:00
* Copyright ( C ) 2004 - 2013 Laurent Destailleur < eldy @ users . sourceforge . net >
2006-02-25 00:16:35 +01:00
* Copyright ( C ) 2004 Benoit Mortier < benoit . mortier @ opensides . be >
2012-12-30 15:13:49 +01:00
* Copyright ( C ) 2005 - 2012 Regis Houssin < regis . houssin @ capnetworks . com >
2007-01-06 15:59:34 +01:00
* Copyright ( C ) 2007 Franky Van Liedekerke < franky . van . liedekerke @ telenet . be >
2013-04-09 17:18:07 +02:00
* Copyright ( C ) 2013 Florian Henry < florian . henry @ open - concept . pro >
2013-12-02 20:30:15 +01:00
* Copyright ( C ) 2013 Alexandre Spangaro < alexandre . spangaro @ gmail . com >
2006-02-25 00:16:35 +01:00
*
* 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
2013-01-16 15:36:08 +01:00
* the Free Software Foundation ; either version 3 of the License , or
2006-02-25 00:16:35 +01:00
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2011-08-01 01:54:11 +02:00
* along with this program . If not , see < http :// www . gnu . org / licenses />.
2006-02-25 00:16:35 +01:00
*/
/**
2008-08-06 15:15:59 +02:00
* \file htdocs / contact / fiche . php
* \ingroup societe
2011-01-05 18:43:58 +01:00
* \brief Card of a contact
2008-08-06 15:15:59 +02:00
*/
2006-02-25 00:16:35 +01:00
2012-08-22 23:24:21 +02:00
require '../main.inc.php' ;
2012-08-22 23:11:24 +02:00
require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php' ;
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/lib/contact.lib.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php' ;
2013-07-10 12:28:28 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php' ;
2012-08-22 23:11:24 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php' ;
2012-09-19 17:53:09 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php' ;
2013-04-09 17:18:07 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php' ;
2013-07-10 12:28:28 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php' ;
require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php' ;
2006-02-25 00:16:35 +01:00
$langs -> load ( " companies " );
$langs -> load ( " users " );
2011-01-10 01:04:27 +01:00
$langs -> load ( " other " );
2011-01-27 21:43:17 +01:00
$langs -> load ( " commercial " );
2006-02-25 00:16:35 +01:00
2011-08-23 00:04:21 +02:00
$mesg = '' ; $error = 0 ; $errors = array ();
2011-04-06 16:26:43 +02:00
2012-02-27 17:02:56 +01:00
$action = ( GETPOST ( 'action' , 'alpha' ) ? GETPOST ( 'action' , 'alpha' ) : 'view' );
$confirm = GETPOST ( 'confirm' , 'alpha' );
$backtopage = GETPOST ( 'backtopage' , 'alpha' );
$id = GETPOST ( 'id' , 'int' );
$socid = GETPOST ( 'socid' , 'int' );
2008-02-25 21:03:21 +01:00
if ( $user -> societe_id ) $socid = $user -> societe_id ;
2009-11-29 17:36:01 +01:00
2011-06-30 15:25:32 +02:00
$object = new Contact ( $db );
2012-09-19 17:53:09 +02:00
$extrafields = new ExtraFields ( $db );
2011-06-30 15:25:32 +02:00
2013-04-01 19:43:26 +02:00
// fetch optionals attributes and labels
2013-04-26 10:29:14 +02:00
$extralabels = $extrafields -> fetch_name_optionals_label ( $object -> table_element );
2013-04-01 19:43:26 +02:00
2010-11-03 12:39:40 +01:00
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
2011-09-13 14:00:37 +02:00
$object -> getCanvas ( $id );
2012-07-10 22:10:12 +02:00
$objcanvas = null ;
$canvas = ( ! empty ( $object -> canvas ) ? $object -> canvas : GETPOST ( " canvas " ));
2010-11-03 12:39:40 +01:00
if ( ! empty ( $canvas ))
{
2012-08-22 23:11:24 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/class/canvas.class.php' ;
2011-09-24 17:57:52 +02:00
$objcanvas = new Canvas ( $db , $action );
$objcanvas -> getCanvas ( 'contact' , 'contactcard' , $canvas );
2010-11-03 12:39:40 +01:00
}
2006-03-11 15:18:37 +01:00
2011-09-13 14:00:37 +02:00
// Security check
2013-04-26 12:35:31 +02:00
$result = restrictedArea ( $user , 'contact' , $id , 'socpeople&societe' , '' , '' , 'rowid' , $objcanvas ); // If we create a contact with no company (shared contacts), no check on write permission
2011-09-13 14:00:37 +02:00
2011-08-10 21:55:21 +02:00
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
2012-03-02 14:51:16 +01:00
$hookmanager -> initHooks ( array ( 'contactcard' ));
2011-07-01 00:38:06 +02:00
2006-03-11 15:18:37 +01:00
2008-02-25 17:30:43 +01:00
/*
2009-11-28 08:30:45 +01:00
* Actions
*/
2007-02-26 00:08:25 +01:00
2011-09-24 17:57:52 +02:00
$parameters = array ( 'id' => $id , 'objcanvas' => $objcanvas );
2011-08-11 00:47:33 +02:00
$reshook = $hookmanager -> executeHooks ( 'doActions' , $parameters , $object , $action ); // Note that $action and $object may have been modified by some hooks
2012-09-19 17:53:09 +02:00
$error = $hookmanager -> error ; $errors = array_merge ( $errors , ( array ) $hookmanager -> errors );
2011-07-01 00:38:06 +02:00
2011-07-02 01:11:12 +02:00
if ( empty ( $reshook ))
{
2011-07-04 10:00:52 +02:00
// Cancel
2012-02-27 17:02:56 +01:00
if ( GETPOST ( " cancel " ) && ! empty ( $backtopage ))
2011-07-04 10:00:52 +02:00
{
2012-02-27 17:02:56 +01:00
header ( " Location: " . $backtopage );
2011-07-04 10:00:52 +02:00
exit ;
}
// Creation utilisateur depuis contact
2011-09-24 17:57:52 +02:00
if ( $action == 'confirm_create_user' && $confirm == 'yes' && $user -> rights -> user -> user -> creer )
2011-03-26 19:34:41 +01:00
{
2011-06-30 15:25:32 +02:00
// Recuperation contact actuel
2012-02-27 17:02:56 +01:00
$result = $object -> fetch ( $id );
2011-03-26 19:34:41 +01:00
if ( $result > 0 )
{
2011-06-30 15:25:32 +02:00
$db -> begin ();
// Creation user
$nuser = new User ( $db );
$result = $nuser -> create_from_contact ( $object , $_POST [ " login " ]);
if ( $result > 0 )
2011-03-26 19:34:41 +01:00
{
2011-11-30 12:04:59 +01:00
$result2 = $nuser -> setPassword ( $user , $_POST [ " password " ], 0 , 0 , 1 );
2011-06-30 15:25:32 +02:00
if ( $result2 )
{
$db -> commit ();
}
else
{
$error = $nuser -> error ; $errors = $nuser -> errors ;
$db -> rollback ();
}
2011-03-26 19:34:41 +01:00
}
else
{
2011-06-01 18:23:33 +02:00
$error = $nuser -> error ; $errors = $nuser -> errors ;
2011-01-29 18:41:26 +01:00
$db -> rollback ();
2011-03-26 19:34:41 +01:00
}
}
else
{
2011-06-30 15:25:32 +02:00
$error = $object -> error ; $errors = $object -> errors ;
2011-03-26 19:34:41 +01:00
}
}
2013-09-25 19:58:22 +02:00
2011-03-26 19:34:41 +01:00
2013-10-08 00:42:28 +02:00
// Confirmation desactivation
if ( $action == 'disable' )
{
$object -> fetch ( $id );
$object -> setstatus ( 0 );
header ( " Location: " . $_SERVER [ 'PHP_SELF' ] . '?id=' . $id );
exit ;
}
2013-07-10 12:28:28 +02:00
2013-10-08 00:42:28 +02:00
// Confirmation activation
if ( $action == 'enable' )
{
$object -> fetch ( $id );
$object -> setstatus ( 1 );
header ( " Location: " . $_SERVER [ 'PHP_SELF' ] . '?id=' . $id );
exit ;
}
2013-09-25 19:58:22 +02:00
2011-06-30 15:25:32 +02:00
// Add contact
2011-09-24 17:57:52 +02:00
if ( $action == 'add' && $user -> rights -> societe -> contact -> creer )
2011-03-26 19:34:41 +01:00
{
2011-06-30 15:25:32 +02:00
$db -> begin ();
2011-06-30 00:29:50 +02:00
2011-06-30 15:25:32 +02:00
if ( $canvas ) $object -> canvas = $canvas ;
2011-03-26 19:34:41 +01:00
2011-05-29 19:34:07 +02:00
$object -> socid = $_POST [ " socid " ];
2012-03-19 10:17:24 +01:00
$object -> lastname = $_POST [ " lastname " ];
2011-03-26 19:34:41 +01:00
$object -> firstname = $_POST [ " firstname " ];
$object -> civilite_id = $_POST [ " civilite_id " ];
$object -> poste = $_POST [ " poste " ];
$object -> address = $_POST [ " address " ];
$object -> zip = $_POST [ " zipcode " ];
$object -> town = $_POST [ " town " ];
2011-12-29 18:07:41 +01:00
$object -> country_id = $_POST [ " country_id " ];
2013-03-08 02:49:42 +01:00
$object -> state_id = $_POST [ " state_id " ];
2013-11-04 21:41:36 +01:00
$object -> skype = $_POST [ " skype " ];
2011-03-26 19:34:41 +01:00
$object -> email = $_POST [ " email " ];
$object -> phone_pro = $_POST [ " phone_pro " ];
$object -> phone_perso = $_POST [ " phone_perso " ];
$object -> phone_mobile = $_POST [ " phone_mobile " ];
$object -> fax = $_POST [ " fax " ];
$object -> jabberid = $_POST [ " jabberid " ];
2013-11-04 21:41:36 +01:00
$object -> no_email = $_POST [ " no_email " ];
2011-03-26 19:34:41 +01:00
$object -> priv = $_POST [ " priv " ];
2013-04-09 17:18:07 +02:00
$object -> note_public = GETPOST ( " note_public " );
$object -> note_private = GETPOST ( " note_private " );
2013-10-30 12:40:00 +01:00
$object -> statut = 1 ; //Defult status to Actif
2010-11-19 22:24:48 +01:00
2011-06-30 15:25:32 +02:00
// Note: Correct date should be completed with location to have exact GM time of birth.
$object -> birthday = dol_mktime ( 0 , 0 , 0 , $_POST [ " birthdaymonth " ], $_POST [ " birthdayday " ], $_POST [ " birthdayyear " ]);
$object -> birthday_alert = $_POST [ " birthday_alert " ];
2013-04-01 19:43:26 +02:00
// Fill array 'array_options' with data from add form
2013-04-09 23:56:52 +02:00
$ret = $extrafields -> setOptionalsFromPost ( $extralabels , $object );
2012-09-17 01:39:30 +02:00
2012-03-19 10:17:24 +01:00
if ( ! $_POST [ " lastname " ])
2011-06-30 15:25:32 +02:00
{
$error ++ ; $errors [] = $langs -> trans ( " ErrorFieldRequired " , $langs -> transnoentities ( " Lastname " ) . ' / ' . $langs -> transnoentities ( " Label " ));
2011-10-23 13:02:54 +02:00
$action = 'create' ;
2011-06-30 15:25:32 +02:00
}
2012-05-12 12:32:24 +02:00
2012-03-19 10:17:24 +01:00
if ( ! $error )
2011-06-30 15:25:32 +02:00
{
$id = $object -> create ( $user );
if ( $id <= 0 )
{
2012-05-12 12:32:24 +02:00
$error ++ ; $errors = array_merge ( $errors ,( $object -> error ? array ( $object -> error ) : $object -> errors ));
2011-10-23 13:02:54 +02:00
$action = 'create' ;
2011-06-30 15:25:32 +02:00
}
}
if ( ! $error && $id > 0 )
{
$db -> commit ();
2012-02-27 17:02:56 +01:00
if ( ! empty ( $backtopage )) $url = $backtopage ;
2011-06-30 15:25:32 +02:00
else $url = 'fiche.php?id=' . $id ;
2012-08-31 05:58:38 +02:00
header ( " Location: " . $url );
2011-06-30 15:25:32 +02:00
exit ;
}
else
{
$db -> rollback ();
}
}
2011-09-24 17:57:52 +02:00
if ( $action == 'confirm_delete' && $confirm == 'yes' && $user -> rights -> societe -> contact -> supprimer )
2011-06-30 15:25:32 +02:00
{
2013-10-07 22:50:12 +02:00
$result = $object -> fetch ( $id );
2011-06-30 15:25:32 +02:00
2013-03-09 20:34:38 +01:00
$object -> old_lastname = $_POST [ " old_lastname " ];
2011-06-30 15:25:32 +02:00
$object -> old_firstname = $_POST [ " old_firstname " ];
2011-03-26 19:34:41 +01:00
2011-06-30 15:25:32 +02:00
$result = $object -> delete ();
2011-03-26 19:34:41 +01:00
if ( $result > 0 )
{
2012-08-31 05:58:38 +02:00
header ( " Location: " . DOL_URL_ROOT . '/contact/list.php' );
2011-06-30 15:25:32 +02:00
exit ;
2011-03-26 19:34:41 +01:00
}
else
{
2012-05-12 12:32:24 +02:00
$error = $object -> error ; $errors = $object -> errors ;
2011-06-30 15:25:32 +02:00
}
}
2011-09-24 17:57:52 +02:00
if ( $action == 'update' && ! $_POST [ " cancel " ] && $user -> rights -> societe -> contact -> creer )
2011-06-30 15:25:32 +02:00
{
2012-03-19 10:17:24 +01:00
if ( empty ( $_POST [ " lastname " ]))
2011-06-30 15:25:32 +02:00
{
$error ++ ; $errors = array ( $langs -> trans ( " ErrorFieldRequired " , $langs -> transnoentities ( " Name " ) . ' / ' . $langs -> transnoentities ( " Label " )));
2011-09-24 17:57:52 +02:00
$action = 'edit' ;
2011-06-30 15:25:32 +02:00
}
2012-03-19 10:17:24 +01:00
if ( ! $error )
2011-06-30 15:25:32 +02:00
{
2013-10-07 22:50:12 +02:00
$contactid = GETPOST ( " contactid " , 'int' );
$object -> fetch ( $contactid );
2011-06-30 15:25:32 +02:00
$object -> oldcopy = dol_clone ( $object );
2013-03-09 20:34:38 +01:00
$object -> old_lastname = $_POST [ " old_lastname " ];
2011-06-30 15:25:32 +02:00
$object -> old_firstname = $_POST [ " old_firstname " ];
$object -> socid = $_POST [ " socid " ];
2012-03-19 10:17:24 +01:00
$object -> lastname = $_POST [ " lastname " ];
2011-06-30 15:25:32 +02:00
$object -> firstname = $_POST [ " firstname " ];
$object -> civilite_id = $_POST [ " civilite_id " ];
$object -> poste = $_POST [ " poste " ];
$object -> address = $_POST [ " address " ];
$object -> zip = $_POST [ " zipcode " ];
$object -> town = $_POST [ " town " ];
2013-03-08 02:49:42 +01:00
$object -> state_id = $_POST [ " state_id " ];
2011-12-29 18:07:41 +01:00
$object -> country_id = $_POST [ " country_id " ];
2011-06-30 15:25:32 +02:00
$object -> email = $_POST [ " email " ];
2013-11-04 21:41:36 +01:00
$object -> skype = $_POST [ " skype " ];
2011-06-30 15:25:32 +02:00
$object -> phone_pro = $_POST [ " phone_pro " ];
$object -> phone_perso = $_POST [ " phone_perso " ];
$object -> phone_mobile = $_POST [ " phone_mobile " ];
$object -> fax = $_POST [ " fax " ];
$object -> jabberid = $_POST [ " jabberid " ];
2012-08-22 22:59:10 +02:00
$object -> no_email = $_POST [ " no_email " ];
2011-06-30 15:25:32 +02:00
$object -> priv = $_POST [ " priv " ];
2013-04-09 17:18:07 +02:00
$object -> note_public = GETPOST ( " note_public " );
$object -> note_private = GETPOST ( " note_private " );
2011-06-30 15:25:32 +02:00
2013-04-01 19:43:26 +02:00
// Fill array 'array_options' with data from add form
2013-04-09 23:56:52 +02:00
$ret = $extrafields -> setOptionalsFromPost ( $extralabels , $object );
2012-09-17 01:39:30 +02:00
2013-10-07 22:50:12 +02:00
$result = $object -> update ( $contactid , $user );
2011-06-30 15:25:32 +02:00
if ( $result > 0 )
{
2013-03-09 20:34:38 +01:00
$object -> old_lastname = '' ;
2011-06-30 15:25:32 +02:00
$object -> old_firstname = '' ;
2012-02-28 16:48:18 +01:00
$action = 'view' ;
2011-06-30 15:25:32 +02:00
}
else
{
$error = $object -> error ; $errors = $object -> errors ;
2012-02-28 16:48:18 +01:00
$action = 'edit' ;
2011-06-30 15:25:32 +02:00
}
2011-03-26 19:34:41 +01:00
}
}
2006-03-11 15:55:13 +01:00
}
2006-02-25 00:16:35 +01:00
/*
2009-11-28 08:30:45 +01:00
* View
*/
2006-02-25 00:16:35 +01:00
2012-09-17 01:39:30 +02:00
2011-05-29 19:34:07 +02:00
$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas' ;
llxHeader ( '' , $langs -> trans ( " ContactsAddresses " ), $help_url );
2006-04-01 17:01:01 +02:00
2006-02-25 00:16:35 +01:00
$form = new Form ( $db );
2008-11-16 02:54:33 +01:00
$formcompany = new FormCompany ( $db );
2006-02-25 00:16:35 +01:00
2010-06-06 16:30:28 +02:00
$countrynotdefined = $langs -> trans ( " ErrorSetACountryFirst " ) . ' (' . $langs -> trans ( " SeeAbove " ) . ')' ;
2010-09-15 14:00:05 +02:00
if ( $socid > 0 )
2006-02-25 00:16:35 +01:00
{
$objsoc = new Societe ( $db );
$objsoc -> fetch ( $socid );
}
2012-02-28 16:48:18 +01:00
if ( is_object ( $objcanvas ) && $objcanvas -> displayCanvasExists ( $action ))
2006-02-25 00:16:35 +01:00
{
2011-03-26 19:34:41 +01:00
// -----------------------------------------
// When used with CANVAS
// -----------------------------------------
2012-05-30 03:02:44 +02:00
if ( empty ( $object -> error ) && $id )
2011-09-24 22:50:57 +02:00
{
2013-04-09 23:56:52 +02:00
$object = new Contact ( $db );
$result = $object -> fetch ( $id );
if ( $result <= 0 ) dol_print_error ( '' , $object -> error );
2011-09-24 22:50:57 +02:00
}
2013-04-09 23:56:52 +02:00
$objcanvas -> assign_values ( $action , $object -> id , $object -> ref ); // Set value for templates
$objcanvas -> display_canvas ( $action ); // Show template
2006-02-25 00:16:35 +01:00
}
2010-11-03 12:39:40 +01:00
else
2006-02-25 00:16:35 +01:00
{
2011-03-26 19:34:41 +01:00
// -----------------------------------------
// When used in standard mode
// -----------------------------------------
// Confirm deleting contact
if ( $user -> rights -> societe -> contact -> supprimer )
{
2011-09-24 17:57:52 +02:00
if ( $action == 'delete' )
2011-03-26 19:34:41 +01:00
{
2013-10-07 22:52:14 +02:00
print $form -> formconfirm ( $_SERVER [ " PHP_SELF " ] . " ?id= " . $id , $langs -> trans ( " DeleteContact " ), $langs -> trans ( " ConfirmDeleteContact " ), " confirm_delete " , '' , 0 , 1 );
2011-03-26 19:34:41 +01:00
}
}
/*
* Onglets
*/
2011-09-24 17:57:52 +02:00
if ( $id > 0 )
2011-03-26 19:34:41 +01:00
{
// Si edition contact deja existant
$object = new Contact ( $db );
2012-09-17 01:39:30 +02:00
$res = $object -> fetch ( $id , $user );
if ( $res < 0 ) { dol_print_error ( $db , $object -> error ); exit ; }
$res = $object -> fetch_optionals ( $object -> id , $extralabels );
2011-03-26 19:34:41 +01:00
// Show tabs
$head = contact_prepare_head ( $object );
2012-03-18 19:23:01 +01:00
2012-03-14 15:32:48 +01:00
$title = ( ! empty ( $conf -> global -> SOCIETE_ADDRESSES_MANAGEMENT ) ? $langs -> trans ( " Contacts " ) : $langs -> trans ( " ContactsAddresses " ));
dol_fiche_head ( $head , 'card' , $title , 0 , 'contact' );
2011-03-26 19:34:41 +01:00
}
if ( $user -> rights -> societe -> contact -> creer )
{
2011-09-24 17:57:52 +02:00
if ( $action == 'create' )
2011-03-26 19:34:41 +01:00
{
/*
* Fiche en mode creation
*/
2011-09-24 22:50:57 +02:00
$object -> canvas = $canvas ;
2012-06-27 23:46:25 +02:00
$object -> state_id = $_POST [ " state_id " ];
2011-03-26 19:34:41 +01:00
2011-12-29 18:07:41 +01:00
// We set country_id, country_code and label for the selected country
2012-12-01 15:45:05 +01:00
$object -> country_id = $_POST [ " country_id " ] ? $_POST [ " country_id " ] : ( empty ( $objsoc -> country_id ) ? $mysoc -> country_id : $objsoc -> country_id );
2011-12-29 18:07:41 +01:00
if ( $object -> country_id )
2011-03-26 19:34:41 +01:00
{
2011-12-29 18:07:41 +01:00
$tmparray = getCountry ( $object -> country_id , 'all' );
$object -> country_code = $tmparray [ 'code' ];
$object -> country = $tmparray [ 'label' ];
2011-03-26 19:34:41 +01:00
}
2012-03-18 19:23:01 +01:00
2012-03-14 15:04:55 +01:00
$title = $addcontact = ( ! empty ( $conf -> global -> SOCIETE_ADDRESSES_MANAGEMENT ) ? $langs -> trans ( " AddContact " ) : $langs -> trans ( " AddContactAddress " ));
print_fiche_titre ( $title );
2011-03-26 19:34:41 +01:00
// Affiche les erreurs
2012-05-12 12:32:24 +02:00
dol_htmloutput_errors ( is_numeric ( $error ) ? '' : $error , $errors );
2011-03-26 19:34:41 +01:00
if ( $conf -> use_javascript_ajax )
{
2012-09-28 14:56:47 +02:00
print " \n " . '<script type="text/javascript" language="javascript">' . " \n " ;
print ' jQuery ( document ) . ready ( function () {
2011-12-29 18:07:41 +01:00
jQuery ( " #selectcountry_id " ) . change ( function () {
2010-11-03 12:39:40 +01:00
document . formsoc . action . value = " create " ;
document . formsoc . submit ();
2012-09-28 14:56:47 +02:00
});
2012-10-06 19:25:25 +02:00
2012-09-28 14:27:16 +02:00
$ ( " #copyaddressfromsoc " ) . click ( function () {
2013-02-12 10:33:10 +01:00
$ ( \ 'textarea[name="address"]\').val("' . dol_escape_js ( $objsoc -> address ) . ' " );
2012-12-11 10:59:03 +01:00
$ ( \ 'input[name="zipcode"]\').val("' . dol_escape_js ( $objsoc -> zip ) . ' " );
$ ( \ 'input[name="town"]\').val("' . dol_escape_js ( $objsoc -> town ) . ' " );
$ ( \ 'select[name="country_id"]\').val("' . dol_escape_js ( $objsoc -> country_id ) . ' " );
$ ( \ 'select[name="state_id"]\').val("' . dol_escape_js ( $objsoc -> state_id ) . ' " );
$ ( \ 'input[name="email"]\').val("' . dol_escape_js ( $objsoc -> email ) . ' " );
});
2012-09-28 14:27:16 +02:00
}) ' . " \n " ;
2012-09-28 14:56:47 +02:00
print '</script>' . " \n " ;
2011-03-26 19:34:41 +01:00
}
2010-11-19 22:24:48 +01:00
2011-03-26 19:34:41 +01:00
print '<br>' ;
print '<form method="post" name="formsoc" action="' . $_SERVER [ " PHP_SELF " ] . '">' ;
print '<input type="hidden" name="token" value="' . $_SESSION [ 'newtoken' ] . '">' ;
print '<input type="hidden" name="action" value="add">' ;
2012-02-27 17:02:56 +01:00
print '<input type="hidden" name="backtopage" value="' . $backtopage . '">' ;
2011-03-26 19:34:41 +01:00
print '<table class="border" width="100%">' ;
2010-11-19 22:24:48 +01:00
2011-03-26 19:34:41 +01:00
// Name
2012-03-19 10:17:24 +01:00
print '<tr><td width="20%" class="fieldrequired">' . $langs -> trans ( " Lastname " ) . ' / ' . $langs -> trans ( " Label " ) . '</td><td width="30%"><input name="lastname" type="text" size="30" maxlength="80" value="' . ( isset ( $_POST [ " lastname " ]) ? $_POST [ " lastname " ] : $object -> lastname ) . '"></td>' ;
2011-03-26 19:34:41 +01:00
print '<td width="20%">' . $langs -> trans ( " Firstname " ) . '</td><td width="30%"><input name="firstname" type="text" size="30" maxlength="80" value="' . ( isset ( $_POST [ " firstname " ]) ? $_POST [ " firstname " ] : $object -> firstname ) . '"></td></tr>' ;
2010-11-19 22:24:48 +01:00
2011-03-26 19:34:41 +01:00
// Company
2011-02-13 13:55:40 +01:00
if ( empty ( $conf -> global -> SOCIETE_DISABLE_CONTACTS ))
{
2011-03-26 19:34:41 +01:00
if ( $socid > 0 )
{
print '<tr><td>' . $langs -> trans ( " Company " ) . '</td>' ;
2013-12-02 20:30:15 +01:00
print '<td colspan="3" class="maxwidthonsmartphone">' ;
2011-03-26 19:34:41 +01:00
print $objsoc -> getNomUrl ( 1 );
print '</td>' ;
print '<input type="hidden" name="socid" value="' . $objsoc -> id . '">' ;
print '</td></tr>' ;
}
else {
2013-12-02 20:30:15 +01:00
print '<tr><td>' . $langs -> trans ( " Company " ) . '</td><td colspan="3" class="maxwidthonsmartphone">' ;
2012-10-06 19:25:25 +02:00
print $form -> select_company ( $socid , 'socid' , '' , 1 );
2011-03-26 19:34:41 +01:00
print '</td></tr>' ;
}
}
// Civility
print '<tr><td width="15%">' . $langs -> trans ( " UserTitle " ) . '</td><td colspan="3">' ;
2011-10-22 15:55:08 +02:00
print $formcompany -> select_civility ( isset ( $_POST [ " civilite_id " ]) ? $_POST [ " civilite_id " ] : $object -> civilite_id );
2011-03-26 19:34:41 +01:00
print '</td></tr>' ;
print '<tr><td>' . $langs -> trans ( " PostOrFunction " ) . '</td><td colspan="3"><input name="poste" type="text" size="50" maxlength="80" value="' . ( isset ( $_POST [ " poste " ]) ? $_POST [ " poste " ] : $object -> poste ) . '"></td>' ;
2012-10-25 16:23:58 +02:00
$colspan = 3 ;
if ( $conf -> use_javascript_ajax && $socid > 0 ) $colspan = 2 ;
2012-12-01 15:45:05 +01:00
2011-03-26 19:34:41 +01:00
// Address
if (( $objsoc -> typent_code == 'TE_PRIVATE' || ! empty ( $conf -> global -> CONTACT_USE_COMPANY_ADDRESS )) && dol_strlen ( trim ( $object -> address )) == 0 ) $object -> address = $objsoc -> address ; // Predefined with third party
2012-09-28 14:27:16 +02:00
print '<tr><td>' . $langs -> trans ( " Address " );
2012-10-25 16:23:58 +02:00
print '</td><td colspan="' . $colspan . '"><textarea class="flat" name="address" cols="70">' . ( isset ( $_POST [ " address " ]) ? $_POST [ " address " ] : $object -> address ) . '</textarea></td>' ;
2012-10-06 19:25:25 +02:00
2012-10-25 16:23:58 +02:00
if ( $conf -> use_javascript_ajax && $socid > 0 )
{
2012-12-01 15:45:05 +01:00
$rowspan = 3 ;
2012-10-25 16:23:58 +02:00
if ( empty ( $conf -> global -> SOCIETE_DISABLE_STATE )) $rowspan ++ ;
2012-12-01 15:45:05 +01:00
2012-10-25 16:23:58 +02:00
print '<td valign="middle" align="center" rowspan="' . $rowspan . '">' ;
print '<a href="#" id="copyaddressfromsoc">' . $langs -> trans ( 'CopyAddressFromSoc' ) . '</a>' ;
print '</td>' ;
}
2012-10-06 19:25:25 +02:00
print '</tr>' ;
2011-03-26 19:34:41 +01:00
// Zip / Town
if (( $objsoc -> typent_code == 'TE_PRIVATE' || ! empty ( $conf -> global -> CONTACT_USE_COMPANY_ADDRESS )) && dol_strlen ( trim ( $object -> zip )) == 0 ) $object -> zip = $objsoc -> zip ; // Predefined with third party
if (( $objsoc -> typent_code == 'TE_PRIVATE' || ! empty ( $conf -> global -> CONTACT_USE_COMPANY_ADDRESS )) && dol_strlen ( trim ( $object -> town )) == 0 ) $object -> town = $objsoc -> town ; // Predefined with third party
2013-12-02 20:30:15 +01:00
print '<tr><td>' . $langs -> trans ( " Zip " ) . ' / ' . $langs -> trans ( " Town " ) . '</td><td colspan="' . $colspan . '" class="maxwidthonsmartphone">' ;
2012-06-27 23:46:25 +02:00
print $formcompany -> select_ziptown (( isset ( $_POST [ " zipcode " ]) ? $_POST [ " zipcode " ] : $object -> zip ), 'zipcode' , array ( 'town' , 'selectcountry_id' , 'state_id' ), 6 ) . ' ' ;
print $formcompany -> select_ziptown (( isset ( $_POST [ " town " ]) ? $_POST [ " town " ] : $object -> town ), 'town' , array ( 'zipcode' , 'selectcountry_id' , 'state_id' ));
2011-03-26 19:34:41 +01:00
print '</td></tr>' ;
// Country
2013-12-02 20:30:15 +01:00
print '<tr><td>' . $langs -> trans ( " Country " ) . '</td><td colspan="' . $colspan . '" class="maxwidthonsmartphone">' ;
2011-12-29 18:07:41 +01:00
print $form -> select_country (( isset ( $_POST [ " country_id " ]) ? $_POST [ " country_id " ] : $object -> country_id ), 'country_id' );
2011-03-26 19:34:41 +01:00
if ( $user -> admin ) print info_admin ( $langs -> trans ( " YouCanChangeValuesForThisListFromDictionnarySetup " ), 1 );
print '</td></tr>' ;
// State
if ( empty ( $conf -> global -> SOCIETE_DISABLE_STATE ))
{
2013-12-02 20:30:15 +01:00
print '<tr><td>' . $langs -> trans ( 'State' ) . '</td><td colspan="' . $colspan . '" class="maxwidthonsmartphone">' ;
2011-12-29 18:07:41 +01:00
if ( $object -> country_id )
2011-03-26 19:34:41 +01:00
{
2012-06-27 23:46:25 +02:00
print $formcompany -> select_state ( isset ( $_POST [ " state_id " ]) ? $_POST [ " state_id " ] : $object -> state_id , $object -> country_code , 'state_id' );
2011-03-26 19:34:41 +01:00
}
else
2012-10-06 19:25:25 +02:00
{
2011-03-26 19:34:41 +01:00
print $countrynotdefined ;
}
print '</td></tr>' ;
}
// Phone / Fax
2013-09-25 19:58:22 +02:00
if (( $objsoc -> typent_code == 'TE_PRIVATE' || ! empty ( $conf -> global -> CONTACT_USE_COMPANY_ADDRESS )) && dol_strlen ( trim ( $object -> phone_pro )) == 0 ) $object -> phone_pro = $objsoc -> phone ; // Predefined with third party
2012-12-11 10:59:03 +01:00
print '<tr><td>' . $langs -> trans ( " PhonePro " ) . '</td><td><input name="phone_pro" id="phone_pro" type="text" size="18" maxlength="80" value="' . ( isset ( $_POST [ " phone_pro " ]) ? $_POST [ " phone_pro " ] : $object -> phone_pro ) . '"></td>' ;
print '<td>' . $langs -> trans ( " PhonePerso " ) . '</td><td><input name="phone_perso" id="phone_perso" type="text" size="18" maxlength="80" value="' . ( isset ( $_POST [ " phone_perso " ]) ? $_POST [ " phone_perso " ] : $object -> phone_perso ) . '"></td></tr>' ;
2011-03-26 19:34:41 +01:00
if (( $objsoc -> typent_code == 'TE_PRIVATE' || ! empty ( $conf -> global -> CONTACT_USE_COMPANY_ADDRESS )) && dol_strlen ( trim ( $object -> fax )) == 0 ) $object -> fax = $objsoc -> fax ; // Predefined with third party
2012-12-11 10:59:03 +01:00
print '<tr><td>' . $langs -> trans ( " PhoneMobile " ) . '</td><td><input name="phone_mobile" id="phone_mobile" type="text" size="18" maxlength="80" value="' . ( isset ( $_POST [ " phone_mobile " ]) ? $_POST [ " phone_mobile " ] : $object -> phone_mobile ) . '"></td>' ;
print '<td>' . $langs -> trans ( " Fax " ) . '</td><td><input name="fax" id="fax" type="text" size="18" maxlength="80" value="' . ( isset ( $_POST [ " fax " ]) ? $_POST [ " fax " ] : $object -> fax ) . '"></td></tr>' ;
2011-03-26 19:34:41 +01:00
// EMail
if (( $objsoc -> typent_code == 'TE_PRIVATE' || ! empty ( $conf -> global -> CONTACT_USE_COMPANY_ADDRESS )) && dol_strlen ( trim ( $object -> email )) == 0 ) $object -> email = $objsoc -> email ; // Predefined with third party
2012-12-11 10:59:03 +01:00
print '<tr><td>' . $langs -> trans ( " Email " ) . '</td><td><input name="email" id="email" type="text" size="50" maxlength="80" value="' . ( isset ( $_POST [ " email " ]) ? $_POST [ " email " ] : $object -> email ) . '"></td>' ;
2012-08-26 20:28:19 +02:00
if ( ! empty ( $conf -> mailing -> enabled ))
{
print '<td>' . $langs -> trans ( " No_Email " ) . '</td><td>' . $form -> selectyesno ( 'no_email' ,( isset ( $_POST [ " no_email " ]) ? $_POST [ " no_email " ] : $object -> no_email ), 1 ) . '</td>' ;
}
else
2013-11-04 21:41:36 +01:00
{
2012-09-07 17:23:16 +02:00
print '<td colspan="2"> </td>' ;
2012-08-26 20:28:19 +02:00
}
2012-09-07 17:23:16 +02:00
print '</tr>' ;
2011-03-26 19:34:41 +01:00
2012-08-22 22:59:10 +02:00
// Instant message and no email
2012-08-26 20:28:19 +02:00
print '<tr><td>' . $langs -> trans ( " IM " ) . '</td><td colspan="3"><input name="jabberid" type="text" size="50" maxlength="80" value="' . ( isset ( $_POST [ " jabberid " ]) ? $_POST [ " jabberid " ] : $object -> jabberid ) . '"></td></tr>' ;
2011-03-26 19:34:41 +01:00
2013-11-04 21:41:36 +01:00
// Skype
if ( ! empty ( $conf -> skype -> enabled ))
2013-12-02 20:30:15 +01:00
{
2013-11-04 21:41:36 +01:00
print '<tr><td>' . $langs -> trans ( " Skype " ) . '</td><td colspan="3"><input name="skype" type="text" size="50" maxlength="80" value="' . ( isset ( $_POST [ " skype " ]) ? $_POST [ " skype " ] : $object -> skype ) . '"></td></tr>' ;
}
2013-12-02 20:30:15 +01:00
2011-03-26 19:34:41 +01:00
// Visibility
print '<tr><td>' . $langs -> trans ( " ContactVisibility " ) . '</td><td colspan="3">' ;
$selectarray = array ( '0' => $langs -> trans ( " ContactPublic " ), '1' => $langs -> trans ( " ContactPrivate " ));
print $form -> selectarray ( 'priv' , $selectarray ,( isset ( $_POST [ " priv " ]) ? $_POST [ " priv " ] : $object -> priv ), 0 );
print '</td></tr>' ;
2012-09-19 17:53:09 +02:00
// Other attributes
$parameters = array ( 'colspan' => ' colspan="3"' );
$reshook = $hookmanager -> executeHooks ( 'formObjectOptions' , $parameters , $object , $action ); // Note that $action and $object may have been modified by hook
if ( empty ( $reshook ) && ! empty ( $extrafields -> attribute_label ))
{
2013-04-01 19:43:26 +02:00
print $object -> showOptionals ( $extrafields , 'edit' );
2012-09-19 17:53:09 +02:00
}
2010-11-19 22:24:48 +01:00
print " </table><br> " ;
// Add personnal information
print_fiche_titre ( '<div class="comboperso">' . $langs -> trans ( " PersonalInformations " ) . '</div>' , '' , '' );
print '<table class="border" width="100%">' ;
// Date To Birth
print '<tr><td width="20%">' . $langs -> trans ( " DateToBirth " ) . '</td><td width="30%">' ;
2011-11-08 10:18:45 +01:00
$form = new Form ( $db );
2010-11-19 22:24:48 +01:00
if ( $object -> birthday )
{
2011-11-08 10:18:45 +01:00
print $form -> select_date ( $object -> birthday , 'birthday' , 0 , 0 , 0 , " perso " );
2010-11-19 22:24:48 +01:00
}
else
{
2011-11-08 10:18:45 +01:00
print $form -> select_date ( '' , 'birthday' , 0 , 0 , 1 , " perso " );
2010-11-19 22:24:48 +01:00
}
print '</td>' ;
print '<td colspan="2">' . $langs -> trans ( " Alert " ) . ': ' ;
if ( $object -> birthday_alert )
{
print '<input type="checkbox" name="birthday_alert" checked></td>' ;
}
else
{
print '<input type="checkbox" name="birthday_alert"></td>' ;
}
print '</tr>' ;
2011-08-13 02:47:59 +02:00
print " </table><br><br> " ;
2010-11-19 22:24:48 +01:00
2011-03-20 23:22:26 +01:00
print '<center>' ;
print '<input type="submit" class="button" name="add" value="' . $langs -> trans ( " Add " ) . '">' ;
2012-02-27 17:02:56 +01:00
if ( ! empty ( $backtopage ))
2011-03-20 23:22:26 +01:00
{
2011-03-26 19:34:41 +01:00
print ' ' ;
print '<input type="submit" class="button" name="cancel" value="' . $langs -> trans ( " Cancel " ) . '">' ;
2011-03-20 23:22:26 +01:00
}
print '</center>' ;
2010-11-19 22:24:48 +01:00
2011-03-26 19:34:41 +01:00
print " </form> " ;
}
2011-09-24 17:57:52 +02:00
elseif ( $action == 'edit' && ! empty ( $id ))
2011-03-26 19:34:41 +01:00
{
/*
* Fiche en mode edition
*/
2011-12-29 18:07:41 +01:00
// We set country_id, and country_code label of the chosen country
if ( isset ( $_POST [ " country_id " ]) || $object -> country_id )
2011-03-26 19:34:41 +01:00
{
2011-12-29 18:07:41 +01:00
$tmparray = getCountry ( $object -> country_id , 'all' );
$object -> country_code = $tmparray [ 'code' ];
$object -> country = $tmparray [ 'label' ];
2011-03-26 19:34:41 +01:00
}
2012-10-06 19:25:25 +02:00
2012-09-28 14:56:47 +02:00
$objsoc = new Societe ( $db );
$objsoc -> fetch ( $object -> socid );
2011-03-26 19:34:41 +01:00
// Affiche les erreurs
2011-06-01 18:23:33 +02:00
dol_htmloutput_errors ( $error , $errors );
2011-03-26 19:34:41 +01:00
if ( $conf -> use_javascript_ajax )
{
2012-09-28 14:56:47 +02:00
print " \n " . '<script type="text/javascript" language="javascript">' . " \n " ;
print ' jQuery ( document ) . ready ( function () {
2011-12-29 18:07:41 +01:00
jQuery ( " #selectcountry_id " ) . change ( function () {
2012-09-28 14:58:47 +02:00
document . formsoc . action . value = " edit " ;
2010-11-03 12:39:40 +01:00
document . formsoc . submit ();
});
2012-10-06 19:25:25 +02:00
2012-09-28 14:56:47 +02:00
$ ( " #copyaddressfromsoc " ) . click ( function () {
2013-03-01 18:41:41 +01:00
$ ( \ 'textarea[name="address"]\').text("' . dol_escape_js ( $objsoc -> address ) . ' " );
$ ( \ 'input[name="zipcode"]\').val("' . dol_escape_js ( $objsoc -> zip ) . ' " );
$ ( \ 'input[name="town"]\').val("' . dol_escape_js ( $objsoc -> town ) . ' " );
$ ( \ 'select[name="country_id"]\').val("' . dol_escape_js ( $objsoc -> country_id ) . ' " );
$ ( \ 'select[name="state_id"]\').val("' . dol_escape_js ( $objsoc -> state_id ) . ' " );
2012-10-06 19:25:25 +02:00
});
2012-09-28 14:56:47 +02:00
}) ' . " \n " ;
print '</script>' . " \n " ;
2011-03-26 19:34:41 +01:00
}
2012-02-27 17:02:56 +01:00
print '<form method="post" action="' . $_SERVER [ " PHP_SELF " ] . '?id=' . $id . '" name="formsoc">' ;
2011-03-26 19:34:41 +01:00
print '<input type="hidden" name="token" value="' . $_SESSION [ 'newtoken' ] . '">' ;
2012-02-27 17:02:56 +01:00
print '<input type="hidden" name="id" value="' . $id . '">' ;
2011-03-26 19:34:41 +01:00
print '<input type="hidden" name="action" value="update">' ;
print '<input type="hidden" name="contactid" value="' . $object -> id . '">' ;
2013-03-09 20:34:38 +01:00
print '<input type="hidden" name="old_lastname" value="' . $object -> lastname . '">' ;
2011-03-26 19:34:41 +01:00
print '<input type="hidden" name="old_firstname" value="' . $object -> firstname . '">' ;
2012-07-08 23:22:22 +02:00
if ( ! empty ( $backtopage )) print '<input type="hidden" name="backtopage" value="' . $backtopage . '">' ;
2011-03-26 19:34:41 +01:00
print '<table class="border" width="100%">' ;
// Ref
print '<tr><td>' . $langs -> trans ( " Ref " ) . '</td><td colspan="3">' ;
print $object -> ref ;
print '</td></tr>' ;
2013-02-23 16:08:35 +01:00
// Lastname
2012-03-19 10:17:24 +01:00
print '<tr><td width="20%" class="fieldrequired">' . $langs -> trans ( " Lastname " ) . ' / ' . $langs -> trans ( " Label " ) . '</td><td width="30%"><input name="lastname" type="text" size="20" maxlength="80" value="' . ( isset ( $_POST [ " lastname " ]) ? $_POST [ " lastname " ] : $object -> lastname ) . '"></td>' ;
2011-03-26 19:34:41 +01:00
print '<td width="20%">' . $langs -> trans ( " Firstname " ) . '</td><td width="30%"><input name="firstname" type="text" size="20" maxlength="80" value="' . ( isset ( $_POST [ " firstname " ]) ? $_POST [ " firstname " ] : $object -> firstname ) . '"></td></tr>' ;
// Company
2011-02-13 13:55:40 +01:00
if ( empty ( $conf -> global -> SOCIETE_DISABLE_CONTACTS ))
{
2011-03-26 19:34:41 +01:00
print '<tr><td>' . $langs -> trans ( " Company " ) . '</td>' ;
2013-12-02 20:30:15 +01:00
print '<td colspan="3" class="maxwidthonsmartphone">' ;
2012-02-27 22:26:22 +01:00
print $form -> select_company ( GETPOST ( 'socid' , 'int' ) ? GETPOST ( 'socid' , 'int' ) : ( $object -> socid ? $object -> socid :- 1 ), 'socid' , '' , 1 );
2011-03-26 19:34:41 +01:00
print '</td>' ;
print '</tr>' ;
}
// Civility
print '<tr><td>' . $langs -> trans ( " UserTitle " ) . '</td><td colspan="3">' ;
2011-10-22 15:55:08 +02:00
print $formcompany -> select_civility ( isset ( $_POST [ " civilite_id " ]) ? $_POST [ " civilite_id " ] : $object -> civilite_id );
2011-03-26 19:34:41 +01:00
print '</td></tr>' ;
2012-03-18 19:23:01 +01:00
print '<tr><td>' . $langs -> trans ( " PostOrFunction " ) . '</td><td colspan="3"><input name="poste" type="text" size="50" maxlength="80" value="' . ( isset ( $_POST [ " poste " ]) ? $_POST [ " poste " ] : $object -> poste ) . '"></td></tr>' ;
2011-03-26 19:34:41 +01:00
// Address
2012-09-28 14:56:47 +02:00
print '<tr><td>' . $langs -> trans ( " Address " );
2012-10-06 19:25:25 +02:00
print '</td><td colspan="2"><textarea class="flat" name="address" cols="70">' . ( isset ( $_POST [ " address " ]) ? $_POST [ " address " ] : $object -> address ) . '</textarea></td>' ;
$rowspan = 3 ;
if ( empty ( $conf -> global -> SOCIETE_DISABLE_STATE )) $rowspan ++ ;
print '<td valign="middle" align="center" rowspan="' . $rowspan . '">' ;
if ( $conf -> use_javascript_ajax ) print '<a href="#" id="copyaddressfromsoc">' . $langs -> trans ( 'CopyAddressFromSoc' ) . '</a>' ;
2012-10-08 20:47:10 +02:00
print '</td></tr>' ;
2011-03-26 19:34:41 +01:00
// Zip / Town
2013-12-02 20:30:15 +01:00
print '<tr><td>' . $langs -> trans ( " Zip " ) . ' / ' . $langs -> trans ( " Town " ) . '</td><td colspan="2" class="maxwidthonsmartphone">' ;
2012-06-27 23:46:25 +02:00
print $formcompany -> select_ziptown (( isset ( $_POST [ " zipcode " ]) ? $_POST [ " zipcode " ] : $object -> zip ), 'zipcode' , array ( 'town' , 'selectcountry_id' , 'state_id' ), 6 ) . ' ' ;
print $formcompany -> select_ziptown (( isset ( $_POST [ " town " ]) ? $_POST [ " town " ] : $object -> town ), 'town' , array ( 'zipcode' , 'selectcountry_id' , 'state_id' ));
2011-03-26 19:34:41 +01:00
print '</td></tr>' ;
// Country
2013-12-02 20:30:15 +01:00
print '<tr><td>' . $langs -> trans ( " Country " ) . '</td><td colspan="2" class="maxwidthonsmartphone">' ;
2011-12-29 18:07:41 +01:00
print $form -> select_country ( isset ( $_POST [ " country_id " ]) ? $_POST [ " country_id " ] : $object -> country_id , 'country_id' );
2011-03-26 19:34:41 +01:00
if ( $user -> admin ) print info_admin ( $langs -> trans ( " YouCanChangeValuesForThisListFromDictionnarySetup " ), 1 );
print '</td></tr>' ;
// State
if ( empty ( $conf -> global -> SOCIETE_DISABLE_STATE ))
{
2013-12-02 20:30:15 +01:00
print '<tr><td>' . $langs -> trans ( 'State' ) . '</td><td colspan="2" class="maxwidthonsmartphone">' ;
2012-06-27 23:46:25 +02:00
print $formcompany -> select_state ( $object -> state_id , isset ( $_POST [ " country_id " ]) ? $_POST [ " country_id " ] : $object -> country_id , 'state_id' );
2011-03-26 19:34:41 +01:00
print '</td></tr>' ;
}
// Phone
print '<tr><td>' . $langs -> trans ( " PhonePro " ) . '</td><td><input name="phone_pro" type="text" size="18" maxlength="80" value="' . ( isset ( $_POST [ " phone_pro " ]) ? $_POST [ " phone_pro " ] : $object -> phone_pro ) . '"></td>' ;
print '<td>' . $langs -> trans ( " PhonePerso " ) . '</td><td><input name="phone_perso" type="text" size="18" maxlength="80" value="' . ( isset ( $_POST [ " phone_perso " ]) ? $_POST [ " phone_perso " ] : $object -> phone_perso ) . '"></td></tr>' ;
print '<tr><td>' . $langs -> trans ( " PhoneMobile " ) . '</td><td><input name="phone_mobile" type="text" size="18" maxlength="80" value="' . ( isset ( $_POST [ " phone_mobile " ]) ? $_POST [ " phone_mobile " ] : $object -> phone_mobile ) . '"></td>' ;
print '<td>' . $langs -> trans ( " Fax " ) . '</td><td><input name="fax" type="text" size="18" maxlength="80" value="' . ( isset ( $_POST [ " fax " ]) ? $_POST [ " fax " ] : $object -> fax ) . '"></td></tr>' ;
// EMail
print '<tr><td>' . $langs -> trans ( " EMail " ) . '</td><td><input name="email" type="text" size="40" maxlength="80" value="' . ( isset ( $_POST [ " email " ]) ? $_POST [ " email " ] : $object -> email ) . '"></td>' ;
2012-08-26 20:28:19 +02:00
if ( ! empty ( $conf -> mailing -> enabled ))
2011-03-26 19:34:41 +01:00
{
$langs -> load ( " mails " );
2013-07-19 14:23:42 +02:00
print '<td class="nowrap">' . $langs -> trans ( " NbOfEMailingsReceived " ) . '</td>' ;
2011-03-26 19:34:41 +01:00
print '<td>' . $object -> getNbOfEMailings () . '</td>' ;
}
else
2012-08-26 20:28:19 +02:00
{
print '<td colspan="2"> </td>' ;
2011-03-26 19:34:41 +01:00
}
print '</tr>' ;
// Jabberid
2013-11-04 21:41:36 +01:00
print '<tr><td>' . $langs -> trans ( " Jabberid " ) . '</td><td><input name="jabberid" type="text" size="40" maxlength="80" value="' . ( isset ( $_POST [ " jabberid " ]) ? $_POST [ " jabberid " ] : $object -> jabberid ) . '"></td>' ;
2012-08-26 20:28:19 +02:00
if ( ! empty ( $conf -> mailing -> enabled ))
{
print '<td>' . $langs -> trans ( " No_Email " ) . '</td><td>' . $form -> selectyesno ( 'no_email' ,( isset ( $_POST [ " no_email " ]) ? $_POST [ " no_email " ] : $object -> no_email ), 1 ) . '</td>' ;
}
else
{
print '<td colspan="2"> </td>' ;
}
2012-09-07 17:23:16 +02:00
print '</tr>' ;
2013-12-02 20:30:15 +01:00
2013-11-04 21:41:36 +01:00
// Skype
if ( ! empty ( $conf -> skype -> enabled ))
{
print '<tr><td>' . $langs -> trans ( " Skype " ) . '</td><td><input name="skype" type="text" size="40" maxlength="80" value="' . ( isset ( $_POST [ " skype " ]) ? $_POST [ " skype " ] : $object -> skype ) . '"></td></tr>' ;
}
2013-12-02 20:30:15 +01:00
2011-03-26 19:34:41 +01:00
// Visibility
print '<tr><td>' . $langs -> trans ( " ContactVisibility " ) . '</td><td colspan="3">' ;
$selectarray = array ( '0' => $langs -> trans ( " ContactPublic " ), '1' => $langs -> trans ( " ContactPrivate " ));
print $form -> selectarray ( 'priv' , $selectarray , $object -> priv , 0 );
print '</td></tr>' ;
2014-01-27 10:36:59 +01:00
// Note Public
print '<tr><td valign="top">' . $langs -> trans ( " NotePublic " ) . '</td><td colspan="3">' ;
$doleditor = new DolEditor ( 'note_public' , $object -> note_public , '' , 80 , 'dolibarr_notes' , 'In' , 0 , false , true , ROWS_3 , 70 );
print $doleditor -> Create ( 1 );
print '</td></tr>' ;
// Note Private
print '<tr><td valign="top">' . $langs -> trans ( " NotePrivate " ) . '</td><td colspan="3">' ;
$doleditor = new DolEditor ( 'note_private' , $object -> note_private , '' , 80 , 'dolibarr_notes' , 'In' , 0 , false , true , ROWS_3 , 70 );
print $doleditor -> Create ( 1 );
print '</td></tr>' ;
2013-09-25 19:58:22 +02:00
2013-07-10 12:28:28 +02:00
// Statut
print '<tr><td valign="top">' . $langs -> trans ( " Status " ) . '</td>' ;
print '<td>' ;
2013-09-10 13:45:39 +02:00
print $object -> getLibStatut ( 5 );
2013-07-10 12:28:28 +02:00
print '</td></tr>' ;
2012-09-19 17:53:09 +02:00
// Other attributes
$parameters = array ( 'colspan' => ' colspan="3"' );
$reshook = $hookmanager -> executeHooks ( 'formObjectOptions' , $parameters , $object , $action ); // Note that $action and $object may have been modified by hook
if ( empty ( $reshook ) && ! empty ( $extrafields -> attribute_label ))
{
2013-04-01 19:43:26 +02:00
print $object -> showOptionals ( $extrafields , 'edit' );
2012-09-19 17:53:09 +02:00
}
2011-03-26 19:34:41 +01:00
$object -> load_ref_elements ();
2012-09-15 10:01:35 +02:00
if ( ! empty ( $conf -> commande -> enabled ))
2011-03-26 19:34:41 +01:00
{
print '<tr><td>' . $langs -> trans ( " ContactForOrders " ) . '</td><td colspan="3">' ;
print $object -> ref_commande ? $object -> ref_commande : $langs -> trans ( " NoContactForAnyOrder " );
print '</td></tr>' ;
}
2012-09-15 10:01:35 +02:00
if ( ! empty ( $conf -> propal -> enabled ))
2011-03-26 19:34:41 +01:00
{
print '<tr><td>' . $langs -> trans ( " ContactForProposals " ) . '</td><td colspan="3">' ;
print $object -> ref_propal ? $object -> ref_propal : $langs -> trans ( " NoContactForAnyProposal " );
print '</td></tr>' ;
}
2012-09-15 10:01:35 +02:00
if ( ! empty ( $conf -> contrat -> enabled ))
2011-03-26 19:34:41 +01:00
{
print '<tr><td>' . $langs -> trans ( " ContactForContracts " ) . '</td><td colspan="3">' ;
print $object -> ref_contrat ? $object -> ref_contrat : $langs -> trans ( " NoContactForAnyContract " );
print '</td></tr>' ;
}
2012-09-15 10:01:35 +02:00
if ( ! empty ( $conf -> facture -> enabled ))
2011-03-26 19:34:41 +01:00
{
print '<tr><td>' . $langs -> trans ( " ContactForInvoices " ) . '</td><td colspan="3">' ;
print $object -> ref_facturation ? $object -> ref_facturation : $langs -> trans ( " NoContactForAnyInvoice " );
print '</td></tr>' ;
}
// Login Dolibarr
print '<tr><td>' . $langs -> trans ( " DolibarrLogin " ) . '</td><td colspan="3">' ;
if ( $object -> user_id )
{
$dolibarr_user = new User ( $db );
$result = $dolibarr_user -> fetch ( $object -> user_id );
print $dolibarr_user -> getLoginUrl ( 1 );
}
else print $langs -> trans ( " NoDolibarrAccess " );
print '</td></tr>' ;
2010-11-19 22:24:48 +01:00
print '</table><br>' ;
print '<center>' ;
2011-03-26 19:34:41 +01:00
print '<input type="submit" class="button" name="save" value="' . $langs -> trans ( " Save " ) . '">' ;
print ' ' ;
print '<input type="submit" class="button" name="cancel" value="' . $langs -> trans ( " Cancel " ) . '">' ;
print '</center>' ;
print " </form> " ;
}
}
2012-05-12 12:32:24 +02:00
if ( ! empty ( $id ) && $action != 'edit' && $action != 'create' )
2011-03-26 19:34:41 +01:00
{
$objsoc = new Societe ( $db );
/*
* Fiche en mode visualisation
*/
2011-06-01 18:23:33 +02:00
dol_htmloutput_errors ( $error , $errors );
2011-03-26 19:34:41 +01:00
2011-09-24 17:57:52 +02:00
if ( $action == 'create_user' )
2011-03-26 19:34:41 +01:00
{
2013-02-23 16:08:35 +01:00
// Full firstname and lastname separated with a dot : firstname.lastname
2012-08-23 02:04:35 +02:00
include_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php' ;
2013-02-23 16:08:35 +01:00
$login = dol_buildlogin ( $object -> lastname , $object -> firstname );
2011-01-10 01:04:27 +01:00
2011-01-29 18:41:26 +01:00
$generated_password = '' ;
2011-01-29 19:23:01 +01:00
if ( ! $ldap_sid ) // TODO ldap_sid ?
2011-01-29 18:41:26 +01:00
{
2012-08-22 23:11:24 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/lib/security2.lib.php' ;
2012-02-12 17:41:28 +01:00
$generated_password = getRandomPassword ( '' );
2011-01-29 18:41:26 +01:00
}
$password = $generated_password ;
2011-03-26 19:34:41 +01:00
// Create a form array
$formquestion = array (
array ( 'label' => $langs -> trans ( " LoginToCreate " ), 'type' => 'text' , 'name' => 'login' , 'value' => $login ),
2011-05-25 14:05:18 +02:00
array ( 'label' => $langs -> trans ( " Password " ), 'type' => 'text' , 'name' => 'password' , 'value' => $password ),
//array('label' => $form->textwithpicto($langs->trans("Type"),$langs->trans("InternalExternalDesc")), 'type' => 'select', 'name' => 'intern', 'default' => 1, 'values' => array(0=>$langs->trans('Internal'),1=>$langs->trans('External')))
);
$text = $langs -> trans ( " ConfirmCreateContact " ) . '<br>' ;
2012-09-15 10:01:35 +02:00
if ( ! empty ( $conf -> societe -> enabled ))
2011-05-25 14:05:18 +02:00
{
if ( $object -> socid > 0 ) $text .= $langs -> trans ( " UserWillBeExternalUser " );
else $text .= $langs -> trans ( " UserWillBeInternalUser " );
}
2013-09-06 12:10:09 +02:00
print $form -> formconfirm ( $_SERVER [ " PHP_SELF " ] . " ?id= " . $object -> id , $langs -> trans ( " CreateDolibarrLogin " ), $text , " confirm_create_user " , $formquestion , 'yes' );
2013-09-25 19:58:22 +02:00
2011-03-26 19:34:41 +01:00
}
2010-11-19 22:24:48 +01:00
2011-03-26 19:34:41 +01:00
print '<table class="border" width="100%">' ;
2010-11-19 22:24:48 +01:00
2012-07-28 21:54:36 +02:00
$linkback = '<a href="' . DOL_URL_ROOT . '/contact/list.php">' . $langs -> trans ( " BackToList " ) . '</a>' ;
2011-03-26 19:34:41 +01:00
// Ref
print '<tr><td width="20%">' . $langs -> trans ( " Ref " ) . '</td><td colspan="3">' ;
2012-07-28 21:54:36 +02:00
print $form -> showrefnav ( $object , 'id' , $linkback );
2011-03-26 19:34:41 +01:00
print '</td></tr>' ;
2010-11-19 22:24:48 +01:00
2011-03-26 19:34:41 +01:00
// Name
2012-03-19 10:17:24 +01:00
print '<tr><td width="20%">' . $langs -> trans ( " Lastname " ) . ' / ' . $langs -> trans ( " Label " ) . '</td><td width="30%">' . $object -> lastname . '</td>' ;
2011-03-26 19:34:41 +01:00
print '<td width="20%">' . $langs -> trans ( " Firstname " ) . '</td><td width="30%">' . $object -> firstname . '</td></tr>' ;
2010-11-19 22:24:48 +01:00
2011-03-26 19:34:41 +01:00
// Company
2011-02-13 13:55:40 +01:00
if ( empty ( $conf -> global -> SOCIETE_DISABLE_CONTACTS ))
{
print '<tr><td>' . $langs -> trans ( " Company " ) . '</td><td colspan="3">' ;
2011-03-26 19:34:41 +01:00
if ( $object -> socid > 0 )
{
$objsoc -> fetch ( $object -> socid );
print $objsoc -> getNomUrl ( 1 );
}
else
{
print $langs -> trans ( " ContactNotLinkedToCompany " );
}
print '</td></tr>' ;
}
// Civility
print '<tr><td width="15%">' . $langs -> trans ( " UserTitle " ) . '</td><td colspan="3">' ;
print $object -> getCivilityLabel ();
print '</td></tr>' ;
2011-05-25 14:05:18 +02:00
// Role
2012-03-18 19:23:01 +01:00
print '<tr><td>' . $langs -> trans ( " PostOrFunction " ) . '</td><td colspan="3">' . $object -> poste . '</td>' ;
2011-03-26 19:34:41 +01:00
// Address
2011-05-12 21:01:14 +02:00
print '<tr><td>' . $langs -> trans ( " Address " ) . '</td><td colspan="3">' ;
2011-05-25 15:03:04 +02:00
dol_print_address ( $object -> address , 'gmap' , 'contact' , $object -> id );
2011-05-12 21:01:14 +02:00
print '</td></tr>' ;
2011-03-26 19:34:41 +01:00
2013-02-24 17:08:52 +01:00
// Zip/Town
2011-03-26 19:34:41 +01:00
print '<tr><td>' . $langs -> trans ( " Zip " ) . ' / ' . $langs -> trans ( " Town " ) . '</td><td colspan="3">' ;
2013-02-24 17:08:52 +01:00
print $object -> zip ;
if ( $object -> zip ) print ' ' ;
2013-02-22 16:53:50 +01:00
print $object -> town . '</td></tr>' ;
2011-03-26 19:34:41 +01:00
// Country
print '<tr><td>' . $langs -> trans ( " Country " ) . '</td><td colspan="3">' ;
2011-12-29 18:07:41 +01:00
$img = picto_from_langcode ( $object -> country_code );
2011-03-26 19:34:41 +01:00
if ( $img ) print $img . ' ' ;
2013-03-08 02:49:42 +01:00
print $object -> country ;
2011-03-26 19:34:41 +01:00
print '</td></tr>' ;
// State
if ( empty ( $conf -> global -> SOCIETE_DISABLE_STATE ))
{
2012-06-27 23:46:25 +02:00
print '<tr><td>' . $langs -> trans ( 'State' ) . '</td><td colspan="3">' . $object -> state . '</td>' ;
2011-03-26 19:34:41 +01:00
}
// Phone
2011-12-29 18:07:41 +01:00
print '<tr><td>' . $langs -> trans ( " PhonePro " ) . '</td><td>' . dol_print_phone ( $object -> phone_pro , $object -> country_code , $object -> id , $object -> socid , 'AC_TEL' ) . '</td>' ;
print '<td>' . $langs -> trans ( " PhonePerso " ) . '</td><td>' . dol_print_phone ( $object -> phone_perso , $object -> country_code , $object -> id , $object -> socid , 'AC_TEL' ) . '</td></tr>' ;
2011-03-26 19:34:41 +01:00
2011-12-29 18:07:41 +01:00
print '<tr><td>' . $langs -> trans ( " PhoneMobile " ) . '</td><td>' . dol_print_phone ( $object -> phone_mobile , $object -> country_code , $object -> id , $object -> socid , 'AC_TEL' ) . '</td>' ;
print '<td>' . $langs -> trans ( " Fax " ) . '</td><td>' . dol_print_phone ( $object -> fax , $object -> country_code , $object -> id , $object -> socid , 'AC_FAX' ) . '</td></tr>' ;
2011-03-26 19:34:41 +01:00
// Email
print '<tr><td>' . $langs -> trans ( " EMail " ) . '</td><td>' . dol_print_email ( $object -> email , $object -> id , $object -> socid , 'AC_EMAIL' ) . '</td>' ;
2012-09-15 10:01:35 +02:00
if ( ! empty ( $conf -> mailing -> enabled ))
2011-03-26 19:34:41 +01:00
{
$langs -> load ( " mails " );
2013-07-19 14:23:42 +02:00
print '<td class="nowrap">' . $langs -> trans ( " NbOfEMailingsReceived " ) . '</td>' ;
2011-03-26 19:34:41 +01:00
print '<td><a href="' . DOL_URL_ROOT . '/comm/mailing/liste.php?filteremail=' . urlencode ( $object -> email ) . '">' . $object -> getNbOfEMailings () . '</a></td>' ;
}
else
{
print '<td colspan="2"> </td>' ;
}
print '</tr>' ;
2012-08-22 22:59:10 +02:00
// Instant message and no email
print '<tr><td>' . $langs -> trans ( " IM " ) . '</td><td>' . $object -> jabberid . '</td>' ;
2012-08-26 20:28:19 +02:00
if ( ! empty ( $conf -> mailing -> enabled ))
{
print '<td>' . $langs -> trans ( " No_Email " ) . '</td><td>' . yn ( $object -> no_email ) . '</td>' ;
}
else
{
2012-09-07 17:23:16 +02:00
print '<td colspan="2"> </td>' ;
2012-08-26 20:28:19 +02:00
}
print '</tr>' ;
2013-12-02 20:30:15 +01:00
2013-11-04 21:41:36 +01:00
// Skype
if ( ! empty ( $conf -> skype -> enabled ))
{
print '<tr><td>' . $langs -> trans ( " Skype " ) . '</td><td colspan="3">' . dol_print_skype ( $object -> skype , 0 , $object -> fk_soc , 1 ) . '</td></tr>' ;
}
2011-03-26 19:34:41 +01:00
print '<tr><td>' . $langs -> trans ( " ContactVisibility " ) . '</td><td colspan="3">' ;
print $object -> LibPubPriv ( $object -> priv );
print '</td></tr>' ;
2014-01-27 10:36:59 +01:00
// Note Public
print '<tr><td valign="top">' . $langs -> trans ( " NotePublic " ) . '</td><td colspan="3">' ;
print nl2br ( $object -> note_public );
2013-07-10 12:28:28 +02:00
print '</td></tr>' ;
2014-01-27 10:36:59 +01:00
// Note Private
print '<tr><td valign="top">' . $langs -> trans ( " NotePrivate " ) . '</td><td colspan="3">' ;
print nl2br ( $object -> note_private );
2013-09-25 19:58:22 +02:00
2013-09-10 13:45:39 +02:00
// Statut
2013-07-10 12:28:28 +02:00
print '<tr><td valign="top">' . $langs -> trans ( " Status " ) . '</td>' ;
print '<td>' ;
2013-09-10 13:45:39 +02:00
print $object -> getLibStatut ( 5 );
2013-07-10 12:28:28 +02:00
print '</td>' ;
print '</tr>' . " \n " ;
2012-09-19 17:53:09 +02:00
// Other attributes
$parameters = array ( 'socid' => $socid , 'colspan' => ' colspan="3"' );
$reshook = $hookmanager -> executeHooks ( 'formObjectOptions' , $parameters , $object , $action ); // Note that $action and $object may have been modified by hook
2013-08-01 16:02:25 +02:00
print $hookmanager -> resPrint ;
2012-09-19 17:53:09 +02:00
if ( empty ( $reshook ) && ! empty ( $extrafields -> attribute_label ))
{
2013-04-01 19:43:26 +02:00
print $object -> showOptionals ( $extrafields );
2012-09-19 17:53:09 +02:00
}
2011-03-26 19:34:41 +01:00
$object -> load_ref_elements ();
2012-09-15 10:01:35 +02:00
if ( ! empty ( $conf -> commande -> enabled ))
2011-03-26 19:34:41 +01:00
{
print '<tr><td>' . $langs -> trans ( " ContactForOrders " ) . '</td><td colspan="3">' ;
print $object -> ref_commande ? $object -> ref_commande : $langs -> trans ( " NoContactForAnyOrder " );
print '</td></tr>' ;
2011-02-13 13:55:40 +01:00
}
2010-11-19 22:24:48 +01:00
2012-09-15 10:01:35 +02:00
if ( ! empty ( $conf -> propal -> enabled ))
2011-03-26 19:34:41 +01:00
{
print '<tr><td>' . $langs -> trans ( " ContactForProposals " ) . '</td><td colspan="3">' ;
print $object -> ref_propal ? $object -> ref_propal : $langs -> trans ( " NoContactForAnyProposal " );
print '</td></tr>' ;
}
2012-09-15 10:01:35 +02:00
if ( ! empty ( $conf -> contrat -> enabled ))
2011-03-26 19:34:41 +01:00
{
print '<tr><td>' . $langs -> trans ( " ContactForContracts " ) . '</td><td colspan="3">' ;
print $object -> ref_contrat ? $object -> ref_contrat : $langs -> trans ( " NoContactForAnyContract " );
print '</td></tr>' ;
}
2012-09-15 10:01:35 +02:00
if ( ! empty ( $conf -> facture -> enabled ))
2011-03-26 19:34:41 +01:00
{
print '<tr><td>' . $langs -> trans ( " ContactForInvoices " ) . '</td><td colspan="3">' ;
print $object -> ref_facturation ? $object -> ref_facturation : $langs -> trans ( " NoContactForAnyInvoice " );
print '</td></tr>' ;
}
print '<tr><td>' . $langs -> trans ( " DolibarrLogin " ) . '</td><td colspan="3">' ;
if ( $object -> user_id )
{
$dolibarr_user = new User ( $db );
$result = $dolibarr_user -> fetch ( $object -> user_id );
print $dolibarr_user -> getLoginUrl ( 1 );
}
else print $langs -> trans ( " NoDolibarrAccess " );
print '</td></tr>' ;
print " </table> " ;
print " </div> " ;
// Barre d'actions
if ( ! $user -> societe_id )
{
print '<div class="tabsAction">' ;
if ( $user -> rights -> societe -> contact -> creer )
{
print '<a class="butAction" href="fiche.php?id=' . $object -> id . '&action=edit">' . $langs -> trans ( 'Modify' ) . '</a>' ;
}
if ( ! $object -> user_id && $user -> rights -> user -> user -> creer )
{
print '<a class="butAction" href="fiche.php?id=' . $object -> id . '&action=create_user">' . $langs -> trans ( " CreateDolibarrLogin " ) . '</a>' ;
}
if ( $user -> rights -> societe -> contact -> supprimer )
{
print '<a class="butActionDelete" href="fiche.php?id=' . $object -> id . '&action=delete">' . $langs -> trans ( 'Delete' ) . '</a>' ;
}
2013-07-10 12:28:28 +02:00
// Activer
2013-08-22 10:06:57 +02:00
if ( $object -> statut == 0 && $user -> rights -> societe -> contact -> creer )
2013-07-10 12:28:28 +02:00
{
print '<a class="butAction" href="' . $_SERVER [ 'PHP_SELF' ] . '?id=' . $object -> id . '&action=enable">' . $langs -> trans ( " Reactivate " ) . '</a>' ;
}
// Desactiver
2013-08-22 10:06:57 +02:00
if ( $object -> statut == 1 && $user -> rights -> societe -> contact -> creer )
2013-07-10 12:28:28 +02:00
{
print '<a class="butActionDelete" href="' . $_SERVER [ 'PHP_SELF' ] . '?action=disable&id=' . $object -> id . '">' . $langs -> trans ( " DisableUser " ) . '</a>' ;
}
2011-03-26 19:34:41 +01:00
print " </div><br> " ;
}
2012-02-13 01:43:35 +01:00
print load_fiche_titre ( $langs -> trans ( " TasksHistoryForThisContact " ), '' , '' );
2011-03-26 19:34:41 +01:00
print show_actions_todo ( $conf , $langs , $db , $objsoc , $object );
print show_actions_done ( $conf , $langs , $db , $objsoc , $object );
}
2006-02-25 00:16:35 +01:00
}
2011-08-27 16:24:16 +02:00
llxFooter ();
2012-02-13 01:43:35 +01:00
$db -> close ();
2006-02-25 00:16:35 +01:00
?>