1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-22 21:28:08 +01:00

Spostati pulsanti in ddt e ordini secondo nuova struttura su file esterno buttons.php

This commit is contained in:
Luca 2018-05-19 00:50:06 +02:00
parent 68ba2da869
commit 0950671c52
6 changed files with 54 additions and 55 deletions

View File

@ -103,7 +103,7 @@ if (empty($records)) {
{( "name": "button", "type": "email", "id_module": "'.$id_module.'", "id_record": "'.$id_record.'" )}
<a class="btn btn-success" id="save">
<i class="fa fa-check"></i> '.tr('Salva modifiche').'
<i class="fa fa-check"></i> '.tr('Salva').'
</a>
</div>
</div>

13
modules/ddt/buttons.php Normal file
View File

@ -0,0 +1,13 @@
<?php
include_once __DIR__.'/../../core.php';
if (!in_array($records[0]['stato'], ['Bozza', 'Fatturato'])) {
echo '
<a class="btn btn-info" data-href="'.$rootdir.'/modules/fatture/crea_documento.php?id_module=.'.$id_module.'&id_record='.$id_record.'&documento=fattura" data-toggle="modal" data-title="Crea fattura" data-target="#bs-popup">
<i class="fa fa-magic"></i>.'.tr('Crea fattura').'</i>
</a>';
}

View File

@ -173,21 +173,6 @@ if ($records[0]['stato'] != 'Evaso') {
}
?>
</div>
<div class="pull-right">
<!-- Stampe -->
<?php
if (!in_array($records[0]['stato'], ['Bozza', 'Fatturato'])) {
?>
<a class="btn btn-sm btn-info" data-href="<?php echo $rootdir; ?>/modules/fatture/crea_documento.php?id_module=<?php echo $id_module; ?>&id_record=<?php echo $id_record; ?>&documento=fattura" data-toggle="modal" data-title="Crea fattura" data-target="#bs-popup">
<i class="fa fa-magic"></i> <?php echo tr('Crea fattura da ddt'); ?>...</i>
</a>
<?php
}
?>
</div>
<div class="clearfix"></div>
<br>

View File

@ -0,0 +1,29 @@
<?php
include_once __DIR__.'/../../core.php';
if (!in_array($records[0]['stato'], ['Evaso'])) {
echo '
<div class="dropdown">
<button class="btn btn-info dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<i class="fa fa-magic"></i>&nbsp;'.tr('Crea').'...
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a data-href="'.$rootdir.'/modules/fatture/crea_documento.php?id_module='.$id_module.'&id_record='.$id_record.'&documento=ddt" data-toggle="modal" data-title="'.tr('Crea ddt').'" data-target="#bs-popup"><i class="fa fa-file-o"></i>&nbsp;'.tr('ddt').'
</a>
</li>
<li>
<a data-href="'.$rootdir.'/modules/fatture/crea_documento.php?id_module='.$id_module.'&id_record='.$id_record.'&documento=fattura" data-toggle="modal" data-title="'.tr('Crea fattura').'" data-target="#bs-popup"><i class="fa fa-file"></i>&nbsp;'.tr('fattura').'
</a>
</li>
</ul>
</div>';
}

View File

@ -88,49 +88,21 @@ if ($module['name'] == 'Ordini cliente') {
<div class="panel-body">
<div class="pull-left">
<?php if ($records[0]['stato'] != 'Evaso') {
?>
<?php
if ($records[0]['stato'] != 'Evaso') {
?>
<a class="btn btn-primary" data-href="<?php echo $rootdir; ?>/modules/ordini/row-add.php?id_module=<?php echo $id_module; ?>&id_record=<?php echo $id_record; ?>&is_articolo" data-toggle="modal" data-title="Aggiungi articolo" data-target="#bs-popup"><i class="fa fa-plus"></i> <?php echo tr('Articolo'); ?></a>
<a class="btn btn-primary" data-href="<?php echo $rootdir; ?>/modules/ordini/row-add.php?id_module=<?php echo $id_module; ?>&id_record=<?php echo $id_record; ?>&is_riga" data-toggle="modal" data-title="Aggiungi riga" data-target="#bs-popup"><i class="fa fa-plus"></i> <?php echo tr('Riga'); ?></a>
<a class="btn btn-primary" data-href="<?php echo $rootdir; ?>/modules/ordini/row-add.php?id_module=<?php echo $id_module; ?>&id_record=<?php echo $id_record; ?>&is_descrizione" data-toggle="modal" data-title="Aggiungi descrizione" data-target="#bs-popup"><i class="fa fa-plus"></i> <?php echo tr('Descrizione'); ?></a>
<?php
} ?>
</div>
<div class="pull-right">
<!-- Stampe -->
<?php
if ($records[0]['stato'] != 'Evaso') {
echo '
<div class="dropdown">
<button class="btn btn-info dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<i class="fa fa-magic"></i>&nbsp;'.tr('Crea subito').'
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a data-href="'.$rootdir.'/modules/fatture/crea_documento.php?id_module='.$id_module.'&id_record='.$id_record.'&documento=ddt" data-toggle="modal" data-title="'.tr('Crea ddt').'" data-target="#bs-popup"><i class="fa fa-file-o"></i>&nbsp;'.tr('ddt').'
</a>
</li>
<li>
<a data-href="'.$rootdir.'/modules/fatture/crea_documento.php?id_module='.$id_module.'&id_record='.$id_record.'&documento=fattura" data-toggle="modal" data-title="'.tr('Crea fattura').'" data-target="#bs-popup"><i class="fa fa-file"></i>&nbsp;'.tr('fattura').'
</a>
</li>
</ul>
</div>';
}
}
?>
</div>
<div class="clearfix"></div>
<br>

View File

@ -29,7 +29,7 @@ class ButtonManager implements ManagerInterface
$result = [
'link' => \Prints::getHref($options['id'], $options['id_record'], $options['parameters']),
'title' => $print['title'],
'title' => tr('Stampa').' '.strtolower($print['title']),
'icon' => $print['icon'],
];
} else {
@ -37,7 +37,7 @@ class ButtonManager implements ManagerInterface
$result = [
'link' => ROOTDIR.'/mail.php?id_module='.$options['id_module'].'&id_record='.$options['id_record'].'&id='.$options['id'],
'title' => $template['name'],
'title' => tr('Invia').' '.strtolower($template['name']),
'icon' => $template['icon'],
'type' => 'modal',
];
@ -157,9 +157,9 @@ class ButtonManager implements ManagerInterface
$result = '';
if ($options['type'] == 'print') {
$result = '<i class="fa fa-print"></i> '.tr('Stampe');
$result = '<i class="fa fa-print"></i> '.tr('Stampa');
} else {
$result = '<i class="fa fa-envelope"></i> '.tr('Email');
$result = '<i class="fa fa-envelope"></i> '.tr('Invia');
}
return $result;