–– Support ––

Community Forum

This forum has now moved to https://suitecrm.com/forum

You can still use the forum below to look at historical SuiteCRM and SugarCRM issues and fixes.

Welcome, Guest
Username: Password:
Please post all questions or issues about AOP 1.x here

TOPIC: File attached from joomla

File attached from joomla 5 years 5 months ago #5074

  • ikeschneider
  • ikeschneider's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 1
  • Karma: 0
Hi,

When the portal user upload a file from joomla the file doesn't shows on the case panel. The attached file goes to sugarcrm, but the related to field is not related to the case.
The administrator has disabled public write access.

File attached from joomla 5 years 5 months ago #5075

  • Will
  • Will's Avatar
  • Offline
  • Administrator
  • Posts: 953
  • Thank you received: 79
  • Karma: 0
Hi ikeschneider,

This is a known issue and a bug fix has been applied for the next release of AOP.

Thanks,

Will.
Software Support Engineer
SalesAgility - SugarCRM Consultants and Developers
The administrator has disabled public write access.

File attached from joomla 5 years 5 months ago #5076

  • Will
  • Will's Avatar
  • Offline
  • Administrator
  • Posts: 953
  • Thank you received: 79
  • Karma: 0
Hi ikeschneider,

To fix this, at the end of getUpdateDisplayHead in modules/AOP_Case_Updates/Case_Updates.php add:

    $notes = $update->get_linked_beans('notes','Notes');
    if($notes){
        $html.= "Attachments: ";
        foreach($notes as $note){
            $html .= "<a href='index.php?module=Notes&action=DetailView&record={$note->id}'>{$note->filename}</a>&nbsp;";
        }
    }

Thanks,

Will.
Software Support Engineer
SalesAgility - SugarCRM Consultants and Developers
The administrator has disabled public write access.

File attached from joomla 5 years 3 months ago #5556

  • Leandro123
  • Leandro123's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 7
  • Karma: 0
Hi Will,

Having the same problem. Attached files are not visible in the specific case, however they seem to be uploaded. Your fix is not working since we run an old version of AOP.
<?php
/**
 *
 * @package Advanced OpenPortal
 * @copyright SalesAgility Ltd http://www.salesagility.com
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
 * along with this program; if not, see http://www.gnu.org/licenses
 * or write to the Free Software Foundation,Inc., 51 Franklin Street,
 * Fifth Floor, Boston, MA 02110-1301  USA
 *
 * @author Salesagility Ltd <support@salesagility.com>
 */
function display_updates($focus, $field, $value, $view){
 
    $updates = $focus->get_linked_beans('aop_case_updates',"AOP_Case_Updates");
    $html = "";
    usort($updates,function($a,$b){
        $aDate = $a->fetched_row['date_entered'];
        $bDate = $b->fetched_row['date_entered'];
        if($aDate < $bDate){
            return -1;
        }elseif($aDate > $bDate){
            return 1;
        }
        return 0;
    });
 
    foreach($updates as $update){
        $html .= display_single_update($update);
    }
    return $html;
}
 
 
function display_single_update(AOP_Case_Updates $update){
    if($update->contact_id){
        $name = $update->getContact()->name;
    }elseif($update->assigned_user_id){
        $name = $update->getUpdateUser()->name;
    }else{
        $name = "Unknown";
    }
    $html = ($update->internal ? "<strong>Internal</strong> " : '') .$name . " at ".$update->date_entered.  ":<br>";
    $html .= nl2br(html_entity_decode($update->description));
    $html.= "<hr>";
	$notes = $update->get_linked_beans('notes','Notes');
    if($notes){
        $html.= "Attachments: ";
        foreach($notes as $note){
            $html .= "<a href='index.php?module=Notes&action=DetailView&record={$note->id}'>{$note->filename}</a>&nbsp;";
        }
    }
    return $html;
}

That is my case_update.php. Any suggestions?
The administrator has disabled public write access.

File attached from joomla 5 years 3 months ago #5557

  • Will
  • Will's Avatar
  • Offline
  • Administrator
  • Posts: 953
  • Thank you received: 79
  • Karma: 0
Hi Leandro,

Which version of AOP/SugarCRM are you using?

Thanks,

Will.
Software Support Engineer
SalesAgility - SugarCRM Consultants and Developers
The administrator has disabled public write access.

File attached from joomla 5 years 3 months ago #5558

  • Leandro123
  • Leandro123's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 7
  • Karma: 0
Hi Will,

Thanks for your reply. Can you please remove that mailadres, that is also an account of me.

We're using AOP 1.0 and SugarCRM Version 6.5.16 (Build 1082).
The administrator has disabled public write access.

File attached from joomla 5 years 3 months ago #5578

  • Leandro123
  • Leandro123's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 7
  • Karma: 0
Any idea Will? I also don't mind buying the new version of AOP when that solves the problem.
The administrator has disabled public write access.

File attached from joomla 5 years 2 months ago #5593

  • Will
  • Will's Avatar
  • Offline
  • Administrator
  • Posts: 953
  • Thank you received: 79
  • Karma: 0
Hi Leandro,

I have updated the shop with the latest version of AOP. Please let me know if you can download 1.1.

Thanks,

Will.
Software Support Engineer
SalesAgility - SugarCRM Consultants and Developers
The administrator has disabled public write access.

File attached from joomla 5 years 2 months ago #5613

  • Leandro123
  • Leandro123's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 7
  • Karma: 0
Will, if this new version doesn't solve the problem, is it possible to get a refund?
The administrator has disabled public write access.

File attached from joomla 5 years 2 months ago #5638

  • Will
  • Will's Avatar
  • Offline
  • Administrator
  • Posts: 953
  • Thank you received: 79
  • Karma: 0
Hi Leaonardo,

Please let me confirm if upgrading will fix your issues and I will update.

Thanks,

Will.
Software Support Engineer
SalesAgility - SugarCRM Consultants and Developers
The administrator has disabled public write access.

File attached from joomla 5 years 2 months ago #5650

  • Leandro123
  • Leandro123's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 7
  • Karma: 0
OK, please let me know.
The administrator has disabled public write access.

File attached from joomla 5 years 2 months ago #5695

  • Leandro123
  • Leandro123's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 7
  • Karma: 0
Will wrote:
Hi Leaonardo,

Please let me confirm if upgrading will fix your issues and I will update.

Thanks,

Will.

Do you know more Will?
The administrator has disabled public write access.

File attached from joomla 5 years 2 months ago #5696

  • Will
  • Will's Avatar
  • Offline
  • Administrator
  • Posts: 953
  • Thank you received: 79
  • Karma: 0
Hi Leandro,

I can confirm that the latest AOP component(v1.1.1) will resolve these issues. We advise that you test the component on a development instance before upgrading your live site.

If you have any further issues, please do not hesitate to ask.

Thanks,

Will.
Software Support Engineer
SalesAgility - SugarCRM Consultants and Developers
The administrator has disabled public write access.

File attached from joomla 5 years 2 months ago #5697

  • Will
  • Will's Avatar
  • Offline
  • Administrator
  • Posts: 953
  • Thank you received: 79
  • Karma: 0
Also,

I have updated the shop with the latest version of AOP. Please confirm you can login/download 1.1.

Thanks,

Will.
Software Support Engineer
SalesAgility - SugarCRM Consultants and Developers
The administrator has disabled public write access.

File attached from joomla 4 years 11 months ago #5987

  • Leandro123
  • Leandro123's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 7
  • Karma: 0
Hi,


This is how my sugarrestclient.php looks like now. Do you see the error? Still don't have a solution:
public function set_note_attachment($note_id, $file_name, $file_location){
        /*if ( !$this->sid )
            return false;
 
        $result = $this->rest_request( 'set_note_attachment' , array(
            'session' 			=> $this->sid,
            'note' => array(
                'id' => $note_id,
                'filename' => $file_name,
                'file' => $file,
            ),
        ));
 
        return $result;*/
 
        $server =  $this->base_url."/soap.php?wsdl";
 
 
        require_once('components/com_advancedopenportal/libs/nusoap/lib/nusoap.php');
 
        $soapclient = new nusoap_client( $server, true);
        $attachment = array(
            'id'=>$note_id,
            "filename" => $file_name,
            "file" => base64_encode(file_get_contents($file_location)),
 
        );
        $user_auth = array(
            'user_auth' => array(
                'user_name' => $this->rest_user,
                'password'  => $this->rest_pass,
 
            ));
        $result_array = @$soapclient->call('login',$user_auth);
        $session = $result_array['id'];
        $res = @$soapclient->call('set_note_attachment',array('session' => $session, 'note' => $attachment));
        return $res;
 
 
    }
 
    public function get_document_revision($id){
        if ( !$this->sid )
            return false;
 
        $result = $this->rest_request( 'get_document_revision' , array(
            'session' => $this->sid,
            'id'	  => $id,
        ));
 
        return $result;
    }
 
    public function set_document_revision($document_id, $file_name, $file_location, $revision_number = 1){
        if ( !$this->sid )
            return false;
 
        $result = $this->rest_request( 'set_document_revision' , array(
            'session' 			=> $this->sid,
            'document_revision' => array(
                'id' => $document_id,
                'revision' => $revision_number,
                'filename' => $file_name,
                'file' => base64_encode(file_get_contents($file_location)),
            ),
        ));
 
        return $result;
The administrator has disabled public write access.
Time to create page: 0.133 seconds
Powered by Kunena Forum