Fix list of linked object block

This commit is contained in:
Laurent Destailleur 2016-11-11 02:18:48 +01:00
parent e4c4ced5a3
commit 2cfcca82b4
3 changed files with 29 additions and 18 deletions

View File

@ -668,7 +668,15 @@ if ($action == 'create')
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';
print load_fiche_titre($langs->trans("NewMailing"));
$htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>';
foreach($object->substitutionarray as $key => $val)
{
$htmltext.=$key.' = '.$langs->trans($val).'<br>';
}
$htmltext.='</i>';
// Print mail form
print load_fiche_titre($langs->trans("NewMailing"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext), 'title_generic');
dol_fiche_head();
@ -693,21 +701,16 @@ if ($action == 'create')
print '<tr><td>'.$langs->trans("BackgroundColorByDefault").'</td><td colspan="3">';
print $htmlother->selectColor($_POST['bgcolor'],'bgcolor','new_mailing',0);
print '</td></tr>';
print '<tr><td valign="top"><span class="fieldrequired">'.$langs->trans("MailMessage").'</span><br>';
print '<br><i>'.$langs->trans("CommonSubstitutions").':<br>';
foreach($object->substitutionarray as $key => $val)
{
print $key.' = '.$langs->trans($val).'<br>';
}
print '</i></td>';
print '<td>';
print '</table>';
print '<div style="padding-top: 10px">';
// Editeur wysiwyg
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor('body',$_POST['body'],'',320,'dolibarr_mailings','',true,true,$conf->global->FCKEDITOR_ENABLE_MAILING,20,'90%');
$doleditor->Create();
print '</td></tr>';
print '</table>';
print '</div>';
dol_fiche_end();
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("CreateMailing").'"></div>';

View File

@ -24,16 +24,21 @@
<?php
global $user;
global $noMoreLinkedObjectBlockAfter;
$langs = $GLOBALS['langs'];
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
$langs->load("bills");
$total=0; $ilink=0;
$var=true;
$total=0;
foreach($linkedObjectBlock as $key => $objectlink)
{
$var=!$var;
$ilink++;
$var=!$var;
$trclass=($var?'pair':'impair');
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?>
<tr <?php echo $GLOBALS['bc'][$var]; ?> >
<td><?php echo $langs->trans("RepeatableInvoice"); ?></td>

View File

@ -13,7 +13,6 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
?>
@ -22,19 +21,23 @@
<?php
global $user;
global $noMoreLinkedObjectBlockAfter;
$langs = $GLOBALS['langs'];
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
$langs->load("contracts");
$total=0; $ilink=0;
$var=true;
foreach($linkedObjectBlock as $key => $objectlink)
{
$objectlink->fetch_lines();
$var=!$var;
$ilink++;
$var=!$var;
$trclass=($var?'pair':'impair');
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?>
<tr <?php echo $bc[$var]; ?> >
<tr class="<?php echo $trclass; ?>">
<td><?php echo $langs->trans("Contract"); ?></td>
<td><?php echo $objectlink->getNomUrl(1); ?></td>
<td></td>