Compare commits

...

4 Commits

Author SHA1 Message Date
valentina 8fd28e8932 Fix upload immagine utente 2024-08-26 12:30:39 +02:00
Beppe 9be5d8c9e3 Merge branch 'master' of https://github.com/devcode-it/openstamanager 2024-08-26 11:27:44 +02:00
Beppe b5dde3803b Aggiornamento nuovo marker per mappa 2024-08-26 11:27:41 +02:00
valentina ad70b7322f Fix gestione widgets 2024-08-26 09:13:55 +02:00
7 changed files with 28 additions and 13 deletions

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="100%" height="100%" viewBox="-5 0 32 32" xmlns="http://www.w3.org/2000/svg">
<path id="Path_19" data-name="Path 19" d="M1002,44a10,10,0,0,0-10,10c0,5.523,10,20,10,20s10-14.477,10-20A10,10,0,0,0,1002,44Zm0,13a3,3,0,1,1,3-3A3,3,0,0,1,1002,57Z" transform="translate(-991 -43)" fill="#cccccc" stroke="#333" stroke-opacity="0.3" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/>
</svg>

After

Width:  |  Height:  |  Size: 529 B

View File

@ -258,6 +258,10 @@ function leaflet() {
config.nodeDirectory + '/leaflet.fullscreen/icon-fullscreen.svg',
]).pipe(gulp.dest(config.production + '/' + config.paths.images + '/leaflet'));
gulp.src([
config.development + '/' + config.paths.images + '/leaflet/*',
]).pipe(gulp.dest(config.production + '/' + config.paths.images + '/leaflet'));
return gulp.src([
config.nodeDirectory + '/leaflet/dist/images/*.{jpg,png,jpeg}',
])

View File

@ -197,17 +197,18 @@ switch (filter('op')) {
case 'disabilita-widget':
$id = filter('id');
$widget = $database->table('zz_widgets_lang')
->where('id', '=', $id)
->first();
// Abilitazione del widget indicato
$database->table('zz_widgets')
->where('id', '=', $id)
->where('id', '=', $widget->id_record)
->update(['enabled' => 0]);
// Messaggio informativo
$widget = $database->table('zz_widgets')
->where('id', '=', $id)
->first();
flash()->info(tr('Widget "_NAME_" disabilitato!', [
'_NAME_' => $widget->getTranslation('title'),
'_NAME_' => $widget->title,
]));
echo json_encode([]);
@ -223,11 +224,13 @@ switch (filter('op')) {
->update(['enabled' => 1]);
// Messaggio informativo
$widget = $database->table('zz_widgets')
->where('id', '=', $id)
->first();
$widget = $database->table('zz_widgets_lang')
->where('id_record', '=', $id)
->where('id_lang', '=', Models\Locale::getDefault()->id)
->first();
flash()->info(tr('Widget "_NAME_" abilitato!', [
'_NAME_' => $widget->getTranslation('title'),
'_NAME_' => $widget->title,
]));
echo json_encode([]);

View File

@ -18,8 +18,10 @@
*/
include_once __DIR__.'/../../core.php';
use Models\Upload;
$user_photo = $rootdir.'/files/utenti/'.Upload::find($user->image_file_id)->filename;
$user_photo = $user->photo;
if ($user_photo) {
echo '
<center><img src="'.$user_photo.'" class="img-responsive" alt="'.$user['username'].'" /></center>';

View File

@ -22,6 +22,7 @@ namespace HTMLBuilder\Manager;
use Models\Upload;
use Util\FileSystem;
/**
* Gestione allegati.
*

View File

@ -74,8 +74,9 @@ class Upload extends Model
$model = new static();
// Informazioni di base
$original_name = $source['name'] ?? basename($source);
$name = $data['name'] ?? $name;
$name ??= basename($source);
$original_name = $source['name'] ?? $name;
$category = $data['category'] ?? $category;
// Nome e categoria dell'allegato

View File

@ -149,7 +149,7 @@ class User extends Model
$image = Upload::find($this->image_file_id);
return base_path().'/'.$image->filepath;
return base_path().'/files/'.$image->module->directory.'/'.$image->filename;
}
public function setPhotoAttribute($value)
@ -179,7 +179,7 @@ class User extends Model
$img->save(slashes($file));
// Aggiunta nuova foto
$upload = Upload::build($file, $data);
$upload = Upload::build(file_get_contents($file), $data, basename($value['name']));
// Rimozione foto precedenti
delete($file);