diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 92111cd9a2c..ea9c5ca8183 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1066,16 +1066,21 @@ if ($id) } } - print ''; - // Est-ce une entree du dictionnaire qui peut etre desactivee ? - $iserasable=1; // Oui par defaut - if (isset($obj->code) && ($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) $iserasable=0; - if (isset($obj->code) && $obj->code == 'RECEP') $iserasable=0; - if (isset($obj->code) && $obj->code == 'EF0') $iserasable=0; - if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) $iserasable=0; + // Est-ce une entree du dictionnaire qui peut etre desactivee ? + $iserasable=1; // Oui par defaut + if (isset($obj->code) && ($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) $iserasable=0; + if (isset($obj->code) && $obj->code == 'RECEP') $iserasable=0; + if (isset($obj->code) && $obj->code == 'EF0') $iserasable=0; + if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) $iserasable=0; + // Active + print ''; if ($iserasable) print ''.$actl[$obj->active].''; - else print $langs->trans("AlwaysActive"); + else + { + if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto')) && empty($obj->active)) print $langs->trans("Deprecated"); + else print $langs->trans("AlwaysActive"); + } print ""; // Modify link diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 760651a7f2b..d42ebf136e1 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -726,7 +726,10 @@ class ActionComm extends CommonObject if ($withpicto) { - $libelle.=(($this->type_code && $libelle!=$langs->trans("Action".$this->type_code) && $langs->trans("Action".$this->type_code)!="Action".$this->type_code)?' ('.$langs->trans("Action".$this->type_code).')':''); + if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) + { + $libelle.=(($this->type_code && $libelle!=$langs->trans("Action".$this->type_code) && $langs->trans("Action".$this->type_code)!="Action".$this->type_code)?' ('.$langs->trans("Action".$this->type_code).')':''); + } $result.=$lien.img_object($langs->trans("ShowAction").': '.$libelle,($overwritepicto?$overwritepicto:'action')).$lienfin; } if ($withpicto==1) $result.=' '; diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 50f9f077785..f1c8a4abbaf 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -100,9 +100,10 @@ class CActionComm * @param int $active 1 or 0 to filter on event state active or not ('' by default = no filter) * @param string $idorcode 'id' or 'code' * @param string $excludetype Type to exclude + * @param string $onlyautoornot Group list by auto events or not * @return array Array of all event types if OK, <0 if KO */ - function liste_array($active='',$idorcode='id',$excludetype='') + function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0) { global $langs,$conf; $langs->load("commercial"); @@ -110,7 +111,7 @@ class CActionComm $repid = array(); $repcode = array(); - $sql = "SELECT id, code, libelle, module"; + $sql = "SELECT id, code, libelle, module, type"; $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm"; if ($active != '') $sql.=" WHERE active=".$active; if (! empty($excludetype)) $sql.=($active != ''?" AND":" WHERE")." type <> '".$excludetype."'"; @@ -127,20 +128,31 @@ class CActionComm while ($i < $nump) { $obj = $this->db->fetch_object($resql); + $qualified=1; - if ($obj->module) + + // $obj->type can be system, systemauto, module, moduleauto, xxx, xxxauto + if ($qualified && $onlyautoornot && preg_match('/^system/',$obj->type) && ! preg_match('/^AC_OTH/',$obj->code)) $qualified=0; // We discard detailed system events. We keep only the 2 generic lines (AC_OTH and AC_OTHER) + + if ($qualified && $obj->module) { if ($obj->module == 'invoice' && ! $conf->facture->enabled) $qualified=0; if ($obj->module == 'order' && ! $conf->commande->enabled) $qualified=0; if ($obj->module == 'propal' && ! $conf->propal->enabled) $qualified=0; if ($obj->module == 'invoice_supplier' && ! $conf->fournisseur->enabled) $qualified=0; if ($obj->module == 'order_supplier' && ! $conf->fournisseur->enabled) $qualified=0; + if ($obj->module == 'shipping' && ! $conf->expedition->enabled) $qualified=0; } + if ($qualified) { - $transcode=$langs->trans("Action".$obj->code); - $repid[$obj->id] = ($transcode!="Action".$obj->code?$transcode:$langs->trans($obj->libelle)); - $repcode[$obj->code] = ($transcode!="Action".$obj->code?$transcode:$langs->trans($obj->libelle)); + $code=$obj->code; + if ($onlyautoornot && $code == 'AC_OTH') $code='AC_MANUAL'; + if ($onlyautoornot && $code == 'AC_OTH_AUTO') $code='AC_AUTO'; + $transcode=$langs->trans("Action".$code); + $repid[$obj->id] = ($transcode!="Action".$code?$transcode:$langs->trans($obj->libelle)); + $repcode[$obj->code] = ($transcode!="Action".$code?$transcode:$langs->trans($obj->libelle)); + if ($onlyautoornot && preg_match('/^module/',$obj->type) && $obj->module) $repcode[$obj->code].=' ('.$langs->trans("Module").': '.$obj->module.')'; } $i++; } diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 7fa1a71c5f3..db2e459f551 100755 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -127,7 +127,10 @@ if ($objectid > 0) print ''; // Type - print ''.$langs->trans("Type").''.$act->type.''; + if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) + { + print ''.$langs->trans("Type").''.$act->type.''; + } // Title print ''.$langs->trans("Title").''.$act->label.''; diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 53b0dae69ab..ee9ad394f05 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -107,6 +107,13 @@ if ($action == 'add_action') $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->trans("DateEnd")).'
'; } + if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && ! GETPOST('label')) + { + $error++; + $action = 'create'; + $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->trans("Title")).'
'; + } + // Initialisation objet cactioncomm if (! GETPOST('actioncode')) { @@ -122,13 +129,13 @@ if ($action == 'add_action') // Initialisation objet actioncomm $actioncomm->type_id = $cactioncomm->id; $actioncomm->type_code = $cactioncomm->code; - $actioncomm->priority = isset($_POST["priority"])?$_POST["priority"]:0; + $actioncomm->priority = GETPOST("priority")?GETPOST("priority"):0; $actioncomm->fulldayevent = (! empty($fulldayevent)?1:0); - $actioncomm->location = isset($_POST["location"])?$_POST["location"]:''; - $actioncomm->label = trim($_POST["label"]); - if (! $_POST["label"]) + $actioncomm->location = GETPOST("location"); + $actioncomm->label = trim(GETPOST('label')); + if (! GETPOST('label')) { - if ($_POST["actioncode"] == 'AC_RDV' && $contact->getFullName($langs)) + if (GETPOST('actioncode') == 'AC_RDV' && $contact->getFullName($langs)) { $actioncomm->label = $langs->transnoentitiesnoconv("TaskRDVWith",$contact->getFullName($langs)); } @@ -390,11 +397,13 @@ if ($action == 'create') $(".fulldaystartmin").removeAttr("disabled"); $(".fulldayendhour").removeAttr("disabled"); $(".fulldayendmin").removeAttr("disabled"); + $("#p2").removeAttr("disabled"); } else { $(".fulldaystarthour").attr("disabled","disabled").val("00"); $(".fulldaystartmin").attr("disabled","disabled").val("00"); $(".fulldayendhour").attr("disabled","disabled").val("23"); $(".fulldayendmin").attr("disabled","disabled").val("59"); + $("#p2").attr("disabled","disabled").val(""); } } setdatefields(); @@ -432,21 +441,25 @@ if ($action == 'create') print ''; // Type d'action actifs - print ''; } - else - { - $htmlactions->select_type_actions($actioncomm->type_code, "actioncode","systemauto"); - } - print ''; + else print ''; // Title - print ''; + print 'global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired"':'').'>'.$langs->trans("Title").''; // Full day print ''; @@ -678,10 +691,13 @@ if ($id) print ''; // Type - print ''; + if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) + { + print ''; + } // Title - print ''; + print 'global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired"':'').'>'.$langs->trans("Title").''; // Full day event print ''; @@ -797,7 +813,10 @@ if ($id) print ''; // Type - print ''; + if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) + { + print ''; + } // Title print ''; diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 09213bdd0b9..94f127f1b5a 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -194,9 +194,10 @@ class FormActions * @param string $selected Type pre-selectionne * @param string $htmlname Nom champ formulaire * @param string $excludetype Type to exclude + * @param string $onlyautoornot Group list by auto events or not * @return void */ - function select_type_actions($selected='',$htmlname='actioncode',$excludetype='') + function select_type_actions($selected='',$htmlname='actioncode',$excludetype='',$onlyautoornot=0) { global $langs,$user; @@ -205,12 +206,13 @@ class FormActions $caction=new CActionComm($this->db); $form=new Form($this->db); - $arraylist=$caction->liste_array(1, 'code', $excludetype); - array_unshift($arraylist,' '); // Add empty line at start - //asort($arraylist); + // Suggest a list with manual event or all auto events + $arraylist=$caction->liste_array(1, 'code', $excludetype, $onlyautoornot); + array_unshift($arraylist,' '); // Add empty line at start + //asort($arraylist); print $form->selectarray($htmlname, $arraylist, $selected); - if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); + if ($user->admin && empty($onlyautoornot)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); } } diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index dba22075612..ab1636aeabc 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -93,7 +93,10 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt print ''; } diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index b3e2633fe9d..e3bf26df606 100755 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -127,7 +127,7 @@ class InterfaceActionsAuto $langs->load("other"); $langs->load("agenda"); - $object->actiontypecode='AC_OTH'; + $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("NewCompanyToDolibarr",$object->nom); $object->actionmsg=$langs->transnoentities("NewCompanyToDolibarr",$object->nom); if ($object->prefix) $object->actionmsg.=" (".$object->prefix.")"; @@ -146,7 +146,7 @@ class InterfaceActionsAuto $langs->load("contracts"); $langs->load("agenda"); - $object->actiontypecode='AC_OTH'; + $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ContractValidatedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("ContractValidatedInDolibarr",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; @@ -160,7 +160,7 @@ class InterfaceActionsAuto $langs->load("propal"); $langs->load("agenda"); - $object->actiontypecode='AC_OTH'; + $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalValidatedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("PropalValidatedInDolibarr",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; @@ -174,7 +174,7 @@ class InterfaceActionsAuto $langs->load("propal"); $langs->load("agenda"); - $object->actiontypecode='AC_EMAIL'; + $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ProposalSentByEMail",$object->ref); if (empty($object->actionmsg)) { @@ -192,7 +192,7 @@ class InterfaceActionsAuto $langs->load("propal"); $langs->load("agenda"); - $object->actiontypecode='AC_OTH'; + $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalClosedSignedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("PropalClosedSignedInDolibarr",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; @@ -206,7 +206,7 @@ class InterfaceActionsAuto $langs->load("propal"); $langs->load("agenda"); - $object->actiontypecode='AC_OTH'; + $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalClosedRefusedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("PropalClosedRefusedInDolibarr",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; @@ -220,7 +220,7 @@ class InterfaceActionsAuto $langs->load("orders"); $langs->load("agenda"); - $object->actiontypecode='AC_OTH'; + $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; @@ -234,7 +234,7 @@ class InterfaceActionsAuto $langs->load("orders"); $langs->load("agenda"); - $object->actiontypecode='AC_EMAIL'; + $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderSentByEMail",$object->ref); if (empty($object->actionmsg)) { @@ -253,7 +253,7 @@ class InterfaceActionsAuto $langs->load("bills"); $langs->load("agenda"); - $object->actiontypecode='AC_OTH'; + $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; @@ -268,7 +268,7 @@ class InterfaceActionsAuto $langs->load("bills"); $langs->load("agenda"); - $object->actiontypecode='AC_EMAIL'; + $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceSentByEMail",$object->ref); if (empty($object->actionmsg)) { @@ -288,7 +288,7 @@ class InterfaceActionsAuto $langs->load("agenda"); // Values for this action can't be defined by caller. - $object->actiontypecode='AC_OTH'; + $object->actiontypecode='AC_OTH_AUTO'; $object->actionmsg2=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; @@ -303,7 +303,7 @@ class InterfaceActionsAuto $langs->load("bills"); $langs->load("agenda"); - $object->actiontypecode='AC_OTH'; + $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; @@ -318,7 +318,7 @@ class InterfaceActionsAuto $langs->load("interventions"); $langs->load("agenda"); - $object->actiontypecode='AC_OTH'; + $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionValidatedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("InterventionValidatedInDolibarr",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; @@ -335,7 +335,7 @@ class InterfaceActionsAuto $langs->load("interventions"); $langs->load("agenda"); - $object->actiontypecode='AC_EMAIL'; + $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionSentByEMail",$object->ref); $object->actionmsg=$langs->transnoentities("InterventionSentByEMail",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; @@ -351,7 +351,7 @@ class InterfaceActionsAuto $langs->load("sendings"); $langs->load("agenda"); - $object->actiontypecode='AC_SHIP'; + $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ShippingSentByEMail",$object->ref); if (empty($object->actionmsg)) { @@ -369,7 +369,7 @@ class InterfaceActionsAuto $langs->load("orders"); $langs->load("agenda"); - $object->actiontypecode='AC_OTH'; + $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; @@ -385,7 +385,7 @@ class InterfaceActionsAuto $langs->load("agenda"); $langs->load("orders"); - $object->actiontypecode='AC_EMAIL'; + $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("SupplierOrderSentByEMail",$object->ref); if (empty($object->actionmsg)) { @@ -404,7 +404,7 @@ class InterfaceActionsAuto $langs->load("bills"); $langs->load("agenda"); - $object->actiontypecode='AC_OTH'; + $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; @@ -420,7 +420,7 @@ class InterfaceActionsAuto $langs->load("agenda"); $langs->load("orders"); - $object->actiontypecode='AC_EMAIL'; + $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("SupplierInvoiceSentByEMail",$object->ref); if (empty($object->actionmsg)) { @@ -439,7 +439,7 @@ class InterfaceActionsAuto $langs->load("bills"); $langs->load("agenda"); - $object->actiontypecode='AC_OTH'; + $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; @@ -454,7 +454,7 @@ class InterfaceActionsAuto $langs->load("bills"); $langs->load("agenda"); - $object->actiontypecode='AC_OTH'; + $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; @@ -471,7 +471,7 @@ class InterfaceActionsAuto $langs->load("members"); $langs->load("agenda"); - $object->actiontypecode='AC_OTH'; + $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); @@ -488,7 +488,7 @@ class InterfaceActionsAuto $langs->load("members"); $langs->load("agenda"); - $object->actiontypecode='AC_OTH'; + $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); @@ -511,7 +511,7 @@ class InterfaceActionsAuto $langs->load("members"); $langs->load("agenda"); - $object->actiontypecode='AC_OTH'; + $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); @@ -528,7 +528,7 @@ class InterfaceActionsAuto $langs->load("members"); $langs->load("agenda"); - $object->actiontypecode='AC_OTH'; + $object->actiontypecode='AC_OTH_AUTO'; if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); diff --git a/htdocs/install/mysql/data/llx_c_actioncomm.sql b/htdocs/install/mysql/data/llx_c_actioncomm.sql index 618e7ff6224..55bba83dca4 100644 --- a/htdocs/install/mysql/data/llx_c_actioncomm.sql +++ b/htdocs/install/mysql/data/llx_c_actioncomm.sql @@ -30,15 +30,16 @@ -- Types action comm -- -delete from llx_c_actioncomm where id in (1,2,3,4,5,8,9,10,30,31,50); -insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 1, 'AC_TEL', 'system', 'Phone call' ,NULL, 2); -insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 2, 'AC_FAX', 'system', 'Send Fax' ,NULL, 3); -insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 3, 'AC_PROP', 'systemauto', 'Send commercial proposal by email' ,'propal', 10); -insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 4, 'AC_EMAIL', 'system', 'Send Email' ,NULL, 4); -insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 5, 'AC_RDV', 'system', 'Rendez-vous' ,NULL, 1); -insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 8, 'AC_COM', 'systemauto', 'Send customer order by email' ,'order', 8); -insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 9, 'AC_FAC', 'systemauto', 'Send customer invoice by email' ,'invoice', 6); -insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 10, 'AC_SHIP', 'systemauto', 'Send shipping by email' ,'shipping', 11); -insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 30, 'AC_SUP_ORD', 'systemauto', 'Send supplier order by email' ,'order_supplier', 9); -insert into llx_c_actioncomm (id, code, type, libelle, module, position) values (31, 'AC_SUP_INV', 'systemauto', 'Send supplier invoice by email' ,'invoice_supplier', 7); -insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 50, 'AC_OTH', 'system', 'Other' ,NULL, 5); +delete from llx_c_actioncomm where id in (1,2,3,4,5,8,9,10,30,31,40,50); +insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 1, 'AC_TEL', 'system', 'Phone call' ,NULL, 1, 2); +insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 2, 'AC_FAX', 'system', 'Send Fax' ,NULL, 1, 3); +insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 3, 'AC_PROP', 'systemauto', 'Send commercial proposal by email' ,'propal',0, 10); +insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 4, 'AC_EMAIL', 'system', 'Send Email' ,NULL, 1, 4); +insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 5, 'AC_RDV', 'system', 'Rendez-vous' ,NULL, ,1 1); +insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 8, 'AC_COM', 'systemauto', 'Send customer order by email' ,'order', 0, 8); +insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 9, 'AC_FAC', 'systemauto', 'Send customer invoice by email' ,'invoice',0, 6); +insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 10, 'AC_SHIP', 'systemauto', 'Send shipping by email' ,'shipping',0, 11); +insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 30, 'AC_SUP_ORD', 'systemauto', 'Send supplier order by email' ,'order_supplier',0, 9); +insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 31, 'AC_SUP_INV', 'systemauto', 'Send supplier invoice by email' ,'invoice_supplier',0, 7); +insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 40, 'AC_OTH_AUTO','systemauto', 'Other (automatically inserted events)' ,NULL, 1, 20); +insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 50, 'AC_OTH', 'system', 'Other (manually inserted events)' ,NULL, 1, 5); diff --git a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql index d0c921a2584..b05d2c9232f 100755 --- a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql +++ b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql @@ -805,6 +805,12 @@ ALTER TABLE llx_c_effectif DROP INDEX code, ADD UNIQUE uk_c_effectif (code); ALTER TABLE llx_c_paiement DROP INDEX code, ADD UNIQUE uk_c_paiement (code); +delete from llx_c_actioncomm where id = 40; +INSERT INTO llx_c_actioncomm (id, code, type, libelle, module, position) values ( 40, 'AC_OTH_AUTO','systemauto', 'Other (automatically inserted events)' ,NULL, 20); +UPDATE llx_c_actioncomm SET libelle = 'Other (manually inserted events)' WHERE code = 'AC_OTH'; +UPDATE llx_c_actioncomm SET active = 0 WHERE code in ('AC_PROP', 'AC_COM', 'AC_FAC', 'AC_SHIP', 'AC_SUP_ORD', 'AC_SUP_INV'); + + -- Update dictionnary of table llx_c_paper_format DELETE FROM llx_c_paper_format; diff --git a/htdocs/langs/en_US/commercial.lang b/htdocs/langs/en_US/commercial.lang index 8eebe14d634..720b5078bde 100644 --- a/htdocs/langs/en_US/commercial.lang +++ b/htdocs/langs/en_US/commercial.lang @@ -81,6 +81,8 @@ ActionAC_SHIP=Send shipping by mail ActionAC_SUP_ORD=Send supplier order by mail ActionAC_SUP_INV=Send supplier invoice by mail ActionAC_OTH=Other +ActionAC_MANUAL=Manually inserted events +ActionAC_AUTO=Automatically inserted events Stats=Sales statistics CAOrder=Sales volume (validated orders) FromTo=from %s to %s diff --git a/htdocs/langs/fr_FR/commercial.lang b/htdocs/langs/fr_FR/commercial.lang index bb76700ba53..79937cb84fb 100644 --- a/htdocs/langs/fr_FR/commercial.lang +++ b/htdocs/langs/fr_FR/commercial.lang @@ -81,6 +81,8 @@ ActionAC_SHIP=Envoi bon d'expédition par mail ActionAC_SUP_ORD=Envoi commande fournisseur par mail ActionAC_SUP_INV=Envoi facture fournisseur par mail ActionAC_OTH=Autre +ActionAC_MANUAL=Evênements insérés manuellement +ActionAC_AUTO=Evênements insérés automatiquement Stats=Statistiques de vente CAOrder=Chiffre d'affaires (Commandes validées) FromTo=du %s au %s
'.$langs->trans("Type").''; - if (GETPOST("actioncode")) + if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - print ''."\n"; - $cactioncomm->fetch(GETPOST("actioncode")); - print $cactioncomm->getNomUrl(); + print '
'.$langs->trans("Type").''; + if (GETPOST("actioncode")) + { + print ''."\n"; + $cactioncomm->fetch(GETPOST("actioncode")); + print $cactioncomm->getNomUrl(); + } + else + { + $htmlactions->select_type_actions($actioncomm->type_code, "actioncode","systemauto"); + } + print '
'.$langs->trans("Title").'
'.$langs->trans("EventOnFullDay").'
'.$langs->trans("Ref").''.$act->id.'
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Title").'
'.$langs->trans("EventOnFullDay").'fulldayevent?' checked="checked"':'').'>
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Title").''.$act->label.'
'; print $langs->trans("Type"); print '  '; - print $formactions->select_type_actions(GETPOST('actioncode'), "actioncode"); + + // print $formactions->select_type_actions(GETPOST('actioncode'), "actioncode"); + print $formactions->select_type_actions(GETPOST('actioncode')?GETPOST('actioncode'):'manual', "actioncode", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0)); + print '