Can you add such a feature that a user can insert a text into a ticket being closed from a predefined set of sentences?
The diffs and sql script are attached and tested with 2.3.3.
Thanks.

--
Yasir M. Arsanukaev - IT dept
JSC "Amurmetal", Russian Federation
phone +7 (4217) 529-576

# ----------------------------------------------------------
#  create table note_library
# ----------------------------------------------------------
CREATE TABLE note_library (
    id SMALLINT NOT NULL AUTO_INCREMENT,
    name VARCHAR (250) NOT NULL,
    comments VARCHAR (250),
    type_id SMALLINT NOT NULL,
    valid_id SMALLINT NOT NULL,
    create_time DATETIME NOT NULL,
    create_by INTEGER NOT NULL,
    change_time DATETIME NOT NULL,
    change_by INTEGER NOT NULL,
    PRIMARY KEY(id),
    UNIQUE (name)
);

ALTER TABLE note_library ADD FOREIGN KEY (create_by) REFERENCES system_user 
(id);
ALTER TABLE note_library ADD FOREIGN KEY (change_by) REFERENCES system_user 
(id);
ALTER TABLE note_library ADD FOREIGN KEY (valid_id) REFERENCES valid (id);


# ----------------------------------------------------------
#  insert into table note_library
# ----------------------------------------------------------
INSERT INTO note_library (name, comments, type_id, valid_id, create_by, 
create_time, change_by, change_time)
    VALUES
    ('User made everything himself/herself.', 'User made everything 
himself/herself', 1, 1, 1, current_timestamp, 1, current_timestamp);
INSERT INTO note_library (name, comments, type_id, valid_id, create_by, 
create_time, change_by, change_time)
    VALUES
    ('Program installation completed...', 'Program installation...', 3, 1, 1, 
current_timestamp, 1, current_timestamp);
INSERT INTO note_library (name, comments, type_id, valid_id, create_by, 
create_time, change_by, change_time)
    VALUES
    ('closed unsuccessful', 'Ticket is closed unsuccessful.', 3, 1, 1, 
current_timestamp, 1, current_timestamp);
--- AgentTicketClose.dtl.dist   2008-12-30 09:58:09.000000000 +1000
+++ AgentTicketClose.dtl        2008-12-30 09:43:00.000000000 +1000
@@ -200,6 +200,16 @@
                     $Env{"Box0"}<a href="#attachment" 
onmouseover="window.status='$JSText{"Attachments"}'; return true;" 
onmouseout="window.status='';"><img border="0" 
src="$Env{"Images"}attach.png">$Text{"Attachments"}</a>$Env{"Box1"}
                   </td>
                 </tr>
+
+
+<!-- dtl:block:AutoText -->
+                <tr>
+                  <td colspan="2" class="contentkey">$Data{"AutoText"}:</td>
+                  <td class="contentvalue">$Data{"AutoTextStrg"}</td>
+                </tr>
+<!-- dtl:block:AutoText -->
+
+
                 <tr>
                   <td colspan="2" class="contentkey">$Text{"Text"}:</td>
                   <td class="contentvalue">
--- AgentTicketClose.pm.dist    2008-12-30 09:57:32.000000000 +1000
+++ AgentTicketClose.pm 2008-12-30 09:55:54.000000000 +1000
@@ -1075,6 +1075,8 @@
             );
         }
 
+
+
         # show attachments
         for my $DataRef ( @{ $Param{Attachments} } ) {
             $Self->{LayoutObject}->Block(
@@ -1083,6 +1085,37 @@
             );
         }
 
+    my %AutoText = () ;
+    my %NoteTypes1 = $Self->{DBObject}->GetTableData(
+        Table => 'note_library',
+        Valid => 1,
+        What => 'id, name'
+    );
+    
+    $AutoText{SelectedID}='';
+    $AutoText{Selected}='';
+    
+    my %NoteTypes2 = () ;
+    foreach my $Key (keys %NoteTypes1) {
+       $AutoText{Selected}=$NoteTypes1{$Key} ;
+       $NoteTypes2{$NoteTypes1{$Key}}=$NoteTypes1{$Key};
+    }
+    my %Data1=();
+    $Data1{'AutoTextStrg'} = $Self->{LayoutObject}->OptionStrgHashRef(
+        Data => \%NoteTypes2,
+        Name => 'NewAutoTextID',
+        %AutoText,
+    );
+    $Data1{'AutoTextStrg'}.="<input type=button value=+ name=NewAutoButtonID " 
;
+    
$Data1{'AutoTextStrg'}.="OnClick=\"Body.value+=NewAutoTextID.options[NewAutoTextID.selectedIndex].value
 ;\">";
+
+    $Data1{'AutoText'}='AutoText';
+ 
+    $Self->{LayoutObject}->Block(
+        Name => 'AutoText',
+        Data => {%Data1},
+    );
+
         # build ArticleTypeID string
         my %ArticleType = ();
         if ( !$Param{ArticleTypeID} ) {
_______________________________________________
OTRS mailing list: dev - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/dev
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev

Reply via email to