diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 6935a41ac56..5134d127e4a 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005 Simon TOSSER * Copyright (C) 2005-2007 Regis Houssin * @@ -63,7 +63,7 @@ if ($_POST["action"] == 'add_action') { $result=$contact->fetch($_POST["contactid"]); } - + if ($_POST['cancel']) { $backtopage=''; @@ -74,7 +74,7 @@ if ($_POST["action"] == 'add_action') else $backtopage=DOL_URL_ROOT.'/comm/action/index.php'; } header("Location: ".$backtopage); - exit; + exit; } // Clean parameters @@ -111,14 +111,14 @@ if ($_POST["action"] == 'add_action') $_POST["a2day"], $_POST["a2year"]); */ - + if (! $datep2 && $_POST["percentage"] == 100) { $error=1; $_GET["action"] = 'create'; $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->trans("DateEnd")).'
'; } - + // Initialisation objet cactioncomm if (! $_POST["actioncode"]) { @@ -126,11 +126,11 @@ if ($_POST["action"] == 'add_action') $_GET["action"] = 'create'; $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->trans("Type")).'
'; } - else + else { $result=$cactioncomm->fetch($_POST["actioncode"]); } - + // Initialisation objet actioncomm $actioncomm->type_id = $cactioncomm->id; $actioncomm->type_code = $cactioncomm->code; @@ -187,7 +187,7 @@ if ($_POST["action"] == 'add_action') $userdone->fetch(); } $actioncomm->userdone = $userdone; - + $actioncomm->note = trim($_POST["note"]); if (isset($_POST["contactid"])) $actioncomm->contact = $contact; if (isset($_REQUEST["socid"]) && $_REQUEST["socid"] > 0) @@ -204,17 +204,17 @@ if ($_POST["action"] == 'add_action') // Check parameters if ($actioncomm->type_code == 'AC_RDV' && ($datep == '' || $datep2 == '')) { - $error=1; + $error=1; $_GET["action"] = 'create'; $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DateEnd")).'
'; } if ($datea && $_POST["percentage"] == 0) { - $error=1; + $error=1; $_GET["action"] = 'create'; $mesg='
'.$langs->trans("ErrorStatusCantBeZeroIfStarted").'
'; } - + if (! $_POST["apyear"] && ! $_POST["adyear"]) { $error=1; @@ -316,7 +316,7 @@ if ($_POST["action"] == 'update') $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]); - + $datep2=dolibarr_mktime($_POST["p2hour"], $_POST["p2min"], 0, @@ -336,7 +336,7 @@ if ($_POST["action"] == 'update') $_POST["a2day"], $_POST["a2year"]); */ - + //print $_POST["apmonth"].",".$_POST["apday"].",".$_POST["apyear"].",".$_POST["aphour"].",".$_POST["apmin"]."
\n"; //print $actioncomm->datep; //print 'dddd'.$datep; @@ -377,7 +377,7 @@ if ($_POST["action"] == 'update') $db->begin(); $result=$actioncomm->update($user); - + if ($result > 0) { $db->commit(); @@ -385,7 +385,7 @@ if ($_POST["action"] == 'update') else { $db->rollback(); - } + } } } @@ -443,9 +443,9 @@ if ($_GET["action"] == 'create') if ($mesg) print $mesg.'
'; else print "
"; - + print ''; - + // Type d'action actifs print ''; - + // Location print ''; - + // Societe, contact print ''; // Si la societe est imposee, on propose ces contacts - + // If company is forced propose contacts if ($_REQUEST["socid"] > 0 && !($_REQUEST['contactid'] > 0)) { @@ -494,7 +494,7 @@ if ($_GET["action"] == 'create') print '
'.$langs->trans("Type").'*'; if ($_GET["actioncode"]) @@ -462,10 +462,10 @@ if ($_GET["action"] == 'create') // Title print '
'.$langs->trans("Title").'
'.$langs->trans("Location").'
'.$langs->trans("ActionOnCompany").''; if ($_REQUEST["socid"] > 0) @@ -482,7 +482,7 @@ if ($_GET["action"] == 'create') print '
'; print '
'; print ''; - + // Affecte a print '
'.$langs->trans("ActionAffectedTo").''; // $html->select_users($_REQUEST["affectedto"]?$_REQUEST["affectedto"]:$actioncomm->usertodo,'affectedto',1); @@ -509,8 +509,8 @@ if ($_GET["action"] == 'create') print '
'; print '
'; print ''; - - if (! empty($_GET["datep"]) && eregi('^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$',$_GET["datep"],$reg)) + + if (! empty($_GET["datep"]) && eregi('^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$',$_GET["datep"],$reg)) { $actioncomm->datep=dolibarr_mktime(0,0,0,$reg[2],$reg[3],$reg[1]); } @@ -546,7 +546,7 @@ if ($_GET["action"] == 'create') // Priority print ''; add_row_for_calendar_link(); @@ -557,12 +557,12 @@ if ($_GET["action"] == 'create') { // Editeur wysiwyg require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('note','',280,'dolibarr_notes','In',true); + $doleditor=new DolEditor('note',($_POST["note"]?$_POST["note"]:$actioncomm->note),280,'dolibarr_notes','In',true); $doleditor->Create(); } else { - print ''; + print ''; } print ''; @@ -595,7 +595,7 @@ if ($_GET["id"]) $act = new ActionComm($db); $result=$act->fetch($_GET["id"]); if ($result < 0) dolibarr_print_error($db,$act->error); - + $societe = new Societe($db); if ($act->societe->id) { @@ -638,7 +638,7 @@ if ($_GET["id"]) $now=gmmktime(); $delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60; - + // Confirmation suppression action if ($_GET["action"] == 'delete') { @@ -658,16 +658,16 @@ if ($_GET["id"]) // Ref print ''; - + // Type print ''; - + // Title print ''; - + // Location print ''; - + // Company print ''; print ''; print ''; print '
'.$langs->trans("Priority").''; - print ''; + print 'priority).'" size="5">'; print '
'.$langs->trans("Ref").''.$act->id.'
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Title").'
'.$langs->trans("Location").'
'.$langs->trans("Company").''; @@ -675,7 +675,7 @@ if ($_GET["id"]) print ''.$langs->trans("Contact").''; - $html->select_array("contactid", $act->societe->contact_array(), $act->contact->id, 1); + $html->select_array("contactid", $act->societe->contact_array(), $act->contact->id, 1); print '

'; @@ -763,10 +763,10 @@ if ($_GET["id"]) // Title print ''; - + // Location print ''; - + // Societe - contact print ''; print ''; print ''; - + if (! $user->webcal_login) { print ''; - + if (! $user->phenix_login) { print '
'.$langs->trans("Title").''.$act->label.'
'.$langs->trans("Location").''.$act->location.'
'.$langs->trans("Company").''.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None")); if ($act->societe->id && $act->type_code == 'AC_TEL') @@ -775,7 +775,7 @@ if ($_GET["id"]) { print "
".dol_print_phone($act->societe->tel); } - } + } print '
'.$langs->trans("Contact").''; @@ -788,7 +788,7 @@ if ($_GET["id"]) { print "
".dol_print_phone($act->contact->phone_pro); } - } + } } else { @@ -894,9 +894,9 @@ function add_row_for_calendar_link() if ($conf->global->PHPWEBCALENDAR_SYNCRO != 'never') { $langs->load("other"); - + print '
'.$langs->trans("AddCalendarEntry","Webcalendar").''; @@ -920,15 +920,15 @@ function add_row_for_calendar_link() } } } - + if ($conf->phenix->enabled) { if ($conf->global->PHPPHENIX_SYNCRO != 'never') { $langs->load("other"); - + print '
'.$langs->trans("AddCalendarEntry","Phenix").'';