[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/workflow/doc/examples/ -> testMail.xml (source)

   1  <process>
   2    <name>testMail</name>
   3    <isValid>y</isValid>
   4    <version>1.1</version>
   5    <isActive>y</isActive>
   6     <description>This process tests the mail agent for egroupware</description>
   7    <lastModif>28/10/2005 [10:34:59]</lastModif>
   8    <sharedCode><![CDATA[<?php
   9  //***************************************************************************
  10  //* copyleft Regis dot Leroy at glconseil dot com                           *
  11  //* This program is free software; you can redistribute it and/or modify it *
  12  //*  under the terms of the GNU General Public License as published by the  *
  13  //*  Free Software Foundation; either version 2 of the License, or (at your *
  14  //*  option) any later version.                                             *
  15  //***************************************************************************
  16  ?>  ]]></sharedCode>
  17    <configs>
  18      <config>
  19        <wf_config_name>display_please_wait_message</wf_config_name>
  20        <wf_config_value></wf_config_value>
  21        <wf_config_value_int>1</wf_config_value_int>
  22      </config>
  23      <config>
  24        <wf_config_name>use_automatic_parsing</wf_config_name>
  25        <wf_config_value></wf_config_value>
  26        <wf_config_value_int>1</wf_config_value_int>
  27      </config>
  28      <config>
  29        <wf_config_name>show_activity_title</wf_config_name>
  30        <wf_config_value></wf_config_value>
  31        <wf_config_value_int>1</wf_config_value_int>
  32      </config>
  33      <config>
  34        <wf_config_name>show_instance_name</wf_config_name>
  35        <wf_config_value></wf_config_value>
  36        <wf_config_value_int>1</wf_config_value_int>
  37      </config>
  38      <config>
  39        <wf_config_name>show_instance_owner</wf_config_name>
  40        <wf_config_value></wf_config_value>
  41        <wf_config_value_int>1</wf_config_value_int>
  42      </config>
  43      <config>
  44        <wf_config_name>show_multiple_submit_as_select</wf_config_name>
  45        <wf_config_value></wf_config_value>
  46        <wf_config_value_int>0</wf_config_value_int>
  47      </config>
  48      <config>
  49        <wf_config_name>show_activity_info_zone</wf_config_name>
  50        <wf_config_value></wf_config_value>
  51        <wf_config_value_int>1</wf_config_value_int>
  52      </config>
  53      <config>
  54        <wf_config_name>draw_roles</wf_config_name>
  55        <wf_config_value></wf_config_value>
  56        <wf_config_value_int>1</wf_config_value_int>
  57      </config>
  58      <config>
  59        <wf_config_name>mail_smtp_profile</wf_config_name>
  60        <wf_config_value>default</wf_config_value>
  61        <wf_config_value_int></wf_config_value_int>
  62      </config>
  63    </configs>
  64    <activities>
  65      <activity>
  66        <name>View the Message</name>
  67        <type>view</type>
  68        <description>This 'view' activity is there to give a nicer view in read-only mode on the message for all users of the process.
  69  We use the mail agent on it to prevent the owner (author of the message) that someones has consulted his message.</description>
  70        <lastModif>02/09/2005 [04:04:04]</lastModif>
  71        <isInteractive>y</isInteractive>
  72        <isAutoRouted>n</isAutoRouted>
  73        <roles>
  74          <role readonly="true">Validator</role>
  75          <role readonly="true">MailUser</role>
  76        </roles>
  77        <agents>
  78          <agent>
  79             <agent_type>mail_smtp</agent_type>
  80             <agent_datas>
  81                 <agent_data>
  82                     <name>wf_to</name>
  83                     <value>%owner%</value>
  84                 </agent_data>
  85                 <agent_data>
  86                     <name>wf_cc</name>
  87                     <value></value>
  88                 </agent_data>
  89                 <agent_data>
  90                     <name>wf_bcc</name>
  91                     <value></value>
  92                 </agent_data>
  93                 <agent_data>
  94                     <name>wf_from</name>
  95                     <value>no-reply@nowhere.com</value>
  96                 </agent_data>
  97                 <agent_data>
  98                     <name>wf_replyto</name>
  99                     <value></value>
 100                 </agent_data>
 101                 <agent_data>
 102                     <name>wf_subject</name>
 103                     <value>%user% has consulted your message</value>
 104                 </agent_data>
 105                 <agent_data>
 106                     <name>wf_message</name>
 107                     <value>%user% has consulted your message called %instance_name%.</value>
 108                 </agent_data>
 109                 <agent_data>
 110                     <name>wf_send_mode</name>
 111                     <value>2</value>
 112                 </agent_data>
 113                 <agent_data>
 114                     <name>wf_agent_type</name>
 115                     <value>mail_smtp</value>
 116                 </agent_data>
 117             </agent_datas>
 118          </agent>
 119        </agents>
 120        <code><![CDATA[<?php
 121  
 122  $property_vars = array(
 123      'MYDEST' => '',
 124      'MYBODY' => '',
 125      'REFUSAL' => '',
 126  );
 127  
 128  //--------------------------------------
 129  //
 130  // handling data on the form
 131  //
 132  //--------------------------------------
 133  
 134  // init with the property
 135  foreach ($property_vars as $prop => $value)
 136  {
 137    $property_vars[$prop] = $instance->get($prop);
 138  }
 139  
 140  //--------------------------------------
 141  //
 142  // handling results from the form
 143  //
 144  //--------------------------------------
 145  
 146  //--------------------------------------
 147  //
 148  // showing the form
 149  //
 150  //--------------------------------------
 151  
 152    foreach ($property_vars as $prop => $value) 
 153    {
 154      $template->set_var(array($prop => $property_vars[$prop]));
 155    }
 156  
 157    //we want to display the owner
 158    $this->display_owner = 1;
 159  
 160    //we want the history of the instance
 161    $this->display_history= true;
 162  
 163    // submit options we want
 164    $this->submit_array['__Cancel'] = lang('Close');
 165  
 166  
 167  ?>      ]]></code>      <template><![CDATA[<table width="100%">
 168   <tr class="th">
 169      <td colspan="2">this a message made by {wf_owner}</td>
 170   </tr>
 171   </tr>
 172   
 173   <tr class="row_on">
 174      <td> From:</td>
 175      <td>{wf_owner}</td>
 176    </tr>
 177   <tr class="row_on">
 178      <td> To:</td>
 179      <td>{MYDEST}</td>
 180    </tr>
 181   <tr class="row_off">
 182      <td> subject:</td>
 183      <td>{wf_instance_name}</td>
 184    </tr>
 185   <tr class="row_on">
 186      <td> body:</td>
 187      <td> <textarea readonly="readonly" name="MYBODY" cols="76" rows="5">{MYBODY}</textarea></td>
 188    </tr>
 189   <tr class="row_on">
 190      <td> in case of BaAad REFUSAL:</td>
 191      <td> {REFUSAL}</td>
 192    </tr>
 193  </table>      ]]></template>    </activity>
 194      <activity>
 195        <name>end</name>
 196        <type>end</type>
 197        <description>default end activity</description>
 198        <lastModif>01/09/2005 [09:13:00]</lastModif>
 199        <isInteractive>n</isInteractive>
 200        <isAutoRouted>y</isAutoRouted>
 201        <roles>
 202        </roles>
 203        <agents>
 204        </agents>
 205        <code><![CDATA[<?php
 206  ?>      ]]></code>    </activity>
 207      <activity>
 208        <name>Acknowledge user it was good</name>
 209        <type>activity</type>
 210        <description>This automatic activity send an email to the user to prevent him his mail was sent</description>
 211        <lastModif>01/09/2005 [09:13:00]</lastModif>
 212        <isInteractive>n</isInteractive>
 213        <isAutoRouted>y</isAutoRouted>
 214        <roles>
 215        </roles>
 216        <agents>
 217          <agent>
 218             <agent_type>mail_smtp</agent_type>
 219             <agent_datas>
 220                 <agent_data>
 221                     <name>wf_to</name>
 222                     <value>%owner%</value>
 223                 </agent_data>
 224                 <agent_data>
 225                     <name>wf_cc</name>
 226                     <value></value>
 227                 </agent_data>
 228                 <agent_data>
 229                     <name>wf_bcc</name>
 230                     <value></value>
 231                 </agent_data>
 232                 <agent_data>
 233                     <name>wf_from</name>
 234                     <value>%user%</value>
 235                 </agent_data>
 236                 <agent_data>
 237                     <name>wf_replyto</name>
 238                     <value></value>
 239                 </agent_data>
 240                 <agent_data>
 241                     <name>wf_subject</name>
 242                     <value>Your mail was sent</value>
 243                 </agent_data>
 244                 <agent_data>
 245                     <name>wf_message</name>
 246                     <value>your mail for %property_MYDEST% was sent by the validator.
 247  
 248  %signature%</value>
 249                 </agent_data>
 250                 <agent_data>
 251                     <name>wf_send_mode</name>
 252                     <value>2</value>
 253                 </agent_data>
 254                 <agent_data>
 255                     <name>wf_agent_type</name>
 256                     <value>mail_smtp</value>
 257                 </agent_data>
 258             </agent_datas>
 259          </agent>
 260        </agents>
 261        <code><![CDATA[<?php
 262  ?>      ]]></code>    </activity>
 263      <activity>
 264        <name>Acknowledge user it was bad</name>
 265        <type>activity</type>
 266        <description>Boo, the validator said the mail was bad, send an email to the owner, aka the user starting the process, to tell him it was bad</description>
 267        <lastModif>01/09/2005 [09:13:00]</lastModif>
 268        <isInteractive>n</isInteractive>
 269        <isAutoRouted>y</isAutoRouted>
 270        <roles>
 271        </roles>
 272        <agents>
 273          <agent>
 274             <agent_type>mail_smtp</agent_type>
 275             <agent_datas>
 276                 <agent_data>
 277                     <name>wf_to</name>
 278                     <value>%owner%</value>
 279                 </agent_data>
 280                 <agent_data>
 281                     <name>wf_cc</name>
 282                     <value></value>
 283                 </agent_data>
 284                 <agent_data>
 285                     <name>wf_bcc</name>
 286                     <value></value>
 287                 </agent_data>
 288                 <agent_data>
 289                     <name>wf_from</name>
 290                     <value>%user%</value>
 291                 </agent_data>
 292                 <agent_data>
 293                     <name>wf_replyto</name>
 294                     <value>%user%</value>
 295                 </agent_data>
 296                 <agent_data>
 297                     <name>wf_subject</name>
 298                     <value>Your mail was not sent</value>
 299                 </agent_data>
 300                 <agent_data>
 301                     <name>wf_message</name>
 302                     <value>Your mail for %property_MYDEST% was NOT sent by the validator.
 303  here is his explanation: %property_REFUSAL%
 304  
 305  %signature%</value>
 306                 </agent_data>
 307                 <agent_data>
 308                     <name>wf_send_mode</name>
 309                     <value>3</value>
 310                 </agent_data>
 311                 <agent_data>
 312                     <name>wf_agent_type</name>
 313                     <value>mail_smtp</value>
 314                 </agent_data>
 315             </agent_datas>
 316          </agent>
 317        </agents>
 318        <code><![CDATA[<?php
 319  ?>      ]]></code>    </activity>
 320      <activity>
 321        <name>Send the message</name>
 322        <type>activity</type>
 323        <description>This automatic activity will send the message that the user was asking for.</description>
 324        <lastModif>28/10/2005 [10:21:20]</lastModif>
 325        <isInteractive>n</isInteractive>
 326        <isAutoRouted>y</isAutoRouted>
 327        <roles>
 328        </roles>
 329        <agents>
 330          <agent>
 331             <agent_type>mail_smtp</agent_type>
 332             <agent_datas>
 333                 <agent_data>
 334                     <name>wf_to</name>
 335                     <value>%property_MYDEST%</value>
 336                 </agent_data>
 337                 <agent_data>
 338                     <name>wf_cc</name>
 339                     <value></value>
 340                 </agent_data>
 341                 <agent_data>
 342                     <name>wf_bcc</name>
 343                     <value></value>
 344                 </agent_data>
 345                 <agent_data>
 346                     <name>wf_from</name>
 347                     <value>%owner%</value>
 348                 </agent_data>
 349                 <agent_data>
 350                     <name>wf_replyto</name>
 351                     <value>%owner%</value>
 352                 </agent_data>
 353                 <agent_data>
 354                     <name>wf_subject</name>
 355                     <value>%instance_name%</value>
 356                 </agent_data>
 357                 <agent_data>
 358                     <name>wf_message</name>
 359                     <value>%property_MYBODY%</value>
 360                 </agent_data>
 361                 <agent_data>
 362                     <name>wf_send_mode</name>
 363                     <value>2</value>
 364                 </agent_data>
 365                 <agent_data>
 366                     <name>wf_agent_type</name>
 367                     <value>mail_smtp</value>
 368                 </agent_data>
 369             </agent_datas>
 370          </agent>
 371        </agents>
 372        <code><![CDATA[<?php
 373  ?>      ]]></code>    </activity>
 374      <activity>
 375        <name>Validation</name>
 376        <type>switch</type>
 377        <description>The Validator validate the mail and send it by completing the activity. He can as well invalidate the mail.</description>
 378        <lastModif>02/09/2005 [03:06:38]</lastModif>
 379        <isInteractive>y</isInteractive>
 380        <isAutoRouted>y</isAutoRouted>
 381        <roles>
 382          <role>Validator</role>
 383          <role readonly="true">MailUser</role>
 384        </roles>
 385        <agents>
 386        </agents>
 387        <code><![CDATA[<?php
 388  //avoid empty property warning
 389  $instance->set('REFUSAL','');
 390  
 391  $property_vars = array(
 392      'MYDEST' => '',
 393      'MYBODY' => '',
 394      'REFUSAL' => '',
 395  );
 396  
 397  //--------------------------------------
 398  //
 399  // handling data on the form
 400  //
 401  //--------------------------------------
 402  
 403  // init variables with POST and if POST is empty 
 404  // init with the property
 405  foreach ($property_vars as $prop => $value)
 406  {
 407    $property_vars[$prop] = get_var($prop,'any',$instance->get($prop));
 408  }
 409  //user commands   ****************
 410  $ActBad = get_var('ActBad','POST',false);
 411  $ActGood = get_var('ActGood','POST',false);
 412  $ActLater = get_var('ActLater','POST',false);
 413  
 414  //--------------------------------------
 415  //
 416  // handling results from the form
 417  //
 418  //--------------------------------------
 419  $message = Array();
 420  $checkforstaying = true;
 421  if (($ActBad) || ($ActGood) || ($ActLater)) 
 422  {
 423    // saving properties
 424    // if they changed
 425    foreach ($property_vars as $prop => $value)
 426    {
 427       if ($value != ($instance->get($prop)) ) 
 428       {
 429         $instance->set($prop,$value);
 430       }
 431    }
 432    if ($ActGood)
 433    {
 434       $checkforstaying = false;
 435       // going to next stage
 436       $instance->setNextActivity('Send the message');
 437       //complete and send the message
 438       $instance->complete();
 439    }
 440    if ($ActBad)
 441    {
 442      if($property_vars['REFUSAL']=='')
 443      {
 444        $message[]='You need to complete the REFUSAL to give some explanation of why it is baAad';
 445      }
 446      else
 447      {
 448         $checkforstaying = false;
 449         // going to next stage
 450         $instance->setNextActivity('Acknowledge user it was bad');
 451         //complete and sen the message
 452         $instance->complete();
 453      }
 454    }
 455    elseif($ActLater)
 456    {
 457      $checkforstaying = false;
 458      //leave without complete()
 459      $GLOBALS['workflow']['__leave_activity']=true;
 460    } 
 461  } 
 462  
 463  //now if we do not leave...
 464  if ($checkforstaying)
 465  {
 466  //--------------------------------------
 467  //
 468  // showing the form
 469  //
 470  //--------------------------------------
 471  
 472    foreach ($property_vars as $prop => $value) 
 473    {
 474      $template->set_var(array($prop => htmlentities($property_vars[$prop])));
 475    }
 476    //some more form vars
 477    $template->set_var(array(
 478      'message' => implode('<br />',$message),
 479      )
 480    );
 481  
 482    //we want to display the owner
 483    $this->display_owner = 1;
 484  
 485    // submit options we want
 486    $this->submit_array['ActBad'] = array(label => 'BaAad', confirm => 'Are you sure you want to reject it?');
 487    $this->submit_array['ActGood'] = array(label => 'GoOod', confirm => 'this will send the email, you really want it, really?');
 488    $this->submit_array['ActLater'] = 'Later, I need more reflexion';
 489  
 490    //priority array
 491    $this->priority_array = array( 
 492          1 => lang('1 - low'),
 493          2 => lang('2 - normal'),
 494          3 => lang('3 - better'),
 495          4 => lang('4 - urgent'),
 496   );
 497  }
 498  ?>      ]]></code>      <template><![CDATA[<table width="100%">
 499   <tr class="th">
 500      <td colspan="2">Decide if this message is goOod or baAad. If you choose goOod he will be sent, else he wont, and {wf_owner} will be warned of your choice by email</td>
 501   </tr>
 502   </tr>
 503   <tr class="row_off">
 504      <td>&nbsp;</td>
 505      <td>&nbsp;{message}</td>
 506    </tr>
 507   <tr class="row_on">
 508      <td> From:</td>
 509      <td>{wf_owner}</td>
 510    </tr>
 511   <tr class="row_on">
 512      <td> To:</td>
 513      <td>{MYDEST}</td>
 514    </tr>
 515   <tr class="row_off">
 516      <td> subject:</td>
 517      <td>{wf_instance_name}</td>
 518    </tr>
 519   <tr class="row_on">
 520      <td> body:</td>
 521      <td> <textarea readonly="readonly" name="MYBODY" cols="76" rows="5">{MYBODY}</textarea></td>
 522    </tr>
 523   <tr class="row_on">
 524      <td> in case of BaAad REFUSAL:</td>
 525      <td> <input type="text" name="REFUSAL" value="{REFUSAL}" /></td>
 526    </tr>
 527  </table>      ]]></template>    </activity>
 528      <activity>
 529        <name>Send Automatic Mail to Validator</name>
 530        <type>activity</type>
 531        <description>This automatic activity sends an email to people in validator role. This email contains a lot of tips for writing emails with this agent</description>
 532        <lastModif>01/09/2005 [09:13:00]</lastModif>
 533        <isInteractive>n</isInteractive>
 534        <isAutoRouted>y</isAutoRouted>
 535        <roles>
 536          <role>Validator</role>
 537        </roles>
 538        <agents>
 539          <agent>
 540             <agent_type>mail_smtp</agent_type>
 541             <agent_datas>
 542                 <agent_data>
 543                     <name>wf_to</name>
 544                     <value>%roles%</value>
 545                 </agent_data>
 546                 <agent_data>
 547                     <name>wf_cc</name>
 548                     <value></value>
 549                 </agent_data>
 550                 <agent_data>
 551                     <name>wf_bcc</name>
 552                     <value></value>
 553                 </agent_data>
 554                 <agent_data>
 555                     <name>wf_from</name>
 556                     <value>%user%</value>
 557                 </agent_data>
 558                 <agent_data>
 559                     <name>wf_replyto</name>
 560                     <value>%user%</value>
 561                 </agent_data>
 562                 <agent_data>
 563                     <name>wf_subject</name>
 564                     <value>A mail needs your validation</value>
 565                 </agent_data>
 566                 <agent_data>
 567                     <name>wf_message</name>
 568                     <value>%owner% wanted to send an email to %property_MYDEST%.
 569  You need to check the message, the task is avaible %link_userinstance|here on the activity list%.
 570  and just to test links I think you should try to click on this %link_http://www.egroupware.org/|egroupware.org external site link%. or on this %link_/index.php?menuaction=workflow.ui_useractivities.form|local installation link%.
 571  And some other usefull links are:
 572  %link_viewinstance|the instance in default view mode%.
 573  %link_viewniceinstance|the instance in view activity%.
 574  %link_admininstance|the instance in admin mode%.
 575  
 576  We could as well use some defined tokens:
 577  instance name and id: %instance_name% (%instance_id%)
 578  activity name and id: %activity_name% (%activity_id%)
 579  process name, version and id: %process_name% v%process_version% (%process_id%)
 580  
 581  Last tip, if you want the \% character use the '\' charater to escape him.
 582  
 583  =====================================
 584  %signature%</value>
 585                 </agent_data>
 586                 <agent_data>
 587                     <name>wf_send_mode</name>
 588                     <value>3</value>
 589                 </agent_data>
 590                 <agent_data>
 591                     <name>wf_agent_type</name>
 592                     <value>mail_smtp</value>
 593                 </agent_data>
 594             </agent_datas>
 595          </agent>
 596        </agents>
 597        <code><![CDATA[<?php
 598  ?>      ]]></code>    </activity>
 599      <activity>
 600        <name>Need to send an email</name>
 601        <type>start</type>
 602        <description>This start activity let the User write an email and send an email to the Validator Role, the user email is not sent. To test some other functionnalities we send an email to the user after he finished this activity to tell him we are sending an email to the validator</description>
 603        <lastModif>01/09/2005 [09:13:00]</lastModif>
 604        <isInteractive>y</isInteractive>
 605        <isAutoRouted>y</isAutoRouted>
 606        <roles>
 607          <role>MailUser</role>
 608        </roles>
 609        <agents>
 610          <agent>
 611             <agent_type>mail_smtp</agent_type>
 612             <agent_datas>
 613                 <agent_data>
 614                     <name>wf_to</name>
 615                     <value>%user%</value>
 616                 </agent_data>
 617                 <agent_data>
 618                     <name>wf_cc</name>
 619                     <value></value>
 620                 </agent_data>
 621                 <agent_data>
 622                     <name>wf_bcc</name>
 623                     <value></value>
 624                 </agent_data>
 625                 <agent_data>
 626                     <name>wf_from</name>
 627                     <value>no-reply@nowhere.com</value>
 628                 </agent_data>
 629                 <agent_data>
 630                     <name>wf_replyto</name>
 631                     <value>%user%</value>
 632                 </agent_data>
 633                 <agent_data>
 634                     <name>wf_subject</name>
 635                     <value>Your message is waiting for validation</value>
 636                 </agent_data>
 637                 <agent_data>
 638                     <name>wf_message</name>
 639                     <value>Your message for %property_MYDEST% is actually awaiting for validation by the validator.
 640  
 641  %signature%</value>
 642                 </agent_data>
 643                 <agent_data>
 644                     <name>wf_send_mode</name>
 645                     <value>0</value>
 646                 </agent_data>
 647                 <agent_data>
 648                     <name>wf_agent_type</name>
 649                     <value>mail_smtp</value>
 650                 </agent_data>
 651             </agent_datas>
 652          </agent>
 653        </agents>
 654        <code><![CDATA[<?php
 655  // retrieve submit options ****************
 656  $ActSendtoValidation = get_var('ActSendtoValidation','POST',false);
 657  //retrieve the message
 658  $MYBODY =  get_var('MYBODY','POST','write your message here');
 659  $MYDEST =  get_var('MYDEST','POST','');
 660  //--------------------------------------
 661  //
 662  // handling results from the form
 663  //
 664  //--------------------------------------
 665  
 666  $checkforcomplete = false;
 667  $message = Array();
 668  
 669  if ($ActSendtoValidation)
 670  {
 671    //do some checks
 672    if (($MYBODY=='') || ($MYBODY=='write your message here') || ($MYBODY=='hey, you NEED to write your message here!'))
 673    {
 674      //no need to work with an empty message, even if the SendtoValidation is set
 675      $MYBODY = 'hey, you NEED to write your message here!';
 676      $message[] = 'you should write something in the message zone';
 677    }
 678    elseif ($MYDEST=='')
 679    {
 680      //no need to work with an empty dest, even if the SendtoValidation is set
 681      $message[] = 'write an email in the To: field, please';
 682    }
 683    elseif (get_var('wf_name','POST','')=='')
 684    {
 685      //empty subject for the message, baAad
 686      $message[] = 'write a subject for your message, please';
 687    }
 688    else
 689    {
 690      $checkforcomplete = true;
 691    }
 692  }
 693  if ($checkforcomplete)
 694  {
 695    //save the instance property, we are in a start activity, 
 696    //which is a pseudo instance
 697    //this means we cannot keep track of instance properties when looping on the form
 698    //but it is not meaning you cannot write instance properties
 699    //in fact they are just in memory and written in database when the complete()
 700    //is done.
 701    $instance->set('MYDEST',$MYDEST);
 702    $instance->set('MYBODY',$MYBODY);
 703  
 704    // going to next stage
 705    $instance->complete();
 706    // the 'wf_name' and 'wf_priority' special properties are saved in
 707    // start_pos.php when completing
 708    //we use the name of the instance as the subject of the message
 709  } 
 710  else 
 711  {
 712  
 713  //--------------------------------------
 714  //
 715  // let's run_activity show the form
 716  //
 717  //--------------------------------------
 718     // submit options we want
 719     $this->submit_array['ActSendtoValidation'] = lang('Send to Validation');
 720     //Special cancel value
 721     $this->submit_array['__Cancel'] = lang('Cancel');
 722     //priority levels we want
 723     $this->priority_array = array( 
 724          1 => lang('1 - low'),
 725          2 => lang('2 - normal'),
 726          3 => lang('3 - hurry up'),
 727          4 => lang('4 - I need It!'),
 728          );
 729    //and default values and messages
 730    $template->set_var(array(
 731      'MYDEST' => $MYDEST,
 732      'MYBODY' => $MYBODY,
 733      'message' => implode('<br />',$message),
 734    ));
 735  }
 736  
 737  ?>      ]]></code>      <template><![CDATA[<table width="100%">
 738   <tr class="th">
 739      <td colspan="2">this activity will begin a new test mail process, an instance will be created. Your message wont be sent. An email will be sent to the Validator and he will decide if your message can be sent or not. You will be warned of his decision.</td>
 740   </tr>
 741   <tr class="row_off">
 742      <td>&nbsp;</td>
 743      <td>&nbsp;{message}</td>
 744    </tr>
 745   <tr class="row_on">
 746      <td> To:</td>
 747      <td> <input type="text" name="MYDEST" value="{MYDEST}" /></td>
 748    </tr>
 749   <tr class="row_off">
 750      <td> enter the subject of your message:</td>
 751      <td> <input type="text" name="wf_name" value="" /></td>
 752    </tr>
 753   <tr class="row_on">
 754      <td> enter the body your message:</td>
 755      <td> <textarea name="MYBODY" cols="76" rows="5">{MYBODY}</textarea></td>
 756    </tr>
 757  </table>      ]]></template>    </activity>
 758    </activities>
 759    <transitions>
 760       <transition>
 761         <from>Need to send an email</from>
 762         <to>Send Automatic Mail to Validator</to>
 763       </transition>
 764       <transition>
 765         <from>Send Automatic Mail to Validator</from>
 766         <to>Validation</to>
 767       </transition>
 768       <transition>
 769         <from>Validation</from>
 770         <to>Acknowledge user it was bad</to>
 771       </transition>
 772       <transition>
 773         <from>Validation</from>
 774         <to>Send the message</to>
 775       </transition>
 776       <transition>
 777         <from>Send the message</from>
 778         <to>Acknowledge user it was good</to>
 779       </transition>
 780       <transition>
 781         <from>Acknowledge user it was good</from>
 782         <to>end</to>
 783       </transition>
 784       <transition>
 785         <from>Acknowledge user it was bad</from>
 786         <to>end</to>
 787       </transition>
 788    </transitions>
 789  </process>


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7