Ejemplo n.º 1
0
 public function process(Vtiger_Request $request) {
     
     $record = new SPPDFTemplates_Record_Model();
     $record->set('templateid', $request->get('templateid'));
     $record->set('module', $request->get('modulename'));
     $record->set('name', $request->get('templatename'));
     $record->set('header_size', $request->get('header_size'));
     $record->set('footer_size', $request->get('footer_size'));
     $record->set('page_orientation', $request->get('page_orientation'));
     $record->set('template', fck_from_html($_REQUEST["body"]));             //hack to save template html-structures
     
     $record->save();
     
     /* Display detail view */
     header("Location:index.php?module=SPPDFTemplates&view=Detail&templateid=".$record->getId());
 }
Ejemplo n.º 2
0
Archivo: Save.php Proyecto: hardikk/HNH
    require_once SM_PATH . 'include/load_prefs.php';
    //require_once(SM_PATH . 'class/mime/Message.class.php');
    require_once SM_PATH . 'class/mime.class.php';
    sqgetGlobalVar('key', $key, SQ_COOKIE);
    sqgetGlobalVar('username', $username, SQ_SESSION);
    sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
    $mailbox = 'INBOX';
}
require_once 'modules/Emails/Emails.php';
require_once 'include/logging.php';
require_once 'include/database/PearDatabase.php';
$local_log =& LoggerManager::getLogger('index');
$focus = new Emails();
global $current_user, $mod_strings, $app_strings;
if (isset($_REQUEST['description']) && $_REQUEST['description'] != '') {
    $_REQUEST['description'] = fck_from_html($_REQUEST['description']);
}
$all_to_ids = $_REQUEST["hidden_toid"];
$all_to_ids .= $_REQUEST["saved_toid"];
$_REQUEST["saved_toid"] = $all_to_ids;
//we always save the email with "save" status and when it is sent it is marked as SENT
$_REQUEST['email_flag'] = 'SAVED';
setObjectValuesFromRequest($focus);
//Check if the file is exist or not.
//$file_name = '';
if (isset($_REQUEST['filename_hidden'])) {
    $file_name = $_REQUEST['filename_hidden'];
} else {
    $file_name = $_FILES['filename']['name'];
}
$errorCode = $_FILES['filename']['error'];
Ejemplo n.º 3
0
$search = vtlib_purify($_REQUEST['search_url']);
if ($_REQUEST['mode'] != 'edit' and $_REQUEST['filelocationtype'] == 'I' and $_FILES['filename']['error'] == 4 and $_FILES['filename']['size'] == 0) {
    $_REQUEST['filelocationtype'] = 'E';
}
$focus = new $currentModule();
setObjectValuesFromRequest($focus);
$mode = vtlib_purify($_REQUEST['mode']);
$record = vtlib_purify($_REQUEST['record']);
if ($mode) {
    $focus->mode = $mode;
}
if ($record) {
    $focus->id = $record;
}
if (isset($_REQUEST['notecontent']) && $_REQUEST['notecontent'] != "") {
    $_REQUEST['notecontent'] = fck_from_html($_REQUEST['notecontent']);
}
if (isset($_REQUEST['parentid']) && $_REQUEST['parentid'] != '') {
    $focus->parentid = vtlib_purify($_REQUEST['parentid']);
}
if ($_REQUEST['assigntype'] == 'U') {
    $focus->column_fields['assigned_user_id'] = $_REQUEST['assigned_user_id'];
} elseif ($_REQUEST['assigntype'] == 'T') {
    $focus->column_fields['assigned_user_id'] = $_REQUEST['assigned_group_id'];
}
list($saveerror, $errormessage, $error_action, $returnvalues) = $focus->preSaveCheck($_REQUEST);
if ($saveerror) {
    // there is an error so we go back to EditView.
    $return_module = $return_id = $return_action = '';
    if (!empty($_REQUEST['return_action'])) {
        $return_action = '&return_action=' . vtlib_purify($_REQUEST['return_action']);
Ejemplo n.º 4
0
 * The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
 ********************************************************************************/
require_once 'include/utils/utils.php';
global $log;
$db = PearDatabase::getInstance();
$folderName = vtlib_purify($_REQUEST["foldername"]);
$templateName = vtlib_purify($_REQUEST["templatename"]);
$templateid = vtlib_purify($_REQUEST["templateid"]);
$description = vtlib_purify($_REQUEST["description"]);
$subject = vtlib_purify($_REQUEST["subject"]);
$body = fck_from_html($_REQUEST["body"]);
$emailfrom = vtlib_purify($_REQUEST["emailfrom"]);
if (isset($templateid) && $templateid != '') {
    $log->info("the templateid is set");
    $sql = "update vtiger_emailtemplates set foldername =?, templatename =?, subject =?, description =?, body =?, sendemailfrom=? where templateid =?";
    $params = array($folderName, $templateName, $subject, $description, $body, $emailfrom, $templateid);
    $adb->pquery($sql, $params);
    $log->info("about to invoke the detailviewemailtemplate file");
    header("Location:index.php?module=Settings&action=detailviewemailtemplate&parenttab=Settings&templateid=" . $templateid);
} else {
    $templateid = $db->getUniqueID('vtiger_emailtemplates');
    $sql = "insert into vtiger_emailtemplates values (?,?,?,?,?,?,?,?)";
    $params = array($folderName, $templateName, $subject, $description, $body, 0, $templateid, $emailfrom);
    $adb->pquery($sql, $params);
    $log->info("added to the db the emailtemplate");
    header("Location:index.php?module=Settings&action=detailviewemailtemplate&parenttab=Settings&templateid=" . $templateid);