last progress
This commit is contained in:
parent
52ae369553
commit
64c13428d3
BIN
hesabixArchive/temp/140050100014298555-0-655d1b5c85662.pdf
Normal file
BIN
hesabixArchive/temp/140050100014298555-0-655d1b5c85662.pdf
Normal file
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
|
@ -176,6 +176,35 @@ class AdminController extends AbstractController
|
||||||
}
|
}
|
||||||
throw $this->createNotFoundException();
|
throw $this->createNotFoundException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[Route('/api/admin/settings/system/info', name: 'admin_settings_system_info')]
|
||||||
|
public function admin_settings_system_info(Jdate $jdate,#[CurrentUser] ?User $user,UserPasswordHasherInterface $userPasswordHasher, EntityManagerInterface $entityManager,Request $request): Response
|
||||||
|
{
|
||||||
|
$item = $entityManager->getRepository(Settings::class)->findAll()[0];
|
||||||
|
$resp = [];
|
||||||
|
$resp['keywords'] = $item->getSiteKeywords();
|
||||||
|
$resp['description'] = $item->getDiscription();
|
||||||
|
return $this->json($resp);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[Route('/api/admin/settings/system/info/save', name: 'admin_settings_system_info_save')]
|
||||||
|
public function admin_settings_system_info_save(EntityManagerInterface $entityManager,Request $request): Response
|
||||||
|
{
|
||||||
|
$params = [];
|
||||||
|
if ($content = $request->getContent()) {
|
||||||
|
$params = json_decode($content, true);
|
||||||
|
}
|
||||||
|
if(array_key_exists('keywords',$params) && array_key_exists('description',$params)){
|
||||||
|
$item = $entityManager->getRepository(Settings::class)->findAll()[0];
|
||||||
|
$item->setSiteKeywords($params['keywords']);
|
||||||
|
$item->setDiscription($params['description']);
|
||||||
|
$entityManager->persist($item);
|
||||||
|
$entityManager->flush();
|
||||||
|
return $this->json(['result' => 1]);
|
||||||
|
}
|
||||||
|
throw $this->createNotFoundException();
|
||||||
|
}
|
||||||
|
|
||||||
#[Route('/api/admin/reportchange/lists', name: 'app_admin_reportchange_list')]
|
#[Route('/api/admin/reportchange/lists', name: 'app_admin_reportchange_list')]
|
||||||
public function app_admin_reportchange_list(Jdate $jdate,Provider $provider,EntityManagerInterface $entityManager): JsonResponse
|
public function app_admin_reportchange_list(Jdate $jdate,Provider $provider,EntityManagerInterface $entityManager): JsonResponse
|
||||||
{
|
{
|
||||||
|
|
|
@ -232,7 +232,7 @@ class ArchiveController extends AbstractController
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/api/archive/file/upload', name: 'app_archive_file_upload')]
|
#[Route('/api/archive/file/upload', name: 'app_archive_file_upload')]
|
||||||
public function app_archive_file_upload(Jdate $jdate, Provider $provider,SluggerInterface $slugger,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager,$code = 0): Response
|
public function app_archive_file_upload(Jdate $jdate, Provider $provider,SluggerInterface $slugger,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager,$code = 0): JsonResponse
|
||||||
{
|
{
|
||||||
$acc = $access->hasRole('archiveUpload');
|
$acc = $access->hasRole('archiveUpload');
|
||||||
if (!$acc)
|
if (!$acc)
|
||||||
|
@ -247,21 +247,30 @@ class ArchiveController extends AbstractController
|
||||||
$newFilename = $safeFilename.'-'.uniqid().'.'.$uploadedFile->guessExtension();
|
$newFilename = $safeFilename.'-'.uniqid().'.'.$uploadedFile->guessExtension();
|
||||||
|
|
||||||
// Move the file to the directory where brochures are stored
|
// Move the file to the directory where brochures are stored
|
||||||
|
try {
|
||||||
$uploadedFile->move(
|
$uploadedFile->move(
|
||||||
$this->getParameter('archiveTempMediaDir'),
|
$this->getParameter('archiveTempMediaDir'),
|
||||||
$newFilename
|
$newFilename
|
||||||
);
|
);} catch (FileException $e) {
|
||||||
try {} catch (FileException $e) {
|
|
||||||
// ... handle exception if something happens during file upload
|
// ... handle exception if something happens during file upload
|
||||||
}
|
}
|
||||||
|
|
||||||
// updates the 'brochureFilename' property to store the PDF file name
|
// updates the 'brochureFilename' property to store the PDF file name
|
||||||
// instead of its contents
|
// instead of its contents
|
||||||
//$product->setBrochureFilename($newFilename);
|
//$product->setBrochureFilename($newFilename);
|
||||||
return new Response('ali.jpg');
|
return $this->json(['name'=>$newFilename]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
#[Route('/api/archive/file/save', name: 'app_archive_file_save')]
|
||||||
|
public function app_archive_file_save(Jdate $jdate, Provider $provider,SluggerInterface $slugger,Request $request,Access $access,Log $log,EntityManagerInterface $entityManager,$code = 0): JsonResponse
|
||||||
|
{
|
||||||
|
$acc = $access->hasRole('archiveUpload');
|
||||||
|
if (!$acc)
|
||||||
|
throw $this->createAccessDeniedException();
|
||||||
|
return $this->json([
|
||||||
|
'ok'=>$request->get('doctype')
|
||||||
|
]);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,14 +44,14 @@ class BlogController extends AbstractController
|
||||||
$comment = new BlogComment();
|
$comment = new BlogComment();
|
||||||
$form = $this->createForm(CommentType::class,$comment);
|
$form = $this->createForm(CommentType::class,$comment);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
if($form->isSubmitted() && $form->isValid() && $this->getUser()){
|
if($form->isSubmitted() && $form->isValid()){
|
||||||
|
echo 11;
|
||||||
$oldComments = $entityManager->getRepository(BlogComment::class)->findBy([
|
$oldComments = $entityManager->getRepository(BlogComment::class)->findBy([
|
||||||
'submitter'=>$this->getUser()
|
'email'=>$comment->getEmail()
|
||||||
],['id'=>'DESC']);
|
],['id'=>'DESC']);
|
||||||
if(count($oldComments) == 0){
|
if(count($oldComments) == 0){
|
||||||
$comment->setDateSubmit(time());
|
$comment->setDateSubmit(time());
|
||||||
$comment->setPost($item);
|
$comment->setPost($item);
|
||||||
$comment->setSubmitter($this->getUser());
|
|
||||||
$entityManager->persist($comment);
|
$entityManager->persist($comment);
|
||||||
$entityManager->flush();
|
$entityManager->flush();
|
||||||
$comment->setBody('');
|
$comment->setBody('');
|
||||||
|
|
|
@ -14,10 +14,6 @@ class BlogComment
|
||||||
#[ORM\Column]
|
#[ORM\Column]
|
||||||
private ?int $id = null;
|
private ?int $id = null;
|
||||||
|
|
||||||
#[ORM\ManyToOne(inversedBy: 'blogComments')]
|
|
||||||
#[ORM\JoinColumn(nullable: false)]
|
|
||||||
private ?User $submitter = null;
|
|
||||||
|
|
||||||
#[ORM\Column(length: 255)]
|
#[ORM\Column(length: 255)]
|
||||||
private ?string $dateSubmit = null;
|
private ?string $dateSubmit = null;
|
||||||
|
|
||||||
|
@ -45,18 +41,6 @@ class BlogComment
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSubmitter(): ?User
|
|
||||||
{
|
|
||||||
return $this->submitter;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setSubmitter(?User $submitter): self
|
|
||||||
{
|
|
||||||
$this->submitter = $submitter;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDateSubmit(): ?string
|
public function getDateSubmit(): ?string
|
||||||
{
|
{
|
||||||
return $this->dateSubmit;
|
return $this->dateSubmit;
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
namespace App\Entity;
|
namespace App\Entity;
|
||||||
|
|
||||||
use App\Repository\SettingsRepository;
|
use App\Repository\SettingsRepository;
|
||||||
|
use Doctrine\DBAL\Types\Types;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
#[ORM\Entity(repositoryClass: SettingsRepository::class)]
|
#[ORM\Entity(repositoryClass: SettingsRepository::class)]
|
||||||
|
@ -34,6 +35,12 @@ class Settings
|
||||||
#[ORM\Column(length: 255, nullable: true)]
|
#[ORM\Column(length: 255, nullable: true)]
|
||||||
private ?string $melipayamakToken = null;
|
private ?string $melipayamakToken = null;
|
||||||
|
|
||||||
|
#[ORM\Column(type: Types::TEXT, nullable: true)]
|
||||||
|
private ?string $siteKeywords = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255, nullable: true)]
|
||||||
|
private ?string $discription = null;
|
||||||
|
|
||||||
public function getId(): ?int
|
public function getId(): ?int
|
||||||
{
|
{
|
||||||
return $this->id;
|
return $this->id;
|
||||||
|
@ -122,4 +129,28 @@ class Settings
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getSiteKeywords(): ?string
|
||||||
|
{
|
||||||
|
return $this->siteKeywords;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setSiteKeywords(?string $siteKeywords): static
|
||||||
|
{
|
||||||
|
$this->siteKeywords = $siteKeywords;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDiscription(): ?string
|
||||||
|
{
|
||||||
|
return $this->discription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDiscription(?string $discription): static
|
||||||
|
{
|
||||||
|
$this->discription = $discription;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ class CommentType extends AbstractType
|
||||||
->add('email',EmailType::class)
|
->add('email',EmailType::class)
|
||||||
->add('website',UrlType::class)
|
->add('website',UrlType::class)
|
||||||
->add('body',TextareaType::class,['attr'=>['autocomplete'=>'off','rows'=>5]])
|
->add('body',TextareaType::class,['attr'=>['autocomplete'=>'off','rows'=>5]])
|
||||||
->add('submit',SubmitType::class)
|
->add('submit',SubmitType::class,['label'=>'SubmitComment'])
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,7 @@ class BlogCommentRepository extends ServiceEntityRepository
|
||||||
public function findLastComments(): array
|
public function findLastComments(): array
|
||||||
{
|
{
|
||||||
return $this->createQueryBuilder('b')
|
return $this->createQueryBuilder('b')
|
||||||
|
->where('b.publish = true')
|
||||||
->orderBy('b.id', 'DESC')
|
->orderBy('b.id', 'DESC')
|
||||||
->setMaxResults(10)
|
->setMaxResults(10)
|
||||||
->getQuery()
|
->getQuery()
|
||||||
|
|
|
@ -7,17 +7,24 @@ namespace App\Service;
|
||||||
use App\Entity\ChangeReport;
|
use App\Entity\ChangeReport;
|
||||||
use App\Entity\Settings;
|
use App\Entity\Settings;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Symfony\Component\HttpFoundation\RequestStack;
|
||||||
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||||
|
|
||||||
class twigFunctions
|
class twigFunctions
|
||||||
{
|
{
|
||||||
private EntityManagerInterface $em;
|
private EntityManagerInterface $em;
|
||||||
|
|
||||||
/**
|
protected Request $request;
|
||||||
* @param EntityManagerInterface $em
|
protected RequestStack $requestStack;
|
||||||
*/
|
|
||||||
public function __construct(EntityManagerInterface $em)
|
function __construct(
|
||||||
|
EntityManagerInterface $entityManager,
|
||||||
|
RequestStack $request
|
||||||
|
)
|
||||||
{
|
{
|
||||||
$this->em = $em;
|
$this->request = $request->getCurrentRequest();
|
||||||
|
$this->em = $entityManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -89,4 +96,8 @@ class twigFunctions
|
||||||
return $this->em->getRepository(Settings::class)->findAll()[0];
|
return $this->em->getRepository(Settings::class)->findAll()[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getCurrentUrl(){
|
||||||
|
return $this->request->getUri();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -33,7 +33,7 @@
|
||||||
{{ item.body }}
|
{{ item.body }}
|
||||||
</td>
|
</td>
|
||||||
<td class="fw-semibold">
|
<td class="fw-semibold">
|
||||||
{{ item.submitter.fullname }}
|
{{ item.name }}
|
||||||
</td>
|
</td>
|
||||||
<td class="fw-semibold">
|
<td class="fw-semibold">
|
||||||
{{ item.post.title }}
|
{{ item.post.title }}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -15,7 +15,7 @@
|
||||||
{% set comments = Blog.getLastComments() %}
|
{% set comments = Blog.getLastComments() %}
|
||||||
{% for comment in comments %}
|
{% for comment in comments %}
|
||||||
<div class="push">
|
<div class="push">
|
||||||
<b class="fw-semibold text-primary">{{ comment.submitter.fullname }}</b> در <a href="{{ path('general_blog_post',{'url':comment.post.url}) }}">{{ comment.post.title }}</a>
|
<b class="fw-semibold text-primary">{{ comment.name }}</b> در <a href="{{ path('general_blog_post',{'url':comment.post.url}) }}">{{ comment.post.title }}</a>
|
||||||
<p class="mt-1"> {{ comment.body }} </p>
|
<p class="mt-1"> {{ comment.body }} </p>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{% extends "blog/base.html.twig" %}
|
{% extends "blog/base.html.twig" %}
|
||||||
|
{% block description %}تازههای حسابداری با وبلاگ حسابیکس{% endblock %}
|
||||||
{% block title %}وبلاگ{% endblock %}
|
{% block title %}وبلاگ{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% for item in items %}
|
{% for item in items %}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
{% extends "blog/base.html.twig" %}
|
{% extends "blog/base.html.twig" %}
|
||||||
{% block title %}{{ item.title }}{% endblock %}
|
{% block title %}{{ item.title }}{% endblock %}
|
||||||
|
{% block description %}{{ item.title }}{% endblock %}
|
||||||
|
{% block keywords %}{{ item.keywords }}{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<main id="main-container">
|
<main id="main-container">
|
||||||
<!-- Hero -->
|
<!-- Hero -->
|
||||||
|
@ -48,46 +50,38 @@
|
||||||
</div>
|
</div>
|
||||||
<!-- END Actions -->
|
<!-- END Actions -->
|
||||||
<div class="px-4 pt-4 rounded bg-body-extra-light">
|
<div class="px-4 pt-4 rounded bg-body-extra-light">
|
||||||
{% if not app.user %}
|
<div class="rounded bg-light px-2 pt-2 pb-1">
|
||||||
<div class="alert alert-info">
|
<h5>ارسال دیدگاه</h5>
|
||||||
برای ارسال دیدگاه به حساب خود وارد شوید.
|
{{ form_start(form) }}
|
||||||
<br>
|
{{ form_errors(form) }}
|
||||||
<a href="/login">ورود</a> | <a href="{{ twigFunctions.systemSettings().appSite }}/register">عضویت</a>
|
<div class="container">
|
||||||
</div>
|
<div class="row">
|
||||||
{% else %}
|
<div class="col-sm-12 col-md-12">
|
||||||
<div class="rounded bg-light px-2 pt-2 pb-1">
|
{{ form_row(form.name,{'attr':{'class':'required'}}) }}
|
||||||
<h5>ارسال دیدگاه</h5>
|
</div>
|
||||||
{{ form_start(form) }}
|
<div class="col-sm-12 col-md-6">
|
||||||
{{ form_errors(form) }}
|
{{ form_row(form.email) }}
|
||||||
<div class="container">
|
</div>
|
||||||
<div class="row">
|
<div class="col-sm-12 col-md-6">
|
||||||
<div class="col-sm-12 col-md-12">
|
{{ form_row(form.website) }}
|
||||||
{{ form_row(form.name) }}
|
</div>
|
||||||
</div>
|
<div class="col-sm-12 col-md-12">
|
||||||
<div class="col-sm-12 col-md-6">
|
{{ form_row(form.body) }}
|
||||||
{{ form_row(form.email) }}
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-12 col-md-6">
|
|
||||||
{{ form_row(form.website) }}
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-12 col-md-12">
|
|
||||||
{{ form_row(form.body) }}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ form_end(form) }}
|
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{{ form_end(form) }}
|
||||||
|
</div>
|
||||||
<div class="pt-3 fs-sm">
|
<div class="pt-3 fs-sm">
|
||||||
<h3>دیدگاهها</h3>
|
<h3>دیدگاهها</h3>
|
||||||
{% for comment in comments %}
|
{% for comment in comments %}
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<span class="flex-shrink-0 img-link me-2">
|
<span class="flex-shrink-0 img-link me-2">
|
||||||
<img alt="" class="img-avatar img-avatar32 img-avatar-thumb" src="{{ asset('https://www.gravatar.com/avatar/' ~ twigFunctions.gravatarHash(comment.submitter.email)) }}">
|
<img alt="" class="img-avatar img-avatar32 img-avatar-thumb" src="{{ asset('https://www.gravatar.com/avatar/' ~ twigFunctions.gravatarHash(comment.email)) }}">
|
||||||
</span>
|
</span>
|
||||||
<div class="flex-grow-1">
|
<div class="flex-grow-1">
|
||||||
<p class="mb-1">
|
<p class="mb-1">
|
||||||
<a class="fw-semibold" href="javascript:void(0)">{{ comment.submitter.fullname }}</a>
|
<a class="fw-semibold" href="javascript:void(0)">{{ comment.name }}</a>
|
||||||
{{ comment.body }}
|
{{ comment.body }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -10,6 +10,7 @@ Forget Password: بازیابی گذرواژه
|
||||||
Name: نام و نام خانوادگی
|
Name: نام و نام خانوادگی
|
||||||
Full name: نام و نام خانوادگی
|
Full name: نام و نام خانوادگی
|
||||||
Submit: ثبت
|
Submit: ثبت
|
||||||
|
SubmitComment : ثبت دیدگاه
|
||||||
Keshvar: کشور
|
Keshvar: کشور
|
||||||
Intero: خلاصه
|
Intero: خلاصه
|
||||||
Img: تصویر شاخص
|
Img: تصویر شاخص
|
||||||
|
|
Loading…
Reference in a new issue