diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 5ab768e5004..bc9e855046d 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -227,7 +227,7 @@ $tabfield[21]= "code,label"; $tabfield[22]= "code,label"; $tabfield[23]= "country_id,country,taux,accountancy_code_sell,accountancy_code_buy,note"; $tabfield[24]= "code,label"; -$tabfield[25]= "label,type_template,private,position,topic,content"; +$tabfield[25]= "label,type_template,position,topic,content"; $tabfield[26]= "code,label,short_label"; $tabfield[27]= "code,libelle"; $tabfield[28]= "code,label,delay,newByMonth,country_id,country"; @@ -259,7 +259,7 @@ $tabfieldvalue[21]= "code,label"; $tabfieldvalue[22]= "code,label"; $tabfieldvalue[23]= "country,taux,accountancy_code_sell,accountancy_code_buy,note"; $tabfieldvalue[24]= "code,label"; -$tabfieldvalue[25]= "label,type_template,private,position,topic,content"; +$tabfieldvalue[25]= "label,type_template,position,topic,content"; $tabfieldvalue[26]= "code,label,short_label"; $tabfieldvalue[27]= "code,libelle"; $tabfieldvalue[28]= "code,label,delay,newByMonth,country"; @@ -291,7 +291,7 @@ $tabfieldinsert[21]= "code,label"; $tabfieldinsert[22]= "code,label"; $tabfieldinsert[23]= "fk_pays,taux,accountancy_code_sell,accountancy_code_buy,note"; $tabfieldinsert[24]= "code,label"; -$tabfieldinsert[25]= "label,type_template,private,position,topic,content"; +$tabfieldinsert[25]= "label,type_template,position,topic,content"; $tabfieldinsert[26]= "code,label,short_label"; $tabfieldinsert[27]= "code,libelle"; $tabfieldinsert[28]= "code,label,delay,newByMonth,fk_country"; @@ -389,7 +389,7 @@ $tabhelp[21] = array('code'=>$langs->trans("EnterAnyCode")); $tabhelp[22] = array('code'=>$langs->trans("EnterAnyCode")); $tabhelp[23] = array(); $tabhelp[24] = array('code'=>$langs->trans("EnterAnyCode")); -$tabhelp[25] = array('type_template'=>$langs->trans("TemplateFor"),'private'=>$langs->trans("TemplateIsVisibleByYouOnly"), 'position'=>$langs->trans("PositionIntoComboList")); +$tabhelp[25] = array('type_template'=>$langs->trans("TemplateForElement"),'private'=>$langs->trans("TemplateIsVisibleByOwnerOnly"), 'position'=>$langs->trans("PositionIntoComboList")); $tabhelp[26] = array('code'=>$langs->trans("EnterAnyCode")); $tabhelp[27] = array('code'=>$langs->trans("EnterAnyCode")); $tabhelp[28] = array('delay'=>$langs->trans("MinimumNoticePeriod"), 'newByMonth'=>$langs->trans("NbAddedAutomatically")); @@ -469,6 +469,24 @@ if ($id == 11) 'external' => $langs->trans('External') ); } +if ($id == 25) +{ + // We save list of template type Dolibarr can manage. This list can found by a grep into code on "->param['models']" + $elementList = array( + 'propal_send' => $langs->trans('MailToSendProposal'), + 'order_send' => $langs->trans('MailToSendOrder'), + 'facture_send' => $langs->trans('MailToSendInvoice'), + + 'shipping_send' => $langs->trans('MailToSendShipment'), + 'fichinter_send' => $langs->trans('MailToSendIntervention'), + + 'askpricesupplier_send' => $langs->trans('MailToSendSupplierRequestForQuotation'), + 'order_supplier_send' => $langs->trans('MailToSendSupplierOrder'), + 'invoice_supplier_send' => $langs->trans('MailToSendSupplierInvoice'), + + 'thirdparty' => $langs->trans('MailToThirdparty') + ); +} // Define localtax_typeList (used for dictionary "llx_c_tva") $localtax_typeList = array(); @@ -904,6 +922,7 @@ if ($id) if ($fieldlist[$field]=='pcg_subtype') { $valuetoshow=$langs->trans("Pcg_subtype"); } if ($fieldlist[$field]=='sortorder') { $valuetoshow=$langs->trans("SortOrder"); } if ($fieldlist[$field]=='short_label') { $valuetoshow=$langs->trans("ShortLabel"); } + if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); } if ($id == 2) // Special cas for state page { @@ -970,6 +989,8 @@ if ($id) print ''; + + // List of available values in database dol_syslog("htdocs/admin/dict", LOG_DEBUG); $resql=$db->query($sql); @@ -984,7 +1005,7 @@ if ($id) if ($num > $listlimit) { print ''; - print_fleche_navigation($page,$_SERVER["PHP_SELF"],'&id='.$id,($num > $listlimit),$langs->trans("Page").' '.($page+1)); + print_fleche_navigation($page, $_SERVER["PHP_SELF"], '&id='.$id, ($num > $listlimit), ''); print ''; } @@ -1042,6 +1063,7 @@ if ($id) if ($fieldlist[$field]=='pcg_subtype') { $valuetoshow=$langs->trans("Pcg_subtype"); } if ($fieldlist[$field]=='sortorder') { $valuetoshow=$langs->trans("SortOrder"); } if ($fieldlist[$field]=='short_label') { $valuetoshow=$langs->trans("ShortLabel"); } + if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); } // Affiche nom du champ if ($showfield) @@ -1097,6 +1119,10 @@ if ($id) $showfield=1; $align="left"; $valuetoshow=$obj->$fieldlist[$field]; + if ($value == 'type_template') + { + $valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow; + } if ($value == 'element') { $valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow; @@ -1407,7 +1433,8 @@ function fieldList($fieldlist,$obj='',$tabname='') foreach ($fieldlist as $field => $value) { - if ($fieldlist[$field] == 'country') { + if ($fieldlist[$field] == 'country') + { if (in_array('region_id',$fieldlist)) { print ''; @@ -1420,7 +1447,8 @@ function fieldList($fieldlist,$obj='',$tabname='') print $form->select_country((! empty($obj->country_code)?$obj->country_code:(! empty($obj->country)?$obj->country:'')), $fieldname, '', 28); print ''; } - elseif ($fieldlist[$field] == 'country_id') { + elseif ($fieldlist[$field] == 'country_id') + { if (! in_array('country',$fieldlist)) // If there is already a field country, we don't show country_id (avoid duplicate) { $country_id = (! empty($obj->$fieldlist[$field]) ? $obj->$fieldlist[$field] : 0); @@ -1429,22 +1457,32 @@ function fieldList($fieldlist,$obj='',$tabname='') print ''; } } - elseif ($fieldlist[$field] == 'region') { + elseif ($fieldlist[$field] == 'region') + { print ''; $formcompany->select_region($region_id,'region'); print ''; } - elseif ($fieldlist[$field] == 'region_id') { + elseif ($fieldlist[$field] == 'region_id') + { $region_id = (! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:0); print ''; print ''; print ''; } - elseif ($fieldlist[$field] == 'lang') { + elseif ($fieldlist[$field] == 'lang') + { print ''; print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT,'lang'); print ''; } + // Le type de template + elseif ($fieldlist[$field] == 'type_template') + { + print ''; + print $form->selectarray('type_template', $elementList,(! empty($obj->$fieldlist[$field])?$obj->$fieldlist[$field]:'')); + print ''; + } // Le type de l'element (pour les type de contact) elseif ($fieldlist[$field] == 'element') { diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 91082646913..b7d4f909fa7 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -992,6 +992,9 @@ else // Print mail content print_fiche_titre($langs->trans("EMail"),'',''); + + dol_fiche_head(''); + print ''; // Subject @@ -1042,7 +1045,8 @@ else print ''; print '
'; - print "
"; + + dol_fiche_end(); } else { diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 5e2aa787dba..99c73dc4837 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2013 Laurent Destailleur + * Copyright (C) 2005-2015 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2014 Florian Henry * @@ -408,20 +408,17 @@ if ($object->fetch($id) >= 0) print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"mc.firstname",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("OtherInformations"),$_SERVER["PHP_SELF"],"",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Source"),$_SERVER["PHP_SELF"],"",$param,"",'align="center"',$sortfield,$sortorder); - // Date sending if ($object->statut < 2) { - print ' '; + print_liste_field_titre(''); } else { print_liste_field_titre($langs->trans("DateSending"),$_SERVER["PHP_SELF"],"mc.date_envoi",$param,'','align="center"',$sortfield,$sortorder); } - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"mc.statut",$param,'','align="right"',$sortfield,$sortorder); print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); - print ''; // Ligne des champs de filtres @@ -458,7 +455,6 @@ if ($object->fetch($id) >= 0) //Search Icon print ''; print ''; - print '  '; print ''; print ''; print ''; @@ -518,9 +514,6 @@ if ($object->fetch($id) >= 0) { print ' '; print ''.$langs->trans("MailingStatusNotSent"); - if ($user->rights->mailing->creer && $allowaddtarget) { - print ''.img_delete($langs->trans("RemoveRecipient")); - } print ''; } else @@ -532,7 +525,14 @@ if ($object->fetch($id) >= 0) } //Sreach Icon - print ''; + print ''; + if ($obj->statut == 0) + { + if ($user->rights->mailing->creer && $allowaddtarget) { + print ''.img_delete($langs->trans("RemoveRecipient")); + } + } + print ''; print ''; $i++; @@ -540,7 +540,7 @@ if ($object->fetch($id) >= 0) } else { - print ''.$langs->trans("NoTargetYet").''; + print ''.$langs->trans("NoTargetYet").''; } print "
"; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 8cd48a75f40..db109ebc1d5 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -2288,6 +2288,9 @@ if ($action == 'create') } print "
\n"; + //Select mail models is same action as presend + if (GETPOST('modelselected')) $action = 'presend'; + if ($action != 'presend') { print '
'; @@ -2330,10 +2333,6 @@ if ($action == 'create') /* * Action presend */ - //Select mail models is same action as presend - if (GETPOST('modelselected')) { - $action = 'presend'; - } if ($action == 'presend') { $object->fetch_projet(); @@ -2369,8 +2368,11 @@ if ($action == 'create') $file = $fileparams['fullname']; } + print '
'; print '
'; - print_titre($langs->trans('SendPropalByMail')); + print_titre($langs->trans('SendPropalByMail'), '', 'object_email'); + + dol_fiche_head(''); // Create form object include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; @@ -2439,7 +2441,7 @@ if ($action == 'create') print $formmail->get_form(); - print '
'; + dol_fiche_end(); } } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 79f752f8355..1209a6be5df 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -32,6 +32,7 @@ * \ingroup commande * \brief Page to show customer order */ + require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formorder.class.php'; @@ -2362,8 +2363,11 @@ if ($action == 'create' && $user->rights->commande->creer) $file = $fileparams['fullname']; } + print '
'; print '
'; - print_titre($langs->trans('SendOrderByMail')); + print_fiche_titre($langs->trans('SendOrderByMail'), '', 'object_email'); + + dol_fiche_head(''); // Cree l'objet formulaire mail include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; @@ -2402,8 +2406,10 @@ if ($action == 'create' && $user->rights->commande->creer) $contactarr = array(); $contactarr = $object->liste_contact(- 1, 'external'); - if (is_array($contactarr) && count($contactarr) > 0) { - foreach ($contactarr as $contact) { + if (is_array($contactarr) && count($contactarr) > 0) + { + foreach ($contactarr as $contact) + { if ($contact['libelle'] == $langs->trans('TypeContact_commande_external_CUSTOMER')) { // TODO Use code and not label $contactstatic = new Contact($db); $contactstatic->fetch($contact ['id']); @@ -2432,7 +2438,7 @@ if ($action == 'create' && $user->rights->commande->creer) // Show form print $formmail->get_form(); - print '
'; + dol_fiche_end(); } } } diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 518a22ede78..1043c73456f 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2502,8 +2502,8 @@ if ($action == 'create') } print '
'; -} -else if ($id > 0 || ! empty($ref)) +} +else if ($id > 0 || ! empty($ref)) { /* * Show object in view mode @@ -2860,7 +2860,7 @@ else if ($id > 0 || ! empty($ref)) $outstandingBills = $soc->get_OutstandingBill(); print ' - ' . $langs->trans('CurrentOutstandingBill') . ': '; print price($outstandingBills, '', $langs, 0, 0, - 1, $conf->currency); - if ($soc->outstanding_limit != '') + if ($soc->outstanding_limit != '') { if ($outstandingBills > $soc->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached")); @@ -2950,7 +2950,7 @@ else if ($id > 0 || ! empty($ref)) } else print '. '; } - if ($absolute_creditnote > 0) + if ($absolute_creditnote > 0) { // If validated, we show link "add credit note to payment" if ($object->statut != 1 || $object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) { @@ -3855,8 +3855,9 @@ else if ($id > 0 || ! empty($ref)) $file = $fileparams['fullname']; } + print '
'; print '
'; - print_titre($langs->trans($titreform)); + print_titre($langs->trans($titreform), '', 'object_email'); // Cree l'objet formulaire mail dol_fiche_head(); diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 4e1a8ffc0c5..8310db730ab 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -276,7 +276,8 @@ class FormMail extends Form // Get message template $model_id=0; - if (array_key_exists('models_id',$this->param)) { + if (array_key_exists('models_id',$this->param)) + { $model_id=$this->param["models_id"]; } $arraydefaultmessage=$this->getEMailTemplate($this->db, $this->param["models"], $user, $outputlangs, $model_id); @@ -295,23 +296,26 @@ class FormMail extends Form } $result = $this->fetchAllEMailTemplate($this->param["models"], $user, $outputlangs); - if ($result<0) { + if ($result<0) + { setEventMessage($this->error,'errors'); } $modelmail_array=array(); - foreach($this->lines_model as $line) { + foreach($this->lines_model as $line) + { $modelmail_array[$line->id]=$line->label; } - if (count($modelmail_array)>0) { - $out.= ''; - $out.= ''; - $out.= ''; - $out.= '
'."\n"; + // Zone to select its email template + if (count($modelmail_array)>0) + { + $out.= '
'."\n"; $out.= $langs->trans('SelectMailModel').':'.$this->selectarray('modelmailselected', $modelmail_array,$model_id); - $out.= '
'; if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); - $out.= '
'; + $out.= '   '; + $out.= ''; + $out.= '   '; + $out.= '
'; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 0e86a1b6163..ed3d709f16f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2901,11 +2901,11 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so * @param string $file Page URL (in most cases provided with $_SERVER["PHP_SELF"]) * @param string $options Other url paramaters to propagate ("" by default) * @param integer $nextpage Do we show a next page button - * @param string $betweenarrows HTML content to show between arrows. Must contains '
  • ' tags. + * @param string $betweenarrows HTML content to show between arrows. MUST contains '
  • ' tags or '
  • '. * @param string $afterarrows HTML content to show after arrows. Must NOT contains '
  • ' tags. * @return void */ -function print_fleche_navigation($page,$file,$options='',$nextpage=0,$betweenarrows='',$afterarrows='') +function print_fleche_navigation($page, $file, $options='', $nextpage=0, $betweenarrows='', $afterarrows='') { global $conf, $langs; @@ -2915,8 +2915,10 @@ function print_fleche_navigation($page,$file,$options='',$nextpage=0,$betweenarr if (empty($conf->dol_use_jmobile)) print '
    '; else print '
  • '.$langs->trans("Previous").'
  • '; } - //if ($betweenarrows) print ($page > 0?' ':'').$betweenarrows.($nextpage>0?' ':''); - print $betweenarrows; + if ($betweenarrows) + { + print $betweenarrows; + } if ($nextpage > 0) { if (empty($conf->dol_use_jmobile)) print ''; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index d2e001b2383..3bf2d5a14b5 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1660,6 +1660,15 @@ SellTaxRate=Sale tax rate RecuperableOnly=Yes for VAT "Non Perçue Récupérable" dedicated for some state in France. Keep value to "No" in all other cases. UrlTrackingDesc=If the provider or transport service offer a page or web site to check status of your shipment, you can enter it here. You can use the key {TRACKID} into URL parameters so the system will replace it with value of tracking number user entered into shipment card. OpportunityPercent=When you create an opportunity, you will defined an estimated amount of project/lead. According to status of opportunity, this amount may be multiplicated by this rate to evaluate global amount all your opportunities may generate. Value is percent (between 0 and 100). - - - \ No newline at end of file +TemplateForElement=This template record is dedicated to which element +TypeOfTemplate=Type of template +TemplateIsVisibleByOwnerOnly=Template is visible by owner only +MailToSendProposal=To send customer proposal +MailToSendOrder=To send customer order +MailToSendInvoice=To send customer invoice +MailToSendShipment=To send shipment +MailToSendIntervention=To send intervention +MailToSendSupplierRequestForQuotation=To send quotation request to supplier +MailToSendSupplierOrder=To send supplier order +MailToSendSupplierInvoice=To send supplier invoice +MailToThirdparty=To send email from thirdparty page \ No newline at end of file