[go: up one dir, main page]

Menu

[r19]: / questions.php  Maximize  Restore  History

Download this file

265 lines (215 with data), 9.9 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
<?php
$pageRef='Customer care';
include('includes/header.php');
?>
<script>
function setUnaMenuEventHandlers(){
setTimeout("$$('a.aAnsOpen').each(function(s){Event.observe(s,'click',function(){questionTableLoad('ans', 'qTable','qMenu','w');})})", 1);
setTimeout("$$('a.aFaqOpen').each(function(s){Event.observe(s,'click',function(){questionTableLoad('faq', 'qTable','qMenu','w');})})", 1);
setTimeout("$$('a.aGoToLabel').each(function(s){Event.observe(s,'click',function(){labelManagement();})})", 1);
setTimeout("$$('a.aGoToCC').each(function(s){Event.observe(s,'click',function(){backToCCare();})})", 1);
}
function setAnsMenuEventHandlers(){
setTimeout("$$('a.aUnaOpen').each(function(s){Event.observe(s,'click',function(){questionTableLoad('una', 'qTable','qMenu','w');})})", 1);
setTimeout("$$('a.aFaqOpen').each(function(s){Event.observe(s,'click',function(){questionTableLoad('faq', 'qTable','qMenu','w');})})", 1);
setTimeout("$$('a.aGoToLabel').each(function(s){Event.observe(s,'click',function(){labelManagement();})})", 1);
setTimeout("$$('a.aGoToCC').each(function(s){Event.observe(s,'click',function(){backToCCare();})})", 1);
}
function setFaqMenuEventHandlers(){
setTimeout("$$('a.aUnaOpen').each(function(s){Event.observe(s,'click',function(){questionTableLoad('una', 'qTable','qMenu','w');})})", 1);
setTimeout("$$('a.aAnsOpen').each(function(s){Event.observe(s,'click',function(){questionTableLoad('ans', 'qTable','qMenu','w');})})", 1);
setTimeout("$$('a.aGoToLabel').each(function(s){Event.observe(s,'click',function(){labelManagement();})})", 1);
setTimeout("$$('a.aGoToCC').each(function(s){Event.observe(s,'click',function(){backToCCare();})})", 1);
}
function setUnansweredEventHandlers(){
setTimeout("$$('a.aUnansweredEdit').each(function(s){Event.observe(s,'click',function(){answerQuestion(s);})})", 1);
}
function setAnsweredEventHandlers(){
setTimeout("$$('a.aAnsweredModify').each(function(s){Event.observe(s,'click',function(){modifyAnsweredQuestion(s);})})", 1);
setTimeout("$$('a.aAnsweredDelete').each(function(s){Event.observe(s,'click',function(){deleteAnsweredQuestion(s);})})", 1);
setTimeout("$$('select.sAChapter').each(function(s){Event.observe(s,'change',function(){moveAnsweredQuestion(s);})})", 1);
}
function setFaqEventHandlers(){
setTimeout("$$('a.aFaqDelete').each(function(s){Event.observe(s,'click',function(){deleteFaq(s);})})", 1);
setTimeout("$$('select.sNewChapter').each(function(s){Event.observe(s,'change',function(){moveFaq(s);})})", 1);
}
function successInDeletingFaqF(transport){
var args=transport.responseText.evalJSON();
//Success in update request
//Operation result advice
$('qResult').style.display='block';
$('qResult').innerHTML=args.opText;
if(parseInt(args.opResult) == 0){
//Success in update operation
questionTableLoad('faq', 'qTable', 'qMenu', 'w');
}else{
//Failure in update operation
}
}
function failureInDeletingFaqF(){
//Failure in update request
alert('<?php echo _T("NI_questions_IV"); ?>');
}
function deleteFaq(elem){
var args = elem.name.split("_");
var qid = args[0];
result = confirm('<?php echo _T("NI_questions_III"); ?>');
if(result != 0){
OL_deleteFaq(qid, {onSuccess: successInDeletingFaqF, onFailure: failureInDeletingFaqF});
}else{
}
}
function answerQuestion(elem){
var args = elem.name.split("_");
var qid = args[0];
window.location.href='http://<?php echo $_SERVER['SERVER_ADDR']?>/Oreste/answerForm.php?qid='+qid;
}
function modifyAnsweredQuestion(elem){
var args = elem.name.split("_");
var qid = args[0];
window.location.href='http://<?php echo $_SERVER['SERVER_ADDR']?>/Oreste/questionForm.php?qid='+qid;
}
function successInMovingQuestionF(transport){
var args=transport.responseText.evalJSON();
//Success in move request
//Operation result advice
$('qResult').style.display='block';
$('qResult').innerHTML=args.opText;
if(parseInt(args.opResult) == 0){
//Success in move operation
questionTableLoad('ans', 'qTable', 'qMenu', 'w');
}else{
//Failure in move operation
}
}
function failureInMovingQuestionF(){
//Failure in move request
alert('<?php echo _T("NI_questions_V"); ?>');
}
function moveAnsweredQuestion(elem){
var args = elem.name.split("_");
var qid = args[0];
var label = $F('quest'+qid);
OL_moveAnsweredQuestion(qid, label, {onSuccess: successInMovingQuestionF, onFailure: failureInMovingQuestionF});
}
function successInDeletingQuestionF(transport){
var args=transport.responseText.evalJSON();
//Success in delete request
//Operation result advice
$('qResult').style.display='block';
$('qResult').innerHTML=args.opText;
if(parseInt(args.opResult) == 0){
//Success in delete operation
questionTableLoad('ans', 'qTable', 'qMenu', 'w');
}else{
//Failure in delete operation
}
}
function failureInDeletingQuestionF(){
//Failure in delete request
alert('<?php echo _T("NI_questions_I"); ?>');
}
function deleteAnsweredQuestion(elem){
var args = elem.name.split("_");
var qid = args[0];
// ***************************************************************************************************************************************************
// * Confirm sentence: 'Do you want to delete the question?\\n\\nNote: all the question informations will be erased.'
// ***************************************************************************************************************************************************
answer = confirm('<?php echo _T("NI_questions_II"); ?>');
if(answer != 0){
OL_deleteAnsweredQuestion(qid, {onSuccess: successInDeletingQuestionF, onFailure: failureInDeletingQuestionF});
}
}
function successInMovingFaqF(transport){
var args=transport.responseText.evalJSON();
//Success in move request
//Operation result advice
$('qResult').style.display='block';
$('qResult').innerHTML=args.opText;
if(parseInt(args.opResult) == 0){
//Success in move operation
questionTableLoad('faq', 'qTable', 'qMenu', 'w');
}else{
//Failure in move operation
}
}
function failureInMovingFaqF(){
//Failure in move request
alert('<?php echo _T("NI_questions_V"); ?>');
}
function moveFaq(elem){
var args = elem.name.split("_");
var qid = args[0];
var label = $F('sel_'+qid);
OL_moveAnsweredQuestion(qid, label, {onSuccess: successInMovingFaqF, onFailure: failureInMovingFaqF});
}
function labelManagement(){
window.location.href='http://<?php echo $_SERVER['SERVER_ADDR']?>/Oreste/labels.php';
}
function questionTableLoad(tableType, tableId, menuId, priv){
if(tableType == 'una'){
OL_unaQuestTableLoad(priv, {elementToFill: tableId, onSuccess: setUnansweredEventHandlers});
OL_unaMenuTableLoad({elementToFill: menuId, onSuccess: setUnaMenuEventHandlers});
}else if(tableType == 'ans'){
OL_ansQuestTableLoad(priv, {elementToFill: tableId, onSuccess: setAnsweredEventHandlers});
OL_ansMenuTableLoad({elementToFill: menuId, onSuccess: setAnsMenuEventHandlers});
}else if(tableType == 'faq'){
OL_faqsTableLoad(priv, {elementToFill: tableId, onSuccess: setFaqEventHandlers});
OL_faqsMenuTableLoad({elementToFill: menuId, onSuccess: setFaqMenuEventHandlers});
}else{
OL_unaQuestTableLoad(priv, {elementToFill: tableId, onSuccess: setUnansweredEventHandlers});
OL_unaMenuTableLoad({elementToFill: menuId, onSuccess: setUnaMenuEventHandlers});
}
}
function backToCCare(){
window.location.href='http://<?php echo $_SERVER['SERVER_ADDR']?>/Oreste/customerCare.php';
}
</script>
<div id="qResult" class="OpResult"></div>
<div class="Columns">
<div class="Column1">
<!-- *********************************************************** -->
<!-- * Menu tab * -->
<!-- *********************************************************** -->
<div class="Block"><div class="BlockBL"><div></div></div><div class="BlockBR"><div></div></div><div class="BlockTL"></div><div class="BlockTR"><div></div></div><div class="BlockT"></div><div class="BlockR"><div></div></div><div class="BlockB"><div></div></div><div class="BlockL"></div><div class="BlockC"></div><div class="BlockContent"><span class="BlockHeader"><span><?php echo _T("Actions") ?></span></span><div class="BlockContentBorder">
<ul id="qMenu">
</ul>
</div>
</div>
</div>
</div>
<div class="MainColumn">
<!-- *********************************************************** -->
<!-- * Question tab * -->
<!-- *********************************************************** -->
<div class="Block"><div class="BlockBL"><div></div></div><div class="BlockBR"><div></div></div><div class="BlockTL"></div><div class="BlockTR"><div></div></div><div class="BlockT"></div><div class="BlockR"><div></div></div><div class="BlockB"><div></div></div><div class="BlockL"></div><div class="BlockC"></div><div class="BlockContent"><div class="BlockContentBorder" id="qTable">
</div>
</div>
</div>
</div>
</div>
<script>
// ************************************************************
// * Observe window load event to call the init page function *
// ************************************************************
Event.observe(window, 'load', function(){
// *****************************************
// * Load faqs table for the first time *
// *****************************************
questionTableLoad('<?php echo $_GET[qType] ?>', 'qTable', 'qMenu', 'w');
// **************************
// * Install event handlers *
// **************************
Event.observe('qResult', 'mouseover', function(){OL_makeThisElementInvisible('qResult');});
// *********************
// * Install validator *
// *********************
// formValidationRules = new Validation('formToValidate',{immediate:true, onSubmit:false, useTitles:true, stopOnFirst:false});
});
</script>
<!-- tags opened in the header -->
</div>
</div>
</div>
</body>
</html>