function create_from_API($duplicate_id = '')
 {
     if (empty($this->tilkee_id) || !empty($duplicate_id)) {
         require_once 'custom/include/externalAPI/Tilkee/ExtAPITilkee.php';
         $tilkee = new ExtAPITilkee();
         $result = $tilkee->create_project($this->name, $this->type, $duplicate_id);
         if ($result != -1 && !empty($result)) {
             if (!empty($duplicate_id)) {
                 $this->id = '';
             }
             $this->set_result_to_bean($result);
         } else {
             global $mod_strings;
             SugarApplication::appendErrorMessage($mod_strings['LBL_ERROR_CREATE_ON_TILKEE']);
         }
     }
     return 0;
 }
Example #2
0
     break;
 case 'test_connexion':
     $result = $tilkee->init_tilkee_access_eapm();
     $display_result = print_r($result, true);
     $display_title = "Connection Test";
     break;
 case 'infos_project':
     if ($_REQUEST['project_id_infos_project'] != '') {
         $result = $tilkee->infos_project($_REQUEST['project_id_infos_project']);
         $display_result = print_r($result, true);
         $display_title = "Infos Project";
     }
     break;
 case 'create_project':
     if ($_REQUEST['project_name_create'] != '') {
         $result = $tilkee->create_project($_REQUEST['project_name_create']);
         $display_result = print_r($result, true);
         $display_title = "Create Project";
     }
     break;
 case 'update_project':
     if ($_REQUEST['project_id_update'] != '') {
         $result = $tilkee->update_project($_REQUEST['project_id_update'], $_REQUEST['project_name_update'], $_REQUEST['project_kind'], $_REQUEST['project_won'], $_REQUEST['project_archived']);
         $display_result = print_r($result, true);
         $display_title = "Update Project";
     }
     break;
 case 'delete_project':
     if ($_REQUEST['project_id_delete'] != '') {
         $result = $tilkee->delete_project($_REQUEST['project_id_delete']);
         $display_result = print_r($result, true);