Skip to content

Commit

Permalink
optimisation
Browse files Browse the repository at this point in the history
changed default ordering on tiket list to done yes/no
added filter in tickets to simlify archivig last week on monday, added experimental public access to add tickets.
  • Loading branch information
szpitalnicy committed Jul 8, 2019
1 parent 28efbac commit c9605e9
Show file tree
Hide file tree
Showing 46 changed files with 876 additions and 482 deletions.
1 change: 1 addition & 0 deletions admin/language/en-GB.com_omhelpdesk.ini
Expand Up @@ -40,6 +40,7 @@ OMHELPDESK_ERROR_INCORRECT_FORMAT_EXPECTED_DIGITS_MAX_DECIMALS_MAX="Incorrect fo
OMHELPDESK_ERROR_INVALID_QUERY="Invalid query."
OMHELPDESK_ERROR_JOOMLA_3X_IS_REQUIRED="Joomla 3.x is required."
OMHELPDESK_FIELD_CHECK_MIME_TYPE="Check MIME type"
OMHELPDESK_FIELD_DONE="Done"
OMHELPDESK_FIELD_ORDERING="Ordering"
OMHELPDESK_FIELD_PERMISSIONS="Permissions"
OMHELPDESK_FIELD_PILOTS_USERNAME="Pilot's username"
Expand Down
2 changes: 2 additions & 0 deletions admin/language/en-GB.com_omhelpdesk.sys.ini
Expand Up @@ -55,13 +55,15 @@ OMHELPDESK_LAYOUT_SHOW_TEAMS_LAYOUT="Show Teams layout"
OMHELPDESK_LAYOUT_SHOW_TEAM_LAYOUT="Show Team layout"
OMHELPDESK_LAYOUT_SHOW_TICKETS_LAYOUT="Show Tickets layout"
OMHELPDESK_LAYOUT_SHOW_TICKET_LAYOUT="Show Ticket layout"
OMHELPDESK_LAYOUT_SHOW_TICKET_PUBLIC_LAYOUT="Show Ticket public layout"
OMHELPDESK_LAYOUT_SHOW_TIME_REPORT_LAYOUT="Show Time report layout"
OMHELPDESK_LAYOUT_SPRINT="Sprint"
OMHELPDESK_LAYOUT_SPRINTS="Sprints"
OMHELPDESK_LAYOUT_TEAM="Team"
OMHELPDESK_LAYOUT_TEAMS="Teams"
OMHELPDESK_LAYOUT_TICKET="Ticket"
OMHELPDESK_LAYOUT_TICKETS="Tickets"
OMHELPDESK_LAYOUT_TICKET_PUBLIC="Ticket public"
OMHELPDESK_LAYOUT_TIME_REPORT="Time report"
OMHELPDESK_MENU_OM_HELPDESK="OM Helpdesk"
OMHELPDESK_VIEW_CATEGORIES="Categories"
Expand Down
58 changes: 29 additions & 29 deletions admin/models/category.php
Expand Up @@ -67,25 +67,25 @@ public function __construct($config = array())
*/
public function delete(&$pks)
{
if (!count( $pks ))
return true;
if (!count( $pks ))
return true;

//Integrity : Restrict delete categories which are referred by tickets
$model = CkJModel::getInstance('ticket', 'OmhelpdeskModel');
$model->integrityRestrict('category', $pks,
// Label Key
'ordering',
//Integrity : Restrict delete categories which are referred by tickets
$model = CkJModel::getInstance('ticket', 'OmhelpdeskModel');
$model->integrityRestrict('category', $pks,
// Label Key
'done',

// Parent Label Key
'ordering'
);
// Parent Label Key
'ordering'
);

if (!parent::delete($pks))
return false;
if (!parent::delete($pks))
return false;



return true;
return true;
}

/**
Expand Down Expand Up @@ -313,26 +313,26 @@ protected function prepareTable($table)
*/
public function save($data)
{
//Convert from a non-SQL formated date (modification_date)
$data['modification_date'] = OmhelpdeskHelperDates::getSqlDate($data['modification_date'], array('Y-m-d H:i'), true, 'USER_UTC');
//Convert from a non-SQL formated date (modification_date)
$data['modification_date'] = OmhelpdeskHelperDates::getSqlDate($data['modification_date'], array('Y-m-d H:i'), true, 'USER_UTC');

//Convert from a non-SQL formated date (creation_date)
$data['creation_date'] = OmhelpdeskHelperDates::getSqlDate($data['creation_date'], array('Y-m-d H:i'), true, 'USER_UTC');
//Some security checks
$acl = OmhelpdeskHelper::getActions();
//Convert from a non-SQL formated date (creation_date)
$data['creation_date'] = OmhelpdeskHelperDates::getSqlDate($data['creation_date'], array('Y-m-d H:i'), true, 'USER_UTC');
//Some security checks
$acl = OmhelpdeskHelper::getActions();

//Secure the published tag if not allowed to change
if (isset($data['published']) && !$acl->get('core.edit.state'))
unset($data['published']);
//Secure the published tag if not allowed to change
if (isset($data['published']) && !$acl->get('core.edit.state'))
unset($data['published']);

//Secure the author key if not allowed to change
if (isset($data['created_by']) && !$acl->get('core.edit'))
unset($data['created_by']);
//Secure the author key if not allowed to change
if (isset($data['created_by']) && !$acl->get('core.edit'))
unset($data['created_by']);

if (parent::save($data)) {
return true;
}
return false;
if (parent::save($data)) {
return true;
}
return false;


}
Expand Down
44 changes: 22 additions & 22 deletions admin/models/pilot.php
Expand Up @@ -67,25 +67,25 @@ public function __construct($config = array())
*/
public function delete(&$pks)
{
if (!count( $pks ))
return true;
if (!count( $pks ))
return true;

//Integrity : Restrict delete pilots which are referred by tickets
$model = CkJModel::getInstance('ticket', 'OmhelpdeskModel');
$model->integrityRestrict('pilot', $pks,
// Label Key
'ordering',
//Integrity : Restrict delete pilots which are referred by tickets
$model = CkJModel::getInstance('ticket', 'OmhelpdeskModel');
$model->integrityRestrict('pilot', $pks,
// Label Key
'done',

// Parent Label Key
'pilots_username'
);
// Parent Label Key
'pilots_username'
);

if (!parent::delete($pks))
return false;
if (!parent::delete($pks))
return false;



return true;
return true;
}

/**
Expand Down Expand Up @@ -265,17 +265,17 @@ protected function prepareQuery(&$query, $pk)
public function save($data)
{

//Some security checks
$acl = OmhelpdeskHelper::getActions();
//Some security checks
$acl = OmhelpdeskHelper::getActions();

//Secure the published tag if not allowed to change
if (isset($data['published']) && !$acl->get('core.edit.state'))
unset($data['published']);
//Secure the published tag if not allowed to change
if (isset($data['published']) && !$acl->get('core.edit.state'))
unset($data['published']);

if (parent::save($data)) {
return true;
}
return false;
if (parent::save($data)) {
return true;
}
return false;


}
Expand Down
44 changes: 22 additions & 22 deletions admin/models/requestor.php
Expand Up @@ -67,25 +67,25 @@ public function __construct($config = array())
*/
public function delete(&$pks)
{
if (!count( $pks ))
return true;
if (!count( $pks ))
return true;

//Integrity : Restrict delete requestors which are referred by tickets
$model = CkJModel::getInstance('ticket', 'OmhelpdeskModel');
$model->integrityRestrict('requester', $pks,
// Label Key
'ordering',
//Integrity : Restrict delete requestors which are referred by tickets
$model = CkJModel::getInstance('ticket', 'OmhelpdeskModel');
$model->integrityRestrict('requester', $pks,
// Label Key
'done',

// Parent Label Key
'requesters_name'
);
// Parent Label Key
'requesters_name'
);

if (!parent::delete($pks))
return false;
if (!parent::delete($pks))
return false;



return true;
return true;
}

/**
Expand Down Expand Up @@ -266,17 +266,17 @@ protected function prepareQuery(&$query, $pk)
public function save($data)
{

//Some security checks
$acl = OmhelpdeskHelper::getActions();
//Some security checks
$acl = OmhelpdeskHelper::getActions();

//Secure the published tag if not allowed to change
if (isset($data['published']) && !$acl->get('core.edit.state'))
unset($data['published']);
//Secure the published tag if not allowed to change
if (isset($data['published']) && !$acl->get('core.edit.state'))
unset($data['published']);

if (parent::save($data)) {
return true;
}
return false;
if (parent::save($data)) {
return true;
}
return false;


}
Expand Down
44 changes: 22 additions & 22 deletions admin/models/sdepartment.php
Expand Up @@ -67,25 +67,25 @@ public function __construct($config = array())
*/
public function delete(&$pks)
{
if (!count( $pks ))
return true;
if (!count( $pks ))
return true;

//Integrity : Restrict delete sdepartments which are referred by requestors
$model = CkJModel::getInstance('requestor', 'OmhelpdeskModel');
$model->integrityRestrict('department', $pks,
// Label Key
'requesters_name',
//Integrity : Restrict delete sdepartments which are referred by requestors
$model = CkJModel::getInstance('requestor', 'OmhelpdeskModel');
$model->integrityRestrict('department', $pks,
// Label Key
'requesters_name',

// Parent Label Key
'published'
);
// Parent Label Key
'published'
);

if (!parent::delete($pks))
return false;
if (!parent::delete($pks))
return false;



return true;
return true;
}

/**
Expand Down Expand Up @@ -263,17 +263,17 @@ protected function prepareQuery(&$query, $pk)
public function save($data)
{

//Some security checks
$acl = OmhelpdeskHelper::getActions();
//Some security checks
$acl = OmhelpdeskHelper::getActions();

//Secure the published tag if not allowed to change
if (isset($data['published']) && !$acl->get('core.edit.state'))
unset($data['published']);
//Secure the published tag if not allowed to change
if (isset($data['published']) && !$acl->get('core.edit.state'))
unset($data['published']);

if (parent::save($data)) {
return true;
}
return false;
if (parent::save($data)) {
return true;
}
return false;


}
Expand Down
44 changes: 22 additions & 22 deletions admin/models/sprint.php
Expand Up @@ -67,25 +67,25 @@ public function __construct($config = array())
*/
public function delete(&$pks)
{
if (!count( $pks ))
return true;
if (!count( $pks ))
return true;

//Integrity : Restrict delete sprints which are referred by tickets
$model = CkJModel::getInstance('ticket', 'OmhelpdeskModel');
$model->integrityRestrict('sprint', $pks,
// Label Key
'ordering',
//Integrity : Restrict delete sprints which are referred by tickets
$model = CkJModel::getInstance('ticket', 'OmhelpdeskModel');
$model->integrityRestrict('sprint', $pks,
// Label Key
'done',

// Parent Label Key
'sprint_name'
);
// Parent Label Key
'sprint_name'
);

if (!parent::delete($pks))
return false;
if (!parent::delete($pks))
return false;



return true;
return true;
}

/**
Expand Down Expand Up @@ -263,17 +263,17 @@ protected function prepareQuery(&$query, $pk)
public function save($data)
{

//Some security checks
$acl = OmhelpdeskHelper::getActions();
//Some security checks
$acl = OmhelpdeskHelper::getActions();

//Secure the published tag if not allowed to change
if (isset($data['published']) && !$acl->get('core.edit.state'))
unset($data['published']);
//Secure the published tag if not allowed to change
if (isset($data['published']) && !$acl->get('core.edit.state'))
unset($data['published']);

if (parent::save($data)) {
return true;
}
return false;
if (parent::save($data)) {
return true;
}
return false;


}
Expand Down

0 comments on commit c9605e9

Please sign in to comment.