|
@@ -178,6 +178,45 @@ class Ticket extends CommonObject
|
|
|
*/
|
|
|
public $regeximgext = '\.jpg|\.jpeg|\.bmp|\.gif|\.png|\.tiff';
|
|
|
|
|
|
+ /**
|
|
|
+ * Status
|
|
|
+ */
|
|
|
+ const STATUS_NOT_READ = 0;
|
|
|
+ const STATUS_READ = 1;
|
|
|
+ const STATUS_ASSIGNED = 2;
|
|
|
+ const STATUS_IN_PROGRESS = 3;
|
|
|
+ const STATUS_NEED_MORE_INFO = 5;
|
|
|
+ const STATUS_WAITING = 7;
|
|
|
+ const STATUS_CLOSED = 8;
|
|
|
+ const STATUS_CANCELED = 9;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
|
|
|
+ * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
|
|
+ * 'label' the translation key.
|
|
|
+ * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM)
|
|
|
+ * 'position' is the sort order of field.
|
|
|
+ * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
|
|
+ * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
|
|
+ * 'noteditable' says if field is not editable (1 or 0)
|
|
|
+ * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
|
|
|
+ * 'index' if we want an index in database.
|
|
|
+ * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
|
|
|
+ * 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
|
|
|
+ * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
|
|
|
+ * 'css' is the CSS style to use on field. For example: 'maxwidth200'
|
|
|
+ * 'help' is a string visible as a tooltip on field
|
|
|
+ * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
|
|
|
+ * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code.
|
|
|
+ * 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel")
|
|
|
+ * 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1.
|
|
|
+ * 'comment' is not used. You can store here any text of your choice. It is not used by application.
|
|
|
+ *
|
|
|
+ * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor.
|
|
|
+ */
|
|
|
+
|
|
|
+ // BEGIN MODULEBUILDER PROPERTIES
|
|
|
public $fields = array(
|
|
|
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'position'=>1, 'visible'=>-2, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id"),
|
|
|
'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>5, 'notnull'=>1, 'index'=>1),
|
|
@@ -187,7 +226,7 @@ class Ticket extends CommonObject
|
|
|
'origin_email' => array('type'=>'mail', 'label'=>'OriginEmail', 'visible'=>-2, 'enabled'=>1, 'position'=>16, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'css'=>'tdoverflowmax150'),
|
|
|
'subject' => array('type'=>'varchar(255)', 'label'=>'Subject', 'visible'=>1, 'enabled'=>1, 'position'=>18, 'notnull'=>-1, 'searchall'=>1, 'help'=>"", 'css'=>'maxwidth200', 'autofocusoncreate'=>1),
|
|
|
'type_code' => array('type'=>'varchar(32)', 'label'=>'Type', 'visible'=>1, 'enabled'=>1, 'position'=>20, 'notnull'=>-1, 'searchall'=>1, 'help'=>"", 'css'=>'maxwidth150'),
|
|
|
- 'category_code' => array('type'=>'varchar(32)', 'label'=>'TicketGroup', 'visible'=>-1, 'enabled'=>1, 'position'=>21, 'notnull'=>-1, 'help'=>"", 'css'=>'maxwidth100'),
|
|
|
+ 'category_code' => array('type'=>'varchar(32)', 'label'=>'TicketCategory', 'visible'=>-1, 'enabled'=>1, 'position'=>21, 'notnull'=>-1, 'help'=>"", 'css'=>'maxwidth100'),
|
|
|
'severity_code' => array('type'=>'varchar(32)', 'label'=>'Severity', 'visible'=>1, 'enabled'=>1, 'position'=>22, 'notnull'=>-1, 'help'=>"", 'css'=>'maxwidth100'),
|
|
|
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToThirparty", 'css'=>'tdoverflowmax150 maxwidth150onsmartphone'),
|
|
|
'notify_tiers_at_create' => array('type'=>'integer', 'label'=>'NotifyThirdparty', 'visible'=>-1, 'enabled'=>0, 'position'=>51, 'notnull'=>1, 'index'=>1),
|
|
@@ -204,18 +243,7 @@ class Ticket extends CommonObject
|
|
|
'fk_statut' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>600, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array(0 => 'Unread', 1 => 'Read', 3 => 'Answered', 4 => 'Assigned', 5 => 'InProgress', 6 => 'Waiting', 8 => 'Closed', 9 => 'Deleted')),
|
|
|
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900),
|
|
|
);
|
|
|
-
|
|
|
- /**
|
|
|
- * Status
|
|
|
- */
|
|
|
- const STATUS_NOT_READ = 0;
|
|
|
- const STATUS_READ = 1;
|
|
|
- const STATUS_ASSIGNED = 2;
|
|
|
- const STATUS_IN_PROGRESS = 3;
|
|
|
- const STATUS_NEED_MORE_INFO = 5;
|
|
|
- const STATUS_WAITING = 7;
|
|
|
- const STATUS_CLOSED = 8;
|
|
|
- const STATUS_CANCELED = 9;
|
|
|
+ // END MODULEBUILDER PROPERTIES
|
|
|
|
|
|
|
|
|
/**
|