Bugfix minori

This commit is contained in:
Thomas Zilio 2019-01-03 11:04:28 +01:00
parent 7213a4dfdd
commit 5792ac57d0
13 changed files with 29 additions and 27 deletions

View File

@ -22,7 +22,16 @@
"require": { "require": {
"php": ">=5.6", "php": ">=5.6",
"ext-mbstring": "*", "ext-mbstring": "*",
"ext-pdo_mysql": "*", "ext-json": "*",
"ext-pdo": "*",
"ext-zip": "*",
"ext-intl": "*",
"ext-simplexml": "*",
"ext-libxml": "*",
"ext-dom": "*",
"ext-curl": "*",
"ext-openssl": "*",
"ext-xsl": "*",
"aluguest/ical-easy-reader": "^1.5", "aluguest/ical-easy-reader": "^1.5",
"danielstjules/stringy": "^3.1", "danielstjules/stringy": "^3.1",
"davidepastore/codice-fiscale": "^0.4.0", "davidepastore/codice-fiscale": "^0.4.0",

View File

@ -87,9 +87,9 @@ function get($param, $raw = false)
* *
* @return string * @return string
*/ */
function setting($nome, $again = false) function setting($name, $again = false)
{ {
return \Settings::getValue($nome, $again); return \Settings::getValue($name);
} }
/** /**

View File

@ -17,7 +17,7 @@ if (!function_exists('array_column')) {
* *
* @since 2.3 * @since 2.3
* *
* @return plucked array only with key data * @return array plucked array only with key data
*/ */
function array_column($array, $key) function array_column($array, $key)
{ {

View File

@ -425,7 +425,7 @@ if ($record['stato'] != 'Pagato' && $record['stato'] != 'Emessa') {
</div>'; </div>';
// Lettura contratti accettati, in attesa di conferma o in lavorazione // Lettura contratti accettati, in attesa di conferma o in lavorazione
$contr_query = 'SELECT COUNT(*) AS tot FROM co_contratti WHERE idanagrafica='.prepare($record['idanagrafica']).' AND id NOT IN (SELECT idcontratto FROM co_righe_documenti WHERE NOT idcontratto=NULL) AND idstato IN( SELECT id FROM co_staticontratti WHERE fatturabile = 1) AND NOT EXISTS (SELECT id FROM co_righe_documenti WHERE co_righe_documenti.idcontratto = co_contratti.id)'; $contr_query = 'SELECT COUNT(*) AS tot FROM co_contratti WHERE idanagrafica='.prepare($record['idanagrafica']).' AND id NOT IN (SELECT idcontratto FROM co_righe_documenti WHERE idcontratto IS NOT NULL) AND idstato IN( SELECT id FROM co_staticontratti WHERE fatturabile = 1) AND NOT EXISTS (SELECT id FROM co_righe_documenti WHERE co_righe_documenti.idcontratto = co_contratti.id)';
$contratti = $dbo->fetchArray($contr_query)[0]['tot']; $contratti = $dbo->fetchArray($contr_query)[0]['tot'];
echo ' echo '
<div class="tip" data-toggle="tooltip" title="'.tr('Contratti accettati, in attesa di conferma o in lavorazione.').'" style="display:inline;"> <div class="tip" data-toggle="tooltip" title="'.tr('Contratti accettati, in attesa di conferma o in lavorazione.').'" style="display:inline;">

View File

@ -211,8 +211,8 @@ class Backup
$database_file = $extraction_dir.'/database.sql'; $database_file = $extraction_dir.'/database.sql';
if (file_exists($database_file)) { if (file_exists($database_file)) {
$database->query('SET foreign_key_checks = 0'); $database->query('SET foreign_key_checks = 0');
foreach ($tables as $tables) { foreach ($tables as $table) {
$database->query('DROP TABLE IF EXISTS `'.$tables.'`'); $database->query('DROP TABLE IF EXISTS `'.$table.'`');
} }
$database->query('DROP TABLE IF EXISTS `updates`'); $database->query('DROP TABLE IF EXISTS `updates`');

View File

@ -11,8 +11,6 @@ class ButtonManager implements ManagerInterface
{ {
$options['parameters'] = isset($options['parameters']) ? $options['parameters'] : null; $options['parameters'] = isset($options['parameters']) ? $options['parameters'] : null;
$result = '';
if (isset($options['id'])) { if (isset($options['id'])) {
$result = $this->link($options); $result = $this->link($options);
} else { } else {
@ -24,8 +22,6 @@ class ButtonManager implements ManagerInterface
protected function getInfo($options) protected function getInfo($options)
{ {
$result = [];
if ($options['type'] == 'print') { if ($options['type'] == 'print') {
$print = \Prints::get($options['id']); $print = \Prints::get($options['id']);
@ -81,8 +77,6 @@ class ButtonManager implements ManagerInterface
protected function getList($options) protected function getList($options)
{ {
$results = [];
if ($options['type'] == 'print') { if ($options['type'] == 'print') {
$results = \Prints::getModulePrints($options['id_module']); $results = \Prints::getModulePrints($options['id_module']);
} else { } else {
@ -159,8 +153,6 @@ class ButtonManager implements ManagerInterface
protected function defaultText($options) protected function defaultText($options)
{ {
$result = '';
if ($options['type'] == 'print') { if ($options['type'] == 'print') {
$result = '<i class="fa fa-print"></i> '.tr('Stampa'); $result = '<i class="fa fa-print"></i> '.tr('Stampa');
} else { } else {

View File

@ -25,7 +25,7 @@ class EmailManager implements ManagerInterface
$database = database(); $database = database();
// Visualizzo il log delle operazioni di invio email // Visualizzo il log delle operazioni di invio email
$operations = $database->fetchArray('SELECT created_at, options, (SELECT name FROM zz_emails WHERE id = id_email) AS email, (SELECT username FROM zz_users WHERE id = id_utente) AS user FROM zz_operations WHERE id_record = '.prepare($options['id_record']).' AND id_module = '.prepare($options['id_module']).' AND op = "send-email" AND id_email IS NOT NULL ORDER BY created_at DESC'); $operations = $database->fetchArray('SELECT created_at, options, (SELECT name FROM zz_emails WHERE id = id_email) AS email, (SELECT username FROM zz_users WHERE id = id_utente) AS user FROM zz_operations WHERE id_record = '.prepare($options['id_record']).' AND id_module = '.prepare($options['id_module'])." AND op = 'send-email' AND id_email IS NOT NULL ORDER BY created_at DESC");
if (empty($operations)) { if (empty($operations)) {
return ' '; return ' ';

View File

@ -66,13 +66,13 @@ class FieldManager implements ManagerInterface
$field['value'] = isset($field['value']) ? $field['value'] : ''; $field['value'] = isset($field['value']) ? $field['value'] : '';
$replace = [ $replace = [
'value' => $field['value'], 'value' => $field['value'],
'label' => $field['name'], 'label' => $field['name'],
'name' => $field['html_name'], 'name' => $field['html_name'],
]; ];
foreach ($replace as $key => $value) { foreach ($replace as $name => $value) {
$field['content'] = str_replace('|'.$key.'|', $value, $field['content']); $field['content'] = str_replace('|'.$name.'|', $value, $field['content']);
} }
$result .= ' $result .= '

View File

@ -219,6 +219,8 @@ class Mail extends PHPMailer\PHPMailer\PHPMailer
* Invia l'email impostata. * Invia l'email impostata.
* *
* @return bool * @return bool
*
* @throws Exception
*/ */
public function send() public function send()
{ {

View File

@ -146,9 +146,9 @@ class Modules
/** /**
* Restituisce i filtri aggiuntivi dell'utente in relazione al modulo specificato. * Restituisce i filtri aggiuntivi dell'utente in relazione al modulo specificato.
* *
* @param int $id * @param int $module
* *
* @return string * @return array
*/ */
public static function getSegments($module) public static function getSegments($module)
{ {

View File

@ -69,8 +69,8 @@ class Permissions
if (!self::getSkip()) { if (!self::getSkip()) {
if (!Auth::check() && getURLPath() == slashes(ROOTDIR.'/index.php')) { if (!Auth::check() && getURLPath() == slashes(ROOTDIR.'/index.php')) {
redirect(ROOTDIR.'/index.php'); redirect(ROOTDIR.'/index.php');
exit();
$result = false; $result = false;
exit();
} else { } else {
if (!empty(self::$permissions)) { if (!empty(self::$permissions)) {
foreach (self::$permissions as $module) { foreach (self::$permissions as $module) {

View File

@ -51,7 +51,6 @@ class Uploads
'm4a' => 'audio/mpeg', 'm4a' => 'audio/mpeg',
'm4b' => 'audio/mpeg', 'm4b' => 'audio/mpeg',
'mp' => 'audio/mpeg', 'mp' => 'audio/mpeg',
'm4b' => 'audio/mpeg',
'ra' => 'audio/x-realaudio', 'ra' => 'audio/x-realaudio',
'ram' => 'audio/x-realaudio', 'ram' => 'audio/x-realaudio',
'wav' => 'audio/wav', 'wav' => 'audio/wav',

View File

@ -78,7 +78,7 @@ class FattureCest
* *
* @param AcceptanceTester $t * @param AcceptanceTester $t
*/ */
protected function addAndDeleteFattura(AcceptanceTester $t, $cliente = 2, $tipo) protected function addAndDeleteFattura(AcceptanceTester $t, $cliente, $tipo)
{ {
$this->addAnag($t, $cliente, $tipo); $this->addAnag($t, $cliente, $tipo);