Esempio n. 1
0
 function fill_in_additional_detail_fields()
 {
     global $current_language, $theme;
     $mod_strings = return_module_language($current_language, "ZuckerWordTemplate");
     if (!empty($this->filename)) {
         $this->template_url = $this->get_resources_dir() . $this->filename;
         $this->extension = substr($this->filename, strrpos($this->filename, ".") + 1);
     }
     $this->action_module = $this->module_dir;
     $seed = new QueryTemplate();
     $this->querytemplate = $seed->retrieve($this->querytemplate_id);
     if (empty($this->querytemplate)) {
         $seed = new ListingTemplate();
         $this->querytemplate = $seed->retrieve($this->querytemplate_id);
     }
     if (!empty($this->querytemplate)) {
         $this->querytemplate_name = $this->querytemplate->name;
         $this->querytemplate_link = "index.php?module=" . $this->querytemplate->module_dir . "&action=DetailView&record=" . $this->querytemplate->id;
     }
     if ($this->extension == "stw" || $this->extension == "odt") {
         $this->type_desc = $mod_strings["LBL_OPENOFFICE"];
         $this->image_html = get_image("themes/" . $theme . "/images/ZuckerOpenOfficeTemplate", "alt=\"ZuckerOpenOfficeTemplate\"");
         $this->image_module = "ZuckerOpenOfficeTemplate";
     } else {
         if ($this->extension == "doc") {
             $this->type_desc = $mod_strings["LBL_WORD"];
             $this->image_html = get_image("themes/" . $theme . "/images/ZuckerWordTemplate", "alt=\"ZuckerWordTemplate\"");
             $this->image_module = "ZuckerWordTemplate";
         }
     }
     $this->assigned_user_name = get_assigned_user_name($this->assigned_user_id);
     $this->team_name = SimpleTeams::get_assigned_team_name($this);
 }
Esempio n. 2
0
 function mark_listingrelations_deleted($id)
 {
     $t = new ListingTemplate();
     $t->retrieve($id);
     $filters = $t->get_filters();
     $orders = $t->get_orders();
     foreach ($filters as $f) {
         $f->mark_deleted($f->id);
     }
     foreach ($orders as $o) {
         $o->mark_deleted($o->id);
     }
 }
Esempio n. 3
0
<?php

require_once 'include/formbase.php';
require_once 'include/upload_file.php';
require_once 'modules/ZuckerListingTemplate/ListingTemplate.php';
if (!empty($_REQUEST['record'])) {
    $template = new ListingTemplate();
    $template->retrieve($_REQUEST['record']);
    if (!$template->ACLAccess('Delete')) {
        ACLController::displayNoAccess(true);
        sugar_cleanup(true);
    }
    $template->mark_deleted($_REQUEST['record']);
}
header("Location: index.php?module=" . $_REQUEST['return_module'] . "&action=" . $_REQUEST['return_action'] . "&record=" . $_REQUEST['return_id']);
Esempio n. 4
0
<?php

require_once 'include/formbase.php';
require_once 'include/upload_file.php';
require_once 'modules/ZuckerListingTemplateFilter/ListingTemplateFilter.php';
if (!is_admin($current_user)) {
    sugar_die("only admin allowed");
}
$filter = new ListingTemplateFilter();
if (!empty($_REQUEST['record'])) {
    $filter->retrieve($_REQUEST['record']);
}
$filter = populateFromPost("filter_", $filter);
$lt = new ListingTemplate();
$lt->retrieve($filter->listing_template_id);
if (!empty($_REQUEST["filter_value_param"])) {
    $rp = new ReportParameter();
    $rp->retrieve($_REQUEST["filter_value_param"]);
    $rpl = new ReportParameterLink();
    $rpl->template_id = $lt->id;
    $rpl->parameter_id = $rp->id;
    $rpl->name = $rp->default_name;
    $rpl->default_value = $rp->default_value;
    $rpl->save();
    $filter->value = $rpl->id;
    $filter->value_type = "parameter";
} else {
    if (!empty($_REQUEST["filter_value_enum"])) {
        $filter->value = $_REQUEST["filter_value_enum"];
        $filter->value_type = "text";
    } else {