12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- /**
- * Define a issuereport.
- * @author Administrateur
- * @category Plugin
- * @license copyright
- */
- class IssueReport extends Entity{
- public $id,$comment,$browser,$browserVersion,$online,$os,$from,$width,$height,$ip,$history,$state,$assign;
- protected $TABLE_NAME = 'issue_report';
- public $fields =
- array(
- 'id' => 'key',
- 'browser' => 'string',
- 'browserVersion' => 'string',
- 'online' => 'boolean',
- 'state' => 'string',
- 'assign' => 'string',
- 'os' => 'string',
- 'from' => 'string',
- 'width' => 'int',
- 'height' => 'int',
- 'history' => 'longstring',
- 'ip' => 'string'
- );
- public static function states($key=null){
- $states = array(
- 'open' => array('icon'=>'far fa-clock','label'=>'Ouvert','color'=>'#3c3c3c'),
- 'closed' => array('icon'=>'fas fa-check','label'=>'Résolu','color'=>'#2cbe4e'),
- 'canceled' => array('icon'=>'fas fa-ban','label'=>'Annulé','color'=>'#cb2431'),
- );
- if(!isset($key)) return $states;
- return isset($states[$key]) ? $states[$key] : array();
- }
- public function remove($cascading = true){
- self::deleteById($this->id);
- if($cascading){
- require_once(__DIR__.SLASH.'IssueEvent.class.php');
- foreach(IssueEvent::loadAll(array('issue'=>$this->id)) as $event){
- $event->remove();
- }
- }
- }
- }
- ?>
|