function display()
 {
     global $current_language;
     if (empty($this->container_id)) {
         $child_reports = ReportContainer::get_root_reports();
     } else {
         $container = new ReportContainer();
         $container->retrieve($this->container_id);
         $child_reports = $container->get_linked_beans("reports", "ZuckerReport");
     }
     $mod_strings = return_module_language($current_language, "ZuckerReports");
     require_once 'include/ListView/ListView.php';
     $lv = new ListView();
     $lv->initNewXTemplate('modules/ZuckerReportContainer/DetailView.html', $mod_strings);
     $lv->xTemplateAssign("DELETE_INLINE_PNG", get_image($image_path . 'delete_inline.png', 'align="absmiddle" alt="' . $app_strings['LNK_DELETE'] . '" border="0"'));
     $lv->xTemplateAssign("EDIT_INLINE_PNG", get_image($image_path . 'edit_inline.png', 'align="absmiddle" alt="' . $app_strings['LNK_EDIT'] . '" border="0"'));
     $lv->xTemplateAssign("RETURN_URL", "&return_module=ZuckerReportContainer&return_action=DetailView&return_id=" . $container->id);
     $lv->setHeaderTitle("");
     $lv->setHeaderText("");
     ob_start();
     $lv->processListViewTwo($child_reports, "reports", "REPORT");
     $str = ob_get_clean();
     ob_end_flush();
     return parent::display() . $str;
 }
Esempio n. 2
0
 /**
  *
  */
 function process_page()
 {
     global $theme;
     global $mod_strings;
     global $app_strings;
     global $currentModule;
     $output_html = '';
     $where = '';
     $where = $this->_get_where_clause();
     $name = empty($_REQUEST['name']) ? '' : $_REQUEST['name'];
     $contact_name = empty($_REQUEST['contact_name']) ? '' : $_REQUEST['contact_name'];
     $request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data'];
     $hide_clear_button = empty($_REQUEST['hide_clear_button']) ? false : true;
     $button = "<form action='index.php' method='post' name='form' id='form'>\n";
     if (!$hide_clear_button) {
         $button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='" . $app_strings['LBL_CLEAR_BUTTON_TITLE'] . "' value='  " . $app_strings['LBL_CLEAR_BUTTON_LABEL'] . "  ' />\n";
     }
     $button .= "<input type='submit' name='button' class='button' onclick=\"window.close();\" title='" . $app_strings['LBL_CANCEL_BUTTON_TITLE'] . "' accesskey='" . $app_strings['LBL_CANCEL_BUTTON_KEY'] . "' value='  " . $app_strings['LBL_CANCEL_BUTTON_LABEL'] . "  ' />\n";
     $button .= "</form>\n";
     $form = new XTemplate('modules/Emails/Popup_picker.html');
     $form->assign('MOD', $mod_strings);
     $form->assign('APP', $app_strings);
     $form->assign('THEME', $theme);
     $form->assign('MODULE_NAME', $currentModule);
     $form->assign('NAME', $name);
     $form->assign('CONTACT_NAME', $contact_name);
     $form->assign('request_data', $request_data);
     ob_start();
     insert_popup_header($theme);
     $output_html .= ob_get_contents();
     ob_end_clean();
     $output_html .= get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE'], '', false);
     $form->parse('main.SearchHeader');
     $output_html .= $form->text('main.SearchHeader');
     // Reset the sections that are already in the page so that they do not print again later.
     $form->reset('main.SearchHeader');
     // create the listview
     $seed_bean = BeanFactory::getBean('Emails');
     $ListView = new ListView();
     $ListView->show_export_button = false;
     $ListView->process_for_popups = true;
     $ListView->setXTemplate($form);
     $ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE']);
     $ListView->setHeaderText($button);
     $ListView->setQuery($where, '', 'name', 'EMAIL');
     $ListView->setModStrings($mod_strings);
     ob_start();
     $ListView->processListView($seed_bean, 'main', 'EMAIL');
     $output_html .= ob_get_contents();
     ob_end_clean();
     $output_html .= insert_popup_footer();
     return $output_html;
 }
Esempio n. 3
0
 function ProcessSubPanelListView($xTemplatePath, &$mod_strings, $action, $curModule = "")
 {
     global $currentModule, $app_strings;
     if (empty($curModule)) {
         $curModule = $currentModule;
     }
     $ListView = new ListView();
     $ListView->initNewXTemplate($xTemplatePath, $mod_strings);
     $ListView->xTemplateAssign("RETURN_URL", "&return_module=" . $curModule . "&return_action=DetailView&return_id=" . $this->focus->id);
     $ListView->xTemplateAssign("RECORD_ID", $this->focus->id);
     $ListView->xTemplateAssign("EDIT_INLINE_PNG", SugarThemeRegistry::current()->getImage('edit_inline.png', 'align="absmiddle" border="0"', null, null, '.gif', $app_strings['LNK_EDIT']));
     $ListView->xTemplateAssign("DELETE_INLINE_PNG", SugarThemeRegistry::current()->getImage('delete_inline.png', 'align="absmiddle" border="0"', null, null, '.gif', $app_strings['LNK_REMOVE']));
     $ListView->setHeaderTitle($mod_strings['LBL_TEAM_MEMBERS']);
     $ListView->setHeaderText($this->getHeaderText($action, $curModule));
     $ListView->processListView($this->users_list, "users", "USER");
 }
Esempio n. 4
0
 function ProcessSubPanelListView($xTemplatePath, &$mod_strings, $action, $curModule = '')
 {
     global $currentModule, $app_strings;
     if (empty($curModule)) {
         $curModule = $currentModule;
     }
     $ListView = new ListView();
     global $current_user;
     $header_text = '';
     if (is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) {
         $header_text = "&nbsp;<a href='index.php?action=index&module=DynamicLayout&from_action=SubPanelView&from_module=Notes&record=" . $this->focus->id . "'>" . SugarThemeRegistry::current()->getImage("EditLayout", "border='0' align='bottom'", null, null, '.gif', $mod_strings['LBL_EDITLAYOUT']) . "</a>";
     }
     $ListView->initNewXTemplate($xTemplatePath, $mod_strings);
     $ListView->xTemplateAssign("RETURN_URL", "&return_module=" . $curModule . "&return_action=DetailView&return_id=" . $this->focus->id);
     $ListView->xTemplateAssign("DELETE_INLINE_PNG", SugarThemeRegistry::current()->getImage('delete_inline', 'align="absmiddle" border="0"', null, null, '.gif', $app_strings['LNK_DELETE']));
     $ListView->xTemplateAssign("EDIT_INLINE_PNG", SugarThemeRegistry::current()->getImage('edit_inline', 'align="absmiddle"  border="0"', null, null, '.gif', $app_strings['LNK_EDIT']));
     $ListView->xTemplateAssign("RECORD_ID", $this->focus->id);
     $ListView->setHeaderTitle($mod_strings['LBL_MODULE_NAME'] . $header_text);
     $ListView->setHeaderText($this->getHeaderText($action, $curModule));
     $ListView->processListView($this->notes_list, "notes", "NOTE");
 }
Esempio n. 5
0
 function ProcessSubPanelListView($xTemplatePath, &$mod_strings)
 {
     global $app_strings;
     global $current_user;
     global $sugar_config;
     if (isset($this->listview)) {
         $ListView =& $this->listview;
     } else {
         $ListView = new ListView();
     }
     $ListView->initNewXTemplate($xTemplatePath, $this->subpanel_defs->mod_strings);
     $ListView->xTemplateAssign("RETURN_URL", "&return_module=" . $this->parent_module . "&return_action=DetailView&return_id=" . $this->parent_bean->id);
     $ListView->xTemplateAssign("RELATED_MODULE", $this->parent_module);
     // TODO: what about unions?
     $ListView->xTemplateAssign("RECORD_ID", $this->parent_bean->id);
     $ListView->xTemplateAssign("EDIT_INLINE_PNG", SugarThemeRegistry::current()->getImage('edit_inline', 'align="absmiddle"  border="0"', null, null, '.gif', $app_strings['LNK_EDIT']));
     $ListView->xTemplateAssign("DELETE_INLINE_PNG", SugarThemeRegistry::current()->getImage('delete_inline', 'align="absmiddle" border="0"', null, null, '.gif', $app_strings['LBL_DELETE_INLINE']));
     $ListView->xTemplateAssign("REMOVE_INLINE_PNG", SugarThemeRegistry::current()->getImage('delete_inline', 'align="absmiddle" border="0"', null, null, '.gif', $app_strings['LBL_ID_FF_REMOVE']));
     $header_text = '';
     $ListView->xTemplateAssign("SUBPANEL_ID", $this->subpanel_id);
     $ListView->xTemplateAssign("SUBPANEL_SEARCH", $this->getSearchForm());
     $display_sps = '';
     if ($this->search_query == '' && empty($this->collections)) {
         $display_sps = 'display:none';
     }
     $ListView->xTemplateAssign("DISPLAY_SPS", $display_sps);
     if (is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) {
         $exploded = explode('/', $xTemplatePath);
         $file_name = $exploded[sizeof($exploded) - 1];
         $mod_name = $exploded[sizeof($exploded) - 2];
         $header_text = "&nbsp;<a href='index.php?action=index&module=DynamicLayout&from_action={$file_name}&from_module={$mod_name}&mod_lang=" . $_REQUEST['module'] . "'>" . SugarThemeRegistry::current()->getImage("EditLayout", "border='0' align='bottom'", null, null, '.gif', 'Edit Layout') . "</a>";
     }
     $ListView->setHeaderTitle('');
     $ListView->setHeaderText('');
     ob_start();
     $ListView->is_dynamic = true;
     $ListView->records_per_page = $sugar_config['list_max_entries_per_subpanel'] + 0;
     if (isset($this->subpanel_defs->_instance_properties['records_per_page'])) {
         $ListView->records_per_page = $this->subpanel_defs->_instance_properties['records_per_page'] + 0;
     }
     $ListView->start_link_wrapper = "javascript:showSubPanel('" . $this->subpanel_id . "','";
     $ListView->subpanel_id = $this->subpanel_id;
     $ListView->end_link_wrapper = "',true);";
     if (!empty($this->layout_def_key)) {
         $ListView->end_link_wrapper = '&layout_def_key=' . $this->layout_def_key . $ListView->end_link_wrapper;
     }
     $where = '';
     $ListView->setQuery($where, '', '', '');
     $ListView->show_export_button = false;
     //function returns the query that was used to populate sub-panel data.
     $query = $ListView->process_dynamic_listview($this->parent_module, $this->parent_bean, $this->subpanel_defs);
     $this->subpanel_query = $query;
     $ob_contents = ob_get_contents();
     ob_end_clean();
     return $ob_contents;
 }
Esempio n. 6
0
$frame_type = "Secondary";
if (empty($focus_triggers_list)) {
    //echo "<BR><font color='red'><b>".$mod_strings['LBL_LACK_OF_TRIGGER_ALERT']."</b></font><BR>";
    $frame_type = "Primary";
}
/*
if(empty($focus_triggers_list)){

	$button .= "<input title='".$current_module_strings['LBL_NEW_TRIGGER_BUTTON_TITLE']."' accessKey='".$current_module_strings['LBL_NEW_TRIGGER_BUTTON_KEY']."' class='button' type='button' name='New' value='  ".$current_module_strings['LBL_NEW_TRIGGER_BUTTON_LABEL']."'";
	$button .= "LANGUAGE=javascript onclick='window.open(\"index.php?module=WorkFlowTriggerShells&action=CreateStep1&sugar_body_only=true&form=ComponentView&workflow_id=$focus->id\",\"new\",\"width=400,height=500,resizable=1,scrollbars=1\");'>";
	echo "<BR><font color='red'><b>".$mod_strings['LBL_LACK_OF_TRIGGER_ALERT']."</b></font><BR>";
}

	$button .= "&nbsp;&nbsp;<input title='".$current_module_strings['LBL_NEW_FILTER_BUTTON_TITLE']."' accessKey='".$current_module_strings['LBL_NEW_FILTER_BUTTON_KEY']."' class='button' type='button' name='New' value='  ".$current_module_strings['LBL_NEW_FILTER_BUTTON_LABEL']."'";
	$button .= "LANGUAGE=javascript onclick='window.open(\"index.php?module=WorkFlowTriggerShells&action=CreateStep1&sugar_body_only=true&form=ComponentView&workflow_id=$focus->id&frame_type=Secondary\",\"new\",\"width=400,height=500,resizable=1,scrollbars=1\");'>";
*/
$button .= "<input title='" . $app_strings['LBL_NEW_BUTTON_TITLE'] . "' accessKey='" . $app_strings['LBL_NEW_BUTTON_TITLE'] . "' class='button' type='button' name='NewWorkFlowTriggerShells' id='NewWorkFlowTriggerShells' value='" . $app_strings['LBL_NEW_BUTTON_LABEL'] . "'";
$button .= "LANGUAGE=javascript onclick='window.open(\"index.php?module=WorkFlowTriggerShells&action=CreateStep1&sugar_body_only=true&form=ComponentView&workflow_id={$focus->id}&frame_type={$frame_type}\",\"new\",\"width=400,height=500,resizable=1,scrollbars=1\");'>";
$button .= "</form>\n";
require_once 'include/SugarSmarty/plugins/function.sugar_action_menu.php';
$action_buttons = smarty_function_sugar_action_menu(array('id' => 'ACLRoles_EditView_action_menu', 'buttons' => array($button)), $xtpl);
$ListView = new ListView();
$header_text = '';
$ListView->initNewXTemplate('modules/WorkFlowTriggerShells/SubPanelView.html', $current_module_strings);
$ListView->xTemplateAssign("WORKFLOW_ID", $focus->id);
$ListView->xTemplateAssign("RETURN_URL", "&return_module=" . $currentModule . "&return_action=DetailView&return_id={$_REQUEST['record']}");
$ListView->xTemplateAssign("EDIT_INLINE_PNG", SugarThemeRegistry::current()->getImage('edit_inline', 'align="absmiddle" border="0"', null, null, '.gif', $app_strings['LNK_EDIT']));
$ListView->xTemplateAssign("DELETE_INLINE_PNG", SugarThemeRegistry::current()->getImage('delete_inline', 'align="absmiddle" border="0"', null, null, '.gif', $app_strings['LNK_REMOVE']));
$ListView->setHeaderTitle($current_module_strings['LBL_MODULE_NAME'] . $header_text);
$ListView->setHeaderText($action_buttons);
$ListView->processListView($focus_all_triggers_list, "main", "TRIGGER");
Esempio n. 7
0
 /**
  *
  */
 function process_page()
 {
     global $theme;
     global $mod_strings;
     global $app_strings;
     global $currentModule;
     global $sugar_version, $sugar_config;
     global $app_list_strings;
     global $sugar_config;
     $b_from_documents = false;
     if (isset($_REQUEST['caller']) && $_REQUEST['caller'] == 'Documents') {
         $b_from_documents = true;
     }
     //initalize template
     $form = new XTemplate('modules/Documents/Popup_picker.html');
     $form->assign('MOD', $mod_strings);
     $form->assign('APP', $app_strings);
     $form->assign('THEME', $theme);
     $form->assign('MODULE_NAME', $currentModule);
     //tree header.
     $doctree = new Tree('doctree');
     $doctree->set_param('module', 'Documents');
     if ($b_from_documents) {
         $doctree->set_param('caller', 'Documents');
         $href_string = "javascript:populate_parent_search('doctree')";
     } else {
         $href_string = "javascript:populate_search('doctree')";
     }
     $nodes = get_category_nodes($href_string);
     foreach ($nodes as $node) {
         $doctree->add_node($node);
     }
     $form->assign("TREEHEADER", $doctree->generate_header());
     $form->assign("TREEINSTANCE", $doctree->generate_nodes_array());
     $site_data = "<script> var site_url= {\"site_url\":\"" . getJavascriptSiteURL() . "\"};</script>\n";
     $form->assign("SITEURL", $site_data);
     $form->parse('main.SearchHeader.TreeView');
     $treehtml = $form->text('main.SearchHeader.TreeView');
     $form->reset('main.SearchHeader.TreeView');
     //end tree
     if (isset($_REQUEST['caller']) && $_REQUEST['caller'] == 'Documents') {
         ///process treeview and return.
         return insert_popup_header($theme) . $treehtml . insert_popup_footer();
     }
     ////////////////////////process full search form and list view.//////////////////////////////
     $output_html = '';
     $where = '';
     $where = $this->_get_where_clause();
     $name = empty($_REQUEST['name']) ? '' : $_REQUEST['name'];
     $document_name = empty($_REQUEST['document_name']) ? '' : $_REQUEST['document_name'];
     $category_id = empty($_REQUEST['category_id']) ? '' : $_REQUEST['category_id'];
     $subcategory_id = empty($_REQUEST['subcategory_id']) ? '' : $_REQUEST['subcategory_id'];
     $template_type = empty($_REQUEST['template_type']) ? '' : $_REQUEST['template_type'];
     $is_template = empty($_REQUEST['is_template']) ? '' : $_REQUEST['is_template'];
     $request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data'];
     $hide_clear_button = empty($_REQUEST['hide_clear_button']) ? false : true;
     $button = "<form action='index.php' method='post' name='form' id='form'>\n";
     if (!$hide_clear_button) {
         $button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='" . $app_strings['LBL_CLEAR_BUTTON_TITLE'] . "'  value='  " . $app_strings['LBL_CLEAR_BUTTON_LABEL'] . "  ' />\n";
     }
     $button .= "<input type='submit' name='button' class='button' onclick=\"window.close();\" title='" . $app_strings['LBL_CANCEL_BUTTON_TITLE'] . "' accesskey='" . $app_strings['LBL_CANCEL_BUTTON_KEY'] . "' value='  " . $app_strings['LBL_CANCEL_BUTTON_LABEL'] . "  ' />\n";
     $button .= "</form>\n";
     $form->assign('NAME', $name);
     $form->assign('DOCUMENT_NAME', $document_name);
     $form->assign('request_data', $request_data);
     $form->assign("CATEGORY_OPTIONS", get_select_options_with_id($app_list_strings['document_category_dom'], $category_id));
     $form->assign("SUB_CATEGORY_OPTIONS", get_select_options_with_id($app_list_strings['document_subcategory_dom'], $subcategory_id));
     $form->assign("IS_TEMPLATE_OPTIONS", get_select_options_with_id($app_list_strings['checkbox_dom'], $is_template));
     $form->assign("TEMPLATE_TYPE_OPTIONS", get_select_options_with_id($app_list_strings['document_template_type_dom'], $template_type));
     ob_start();
     insert_popup_header($theme);
     $output_html .= ob_get_contents();
     ob_end_clean();
     $output_html .= get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE'], '', false);
     $form->parse('main.SearchHeader');
     $output_html .= $form->text('main.SearchHeader');
     // Reset the sections that are already in the page so that they do not print again later.
     $form->reset('main.SearchHeader');
     //add tree view to output_html.
     $output_html .= $treehtml;
     // create the listview
     $seed_bean = new Document();
     $ListView = new ListView();
     $ListView->show_select_menu = false;
     $ListView->show_delete_button = false;
     $ListView->show_export_button = false;
     $ListView->process_for_popups = true;
     $ListView->setXTemplate($form);
     $ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE']);
     $ListView->setHeaderText($button);
     $ListView->setQuery($where, '', 'document_name', 'DOCUMENT');
     $ListView->setModStrings($mod_strings);
     ob_start();
     $ListView->processListView($seed_bean, 'main', 'DOCUMENT');
     $output_html .= ob_get_contents();
     ob_end_clean();
     $output_html .= insert_popup_footer();
     return $output_html;
 }
    if (isset($name)) {
        $search_form->assign("FNAME", to_html($fname));
    }
    if (isset($pnum)) {
        $search_form->assign("PNAME", to_html($pname));
    }
    //if (isset($type)) $search_form->assign("TYPE", to_html($type));
    //if (isset($spec)) $search_form->assign("SPEC", to_html($spec));
    if (isset($current_user_only)) {
        $search_form->assign("CURRENT_USER_ONLY", "checked");
    }
    //if(isset($subordinate_only)) $search_form->assign("SUBORDINATE_ONLY", "checked");
    $header_text = '';
    if (is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) {
        $header_text = "<a href='index.php?action=index&module=DynamicLayout&from_action=SearchForm&from_module=" . $_REQUEST['module'] . "'>" . get_image($image_path . "EditLayout", "border='0' alt='Edit Layout' align='bottom'") . "</a>";
    }
    echo get_form_header($current_module_strings['LBL_SEARCH_FORM_TITLE'], $header_text, false);
    $search_form->parse("main");
    $search_form->out("main");
    echo get_form_footer();
    echo "\n<BR>\n";
}
$ListView = new ListView();
$ListView->initNewXTemplate('modules/Paper/ListView.html', $current_module_strings);
$ListView->setHeaderTitle($current_module_strings['LBL_LIST_FORM_TITLE']);
global $current_user;
if (is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) {
    $ListView->setHeaderText("<a href='index.php?action=index&module=DynamicLayout&from_action=ListView&from_module=" . $_REQUEST['module'] . "'>" . get_image($image_path . "EditLayout", "border='0' alt='Edit Layout' align='bottom'") . "</a>");
}
$ListView->setQuery($where, "", "date_modified desc", "PAPER");
$ListView->processListView($seedPaper, "main", "PAPER");
Esempio n. 9
0
global $app_list_strings;
global $current_language;
global $current_user;
global $urlPrefix;
global $currentModule;
$current_module_strings = return_module_language($current_language, 'ZuckerReports');
echo "\n<p>\n";
echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_MODULE_TITLE'], false);
echo "\n</p>\n";
global $theme;
$button = "";
if (is_admin($current_user)) {
    $button .= "<form action='index.php' method='post'>\n";
    $button .= "<input type='hidden' name='module' value='ZuckerReportParameter'>\n";
    $button .= "<input type='hidden' name='action'>\n";
    $button .= "<input type='hidden' name='return_module' value='ZuckerReportParameter'>\n";
    $button .= "<input type='hidden' name='return_action' value='ListView'>\n";
    $button .= "<input class='button' onclick='this.form.action.value=\"EditView\"' type='submit' value=' " . $mod_strings['LBL_PARAM_NEW'] . "  '>\n";
    $button .= "</form>\n";
}
$seed = new ReportParameter();
$lv = new ListView();
$lv->initNewXTemplate('modules/ZuckerReportParameter/ListView.html', $current_module_strings);
$lv->setHeaderTitle($current_module_strings['LNK_PARAMETER_LIST']);
$lv->setHeaderText($button);
$lv->show_export_button = false;
$lv->show_mass_update = false;
$lv->show_delete_button = false;
$lv->show_select_menu = false;
$lv->setQuery("", "", "default_name", "PARAM");
$lv->processListView($seed, "main", "PARAM");
Esempio n. 10
0
$selectTimePeriod .= "</td>\n";
$listViewHeader = $selectTimePeriod . $currentUserQuotaRow;
$listViewHeader .= "</tr>\n";
$where = "quotas.deleted=0 AND users.deleted = 0 ";
if (!empty($_REQUEST['timeperiod_id'])) {
    $where .= " AND quotas.timeperiod_id = '" . $_REQUEST['timeperiod_id'] . "'";
}
///////////////////////////////////////////////////////////////////////////////
////	QUOTAS MODULE LIST VIEW
$ListView = new ListView();
if (is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) {
    $header_text = "&nbsp;<a href='index.php?action=index&module=DynamicLayout&from_action=ListView&from_module=" . $_REQUEST['module'] . "'>" . SugarThemeRegistry::current()->getImage("EditLayout", "border='0' align='bottom'", null, null, '.gif', $mod_strings['LBL_EDITLAYOUT']) . "</a>";
}
$ListView->initNewXTemplate('modules/Quotas/ListView.html', $mod_strings);
$ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE'] . $header_text);
$ListView->setHeaderText($listViewHeader);
$ListView->show_export_button = false;
$ListView->show_mass_update = false;
$ListView->show_delete_button = false;
$ListView->show_select_menu = false;
$ListView->setQuery($where, "", "", "QUOTA");
$row_count = $focus->getQuotaRowCount($focus->create_new_list_query("", $where));
if (!empty($_REQUEST['timeperiod_id'])) {
    /* if the user is not a manager, get the user's self quota
     * and use a strip down version of ListView to process the
     * quota object
     */
    if (!$focus->isManager($current_user->id)) {
        $ListView->processListView($focus, "", "");
    } else {
        /* if records are available for the direct reports, 
Esempio n. 11
0
    /**
     *
     */
    function process_page_for_address()
    {
        global $theme;
        global $mod_strings;
        global $app_strings;
        global $currentModule;
        global $sugar_version, $sugar_config;
        $output_html = '';
        $where = '';
        $where = $this->_get_where_clause();
        $formBase = new ContactFormBase();
        if (isset($_REQUEST['doAction']) && $_REQUEST['doAction'] == 'save') {
            $formBase->handleSave('', false, true);
        }
        $first_name = empty($_REQUEST['first_name']) ? '' : $_REQUEST['first_name'];
        $last_name = empty($_REQUEST['last_name']) ? '' : $_REQUEST['last_name'];
        $account_name = empty($_REQUEST['account_name']) ? '' : $_REQUEST['account_name'];
        $request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data'];
        $hide_clear_button = empty($_REQUEST['hide_clear_button']) ? false : true;
        $lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
        $lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
        $lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
        // TODO: cleanup the construction of $addform
        $formbody = $formBase->getFormBody('', '', 'EmailEditView');
        $addform = '<table><tr><td nowrap="nowrap" valign="top">' . str_replace('<br>', '</td><td nowrap="nowrap" valign="top">&nbsp;', $formbody) . '</td></tr></table>' . '<input type="hidden" name="action" value="Popup" />';
        $formSave = <<<EOQ
\t\t<input type="submit" name="button" class="button" title="{$lbl_save_button_title}" accesskey="{$lbl_save_button_key}" value="  {$lbl_save_button_label}  " />
\t\t<input type="button" name="button" class="button" title="{$app_strings['LBL_CANCEL_BUTTON_TITLE']}" accesskey="{$app_strings['LBL_CANCEL_BUTTON_KEY']}" value="{$app_strings['LBL_CANCEL_BUTTON_LABEL']}" onclick="toggleDisplay('addform');" />
EOQ;
        $createContact = <<<EOQ
\t\t<input type="button" id="showAdd" name="showAdd" class="button" value="{$mod_strings['LNK_NEW_CONTACT']}" onclick="toggleDisplay('addform');" />
EOQ;
        $addformheader = get_form_header($mod_strings['LNK_NEW_CONTACT'], $formSave, false);
        $button = "<form action='index.php' method='post' name='form' id='form'>\n";
        if (!$hide_clear_button) {
            $button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='" . $app_strings['LBL_CLEAR_BUTTON_TITLE'] . "' accesskey='" . $app_strings['LBL_CLEAR_BUTTON_KEY'] . "' value='  " . $app_strings['LBL_CLEAR_BUTTON_LABEL'] . "  ' />\n";
        }
        $button .= "<input type='submit' name='button' class='button' onclick=\"window.close();\" title='" . $app_strings['LBL_CANCEL_BUTTON_TITLE'] . "' accesskey='" . $app_strings['LBL_CANCEL_BUTTON_KEY'] . "' value='  " . $app_strings['LBL_CANCEL_BUTTON_LABEL'] . "  ' />\n";
        $button .= "</form>\n";
        $form = new XTemplate('modules/Contacts/Address_picker.html');
        $form->assign('MOD', $mod_strings);
        $form->assign('APP', $app_strings);
        $form->assign('ADDFORMHEADER', $addformheader);
        $form->assign('ADDFORM', $addform);
        $form->assign('THEME', $theme);
        $form->assign('MODULE_NAME', $currentModule);
        $form->assign('FIRST_NAME', $first_name);
        $form->assign('LAST_NAME', $last_name);
        $form->assign('ACCOUNT_NAME', $account_name);
        $form->assign('request_data', $request_data);
        // fill in for mass update
        $button = "<input type='hidden' name='module' value='Contacts'>" . "<input type='hidden' id='form_action' name='action' value='CloseContactAddressPopup'>" . "<input type='hidden' name='massupdate' value='true'>" . "<input type='hidden' name='delete' value='false'>" . "<input type='hidden' name='mass' value='Array'>" . "<input type='hidden' name='Update' value='Update'>";
        if (isset($_REQUEST['mass']) && is_array($_REQUEST['mass'])) {
            foreach (array_unique($_REQUEST['mass']) as $record) {
                $button .= "<input style='display: none' checked type='checkbox' name='mass[]' value='{$record}'>\n";
            }
        }
        $button .= "<input type='hidden' name='query' value='true'>";
        $button .= "<input type='hidden' name='saved_associated_data' value=''>";
        $button .= "<input type='hidden' name='close_window' value='true'>";
        $button .= "<input type='hidden' name='html' value='change_address'>";
        $button .= "<input type='hidden' name='account_name' value='{$account_name}'>";
        // Added ID attribute to each element to use getElementById. To give ID attribute to an element is a good practice.
        $button .= "<span style='display: none'><textarea name='primary_address_street' id='primary_address_street'>" . str_replace("&lt;br&gt;", "\n", $_REQUEST["primary_address_street"]) . "</textarea></span>";
        $button .= "<input type='hidden' name='primary_address_city' id='primary_address_city' value='" . $_REQUEST["primary_address_city"] . "'>";
        $button .= "<input type='hidden' name='primary_address_state' id='primary_address_state' value='" . $_REQUEST["primary_address_state"] . "'>";
        $button .= "<input type='hidden' name='primary_address_postalcode' id='primary_address_postalcode' value='" . $_REQUEST["primary_address_postalcode"] . "'>";
        $button .= "<input type='hidden' name='primary_address_country' id='primary_address_country' value='" . $_REQUEST["primary_address_country"] . "'>";
        // Adding an onclick event to remove address for alternate address, as user has selected copy address to primary address
        $button .= "<input title='" . $mod_strings['LBL_COPY_ADDRESS_CHECKED_PRIMARY'] . "'  class='button' LANGUAGE=javascript type='submit' name='button' value='  " . $mod_strings['LBL_COPY_ADDRESS_CHECKED_PRIMARY'] . "  ' onclick='clearAddress(\"alt\");'>\n";
        // Adding a new block of code copy the address to alternate address for contacts
        $button .= "<span style='display: none'><textarea name='alt_address_street' id='alt_address_street'>" . str_replace("&lt;br&gt;", "\n", $_REQUEST["primary_address_street"]) . "</textarea></span>";
        $button .= "<input type='hidden' name='alt_address_city' id='alt_address_city' value='" . $_REQUEST["primary_address_city"] . "'>";
        $button .= "<input type='hidden' name='alt_address_state' id='alt_address_state' value='" . $_REQUEST["primary_address_state"] . "'>";
        $button .= "<input type='hidden' name='alt_address_postalcode' id='alt_address_postalcode' value='" . $_REQUEST["primary_address_postalcode"] . "'>";
        $button .= "<input type='hidden' name='alt_address_country' id='alt_address_country' value='" . $_REQUEST["primary_address_country"] . "'>";
        // Adding an onclick event to remove address for primary address, as user has selected copy address to alternate address
        // NOTE => You need to change the label as as per SugarCRM way..
        $button .= "<input title='" . $mod_strings['LBL_COPY_ADDRESS_CHECKED_ALT'] . "'  class='button' LANGUAGE=javascript type='submit' name='button' value='  " . $mod_strings['LBL_COPY_ADDRESS_CHECKED_ALT'] . "  ' onclick='clearAddress(\"primary\");'>\n";
        $button .= "<input title='" . $app_strings['LBL_CANCEL_BUTTON_TITLE'] . "' accessKey='" . $app_strings['LBL_CANCEL_BUTTON_KEY'] . "' class='button' LANGUAGE=javascript onclick=\"window.close()\" type='submit' name='button' value='  " . $app_strings['LBL_CANCEL_BUTTON_LABEL'] . "  '>\n";
        ob_start();
        insert_popup_header($theme);
        $output_html .= ob_get_contents();
        ob_end_clean();
        // Reset the sections that are already in the page so that they do not print again later.
        $form->reset('main.SearchHeader');
        // create the listview
        $seed_bean = new Contact();
        $ListView = new ListView();
        $ListView->show_export_button = false;
        $ListView->process_for_popups = true;
        $ListView->show_delete_button = false;
        $ListView->show_select_menu = false;
        $ListView->setXTemplate($form);
        $ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE']);
        $ListView->setHeaderText($button);
        $ListView->setQuery($where, '', '', 'CONTACT');
        $ListView->setModStrings($mod_strings);
        ob_start();
        $ListView->processListViewMulti($seed_bean, 'main', 'CONTACT');
        $output_html .= ob_get_contents();
        ob_end_clean();
        // Regular Expression to override sListView
        $exp = '/sListView.save_checks/si';
        $change = 'save_checks';
        $output_html = preg_replace(array($exp), array($change), $output_html);
        $output_html .= <<<EOJS
        <script type="text/javascript">
        <!--
        // Function to clear address according to the buttons clicked.
        function clearAddress(key)
        {
            document.getElementById(key+"_address_street").value = "";
            document.getElementById(key+"_address_city").value = "";
            document.getElementById(key+"_address_state").value = "";
            document.getElementById(key+"_address_postalcode").value = "";
            document.getElementById(key+"_address_country").value = "";
        }
        checked_items = Array();
        inputs_array = document.MassUpdate.elements;
        
        for(wp = 0 ; wp < inputs_array.length; wp++) {
            if(inputs_array[wp].name == "mass[]" && inputs_array[wp].style.display == "none") {
                checked_items.push(inputs_array[wp].value);
            } 
        }
        for(i in checked_items) {
            for(wp = 0 ; wp < inputs_array.length; wp++) {
                if(inputs_array[wp].name == "mass[]" && inputs_array[wp].value == checked_items[i]) {
                    inputs_array[wp].checked = true;
                }
            }
        }
        -->
        </script>
EOJS;
        $output_html .= insert_popup_footer();
        return $output_html;
    }
Esempio n. 12
0
 $edit_botton .= '<input type="hidden" name="record" value="' . $focus_id . '">';
 $edit_botton .= '<input type="hidden" name="action">';
 $edit_botton .= '<input type="hidden" name="edit">';
 $edit_botton .= '<input type="hidden" name="return_module" value="Currencies">';
 $edit_botton .= '<input type="hidden" name="return_action" value="index">';
 $edit_botton .= '<input type="hidden" name="return_id" value="">';
 $header_text = '';
 if (is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) {
     $header_text = "&nbsp;<a href='index.php?action=index&module=DynamicLayout&from_action=ListView&from_module=" . $_REQUEST['module'] . "'>" . SugarThemeRegistry::current()->getImage("EditLayout", "border='0' align='bottom'", null, null, '.gif', $mod_strings['LBL_EDIT_LAYOUT']) . "</a>";
 }
 $ListView = new ListView();
 $ListView->initNewXTemplate('modules/Currencies/ListView.html', $mod_strings);
 $ListView->xTemplateAssign('PRETABLE', $pretable);
 $ListView->xTemplateAssign('POSTTABLE', '</form>');
 //$ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE']. $header_text );
 $ListView->setHeaderText($merge_button);
 $ListView->processListView($lc->list, "main", "CURRENCY");
 if (isset($_GET['record']) && !empty($_GET['record']) && !isset($_POST['edit'])) {
     $focus->retrieve($_GET['record']);
     $focus->conversion_rate = format_number($focus->conversion_rate, 10, 10);
 }
 if (is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) {
     $header_text = "&nbsp;<a href='index.php?action=index&module=DynamicLayout&from_action=EditView&from_module=" . $_REQUEST['module'] . "'>" . SugarThemeRegistry::current()->getImage("EditLayout", "border='0' align='bottom'", null, null, '.gif', $mod_strings['LBL_EDIT_LAYOUT']) . "</a>";
 }
 if (empty($focus->id)) {
     echo get_form_header($app_strings['LBL_CREATE_BUTTON_LABEL'] . ' Currency' . $header_text, $edit_botton, false);
 } else {
     echo get_form_header($app_strings['LBL_EDIT_BUTTON_LABEL'] . " &raquo; " . $focus->name . $header_text, $edit_botton, false);
 }
 $sugar_smarty = new Sugar_Smarty();
 $sugar_smarty->assign("MOD", $mod_strings);
Esempio n. 13
0
 /**
  *
  */
 function process_page()
 {
     global $theme;
     global $mod_strings;
     global $app_strings;
     global $currentModule;
     global $image_path;
     $output_html = '';
     $where = '';
     $where = $this->_get_where_clause();
     $name = empty($_REQUEST['name']) ? '' : $_REQUEST['name'];
     $request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data'];
     $hide_clear_button = empty($_REQUEST['hide_clear_button']) ? false : true;
     $button = '';
     $form = new XTemplate('modules/ACLRoles/ListView.html');
     $form->assign('MOD', $mod_strings);
     $form->assign('APP', $app_strings);
     $form->assign('THEME', $theme);
     $form->assign('MODULE_NAME', $currentModule);
     $form->assign('NAME', $name);
     $form->assign('request_data', $request_data);
     $output_html .= get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE'], '', false);
     $form->parse('main.SearchHeader');
     $output_html .= $form->text('main.SearchHeader');
     $output_html .= get_form_footer();
     // Reset the sections that are already in the page so that they do not print again later.
     $form->reset('main.SearchHeader');
     // create the listview
     $seed_bean = new ACLRole();
     $ListView = new ListView();
     $ListView->show_export_button = false;
     $ListView->process_for_popups = true;
     $ListView->setXTemplate($form);
     $ListView->setHeaderTitle($mod_strings['LBL_ROLE']);
     $ListView->setHeaderText($button);
     $ListView->setQuery($where, '', 'name', 'ROLE');
     $ListView->setModStrings($mod_strings);
     ob_start();
     $ListView->processListView($seed_bean, 'main', 'ROLE');
     $output_html .= ob_get_contents();
     ob_end_clean();
     $output_html .= get_form_footer();
     $output_html .= insert_popup_footer();
     return $output_html;
 }
    /**
     *
     */
    function process_page_for_address()
    {
        global $theme;
        global $mod_strings;
        global $app_strings;
        global $currentModule;
        global $sugar_version, $sugar_config;
        $output_html = '';
        $where = '';
        $where = $this->_get_where_clause();
        $image_path = 'themes/' . $theme . '/images/';
        $formBase = new ContactFormBase();
        if (isset($_REQUEST['doAction']) && $_REQUEST['doAction'] == 'save') {
            $formBase->handleSave('', false, true);
        }
        $first_name = empty($_REQUEST['first_name']) ? '' : $_REQUEST['first_name'];
        $last_name = empty($_REQUEST['last_name']) ? '' : $_REQUEST['last_name'];
        $account_name = empty($_REQUEST['account_name']) ? '' : $_REQUEST['account_name'];
        $request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data'];
        $hide_clear_button = empty($_REQUEST['hide_clear_button']) ? false : true;
        $lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
        $lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
        $lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
        // TODO: cleanup the construction of $addform
        $formbody = $formBase->getFormBody('', '', 'EmailEditView');
        $addform = '<table><tr><td nowrap="nowrap" valign="top">' . str_replace('<br>', '</td><td nowrap="nowrap" valign="top">&nbsp;', $formbody) . '</td></tr></table>' . '<input type="hidden" name="action" value="Popup" />';
        $formSave = <<<EOQ
\t\t<input type="submit" name="button" class="button" title="{$lbl_save_button_title}" accesskey="{$lbl_save_button_key}" value="  {$lbl_save_button_label}  " />
\t\t<input type="button" name="button" class="button" title="{$app_strings['LBL_CANCEL_BUTTON_TITLE']}" accesskey="{$app_strings['LBL_CANCEL_BUTTON_KEY']}" value="{$app_strings['LBL_CANCEL_BUTTON_LABEL']}" onclick="toggleDisplay('addform');" />
EOQ;
        $createContact = <<<EOQ
\t\t<input type="button" name="showAdd" class="button" value="{$mod_strings['LNK_NEW_CONTACT']}" onclick="toggleDisplay('addform');" />
EOQ;
        $addformheader = get_form_header($mod_strings['LNK_NEW_CONTACT'], $formSave, false);
        $button = "<form action='index.php' method='post' name='form' id='form'>\n";
        if (!$hide_clear_button) {
            $button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='" . $app_strings['LBL_CLEAR_BUTTON_TITLE'] . "' accesskey='" . $app_strings['LBL_CLEAR_BUTTON_KEY'] . "' value='  " . $app_strings['LBL_CLEAR_BUTTON_LABEL'] . "  ' />\n";
        }
        $button .= "<input type='submit' name='button' class='button' onclick=\"window.close();\" title='" . $app_strings['LBL_CANCEL_BUTTON_TITLE'] . "' accesskey='" . $app_strings['LBL_CANCEL_BUTTON_KEY'] . "' value='  " . $app_strings['LBL_CANCEL_BUTTON_LABEL'] . "  ' />\n";
        $button .= "</form>\n";
        $form = new XTemplate('modules/Contacts/Address_picker.html');
        $form->assign('MOD', $mod_strings);
        $form->assign('APP', $app_strings);
        //$form->assign('CREATECONTACT', $createContact);
        $form->assign('ADDFORMHEADER', $addformheader);
        $form->assign('ADDFORM', $addform);
        $form->assign('THEME', $theme);
        $form->assign('MODULE_NAME', $currentModule);
        $form->assign('FIRST_NAME', $first_name);
        $form->assign('LAST_NAME', $last_name);
        $form->assign('ACCOUNT_NAME', $account_name);
        $form->assign('request_data', $request_data);
        // fill in for mass update
        $button = "<input type='hidden' name='module' value='Contacts'><input type='hidden' id='form_action' name='action' value='index'><input type='hidden' name='massupdate' value='true'><input type='hidden' name='delete' value='false'><input type='hidden' name='mass' value='Array'><input type='hidden' name='Update' value='Update'>";
        if (isset($_REQUEST['mass']) && is_array($_REQUEST['mass'])) {
            foreach (array_unique($_REQUEST['mass']) as $record) {
                $button .= "<input style='display: none' checked type='checkbox' name='mass[]' value='{$record}'>\n";
            }
        }
        $button .= "<input type='hidden' name='saved_associated_data' value=''>";
        $button .= "<input type='hidden' name='query' value='true'>";
        $button .= "<input type='hidden' name='close_window' value='true'>";
        $button .= "<input type='hidden' name='html' value='change_address'>";
        $button .= "<input type='hidden' name='account_name' value='{$account_name}'>";
        $button .= "<span style='display: none'><textarea name='primary_address_street'>" . str_replace("&lt;br&gt;", "\n", $_REQUEST["primary_address_street"]) . "</textarea></span>";
        $button .= "<input type='hidden' name='primary_address_city' value='" . $_REQUEST["primary_address_city"] . "'>";
        $button .= "<input type='hidden' name='primary_address_state' value='" . $_REQUEST["primary_address_state"] . "'>";
        $button .= "<input type='hidden' name='primary_address_postalcode' value='" . $_REQUEST["primary_address_postalcode"] . "'>";
        $button .= "<input type='hidden' name='primary_address_country' value='" . $_REQUEST["primary_address_country"] . "'>";
        $button .= "<input type='hidden' name='Contacts_CONTACT_offset' value=''>";
        $button .= "<input title='" . $mod_strings['LBL_COPY_ADDRESS_CHECKED'] . "'  class='button' LANGUAGE=javascript type='submit' name='button' value='  " . $mod_strings['LBL_COPY_ADDRESS_CHECKED'] . "  '>\n";
        $button .= "<input title='" . $app_strings['LBL_CANCEL_BUTTON_TITLE'] . "' accessKey='" . $app_strings['LBL_CANCEL_BUTTON_KEY'] . "' class='button' LANGUAGE=javascript onclick=\"window.close()\" type='submit' name='button' value='  " . $app_strings['LBL_CANCEL_BUTTON_LABEL'] . "  '>\n";
        ob_start();
        insert_popup_header($theme);
        $output_html .= ob_get_contents();
        ob_end_clean();
        //$output_html .= get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE'], '', false);
        //$form->parse('main.SearchHeader');
        //$output_html .= $form->text('main.SearchHeader');
        $output_html .= get_form_footer();
        // Reset the sections that are already in the page so that they do not print again later.
        $form->reset('main.SearchHeader');
        // create the listview
        $seed_bean = new Contact();
        $ListView = new ListView();
        $ListView->show_export_button = false;
        $ListView->setXTemplate($form);
        $ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE']);
        $ListView->setHeaderText($button);
        $ListView->setQuery($where, '', '', 'CONTACT');
        $ListView->setModStrings($mod_strings);
        // Added
        $ListView->process_for_popups = true;
        ob_start();
        $ListView->processListViewMulti($seed_bean, 'main', 'CONTACT');
        $output_html .= ob_get_contents();
        ob_end_clean();
        // The following is a regular expression filter that will convert the nested <a>...</a> tags
        // for the Next and Previous button links.  The regular expression has 7 placeholder fields
        // Given sample HTML as follows
        /* -------------------------------------
                <a href="/maint_4_5_0/index.php?module=Contacts&action=Popup&query=true&account_name=360 Vacations 723351&html=change_address&primary_address_street=111 Silicon Valley Road&primary_address_city=Ohio&primary_address_state=CA&primary_address_postalcode=53430&primary_address_country=USA&mode=undefined&create=undefined&metadata=undefined&Contacts_CONTACT_offset=20" onclick="javascript:return sListView.save_checks(20, \'Contacts_CONTACT_offset\')" class="listViewPaginationLinkS1">Next&nbsp;
                <img src=\'themes/GoldenGate/images/next.gif\' width=\'8\' height=\'11\' alt=\'Next\'  border=\'0\' align=\'absmiddle\'></a>
                &nbsp;&nbsp;
                <a href="/maint_4_5_0/index.php?module=Contacts&action=Popup&query=true&account_name=360 Vacations 723351&html=change_address&primary_address_street=111 Silicon Valley Road&primary_address_city=Ohio&primary_address_state=CA&primary_address_postalcode=53430&primary_address_country=USA&mode=undefined&create=undefined&metadata=undefined&Contacts_CONTACT_offset=-100" onclick="javascript:return sListView.save_checks(980, \'Contacts_CONTACT_offset\')" class="listViewPaginationLinkS1">End&nbsp;
                <img src=\'themes/GoldenGate/images/end.gif\' width=\'13\' height=\'11\' alt=\'End\'  border=\'0\' align=\'absmiddle\'>
                </a>
                --------------------------------------
                The resulting preg_replace call should create Array of matches:
        	    [1] => Array
        	        (
        	            [0] => 20
        	        )
        	
        	    [2] => Array
        	        (
        	            [0] => Next&nbsp;
        	        )
        	
        	    [3] => Array
        	        (
        	            [0] => <img src='themes/GoldenGate/images/next.gif' width='8' height='11' alt='Next'  border='0' align='absmiddle'>
        	        )
        	
        	    [4] => Array
        	        (
        	            [0] => &nbsp;&nbsp;
        	        )
        	
        	    [5] => Array
        	        (
        	            [0] => 980
        	        )
        	
        	    [6] => Array
        	        (
        	            [0] => End&nbsp;
        	        )
        	
        	    [7] => Array
        	        (
        	            [0] => <img src='themes/GoldenGate/images/end.gif' width='13' height='11' alt='End'  border='0' align='absmiddle'>
        	        )
        	    */
        $exp = '/<a.*?checks\\((\\d+),.*?>(.*?)(<img.*>).*<\\/a>(.*?)<a.*?checks\\((\\d+),.*?>(.*?)(<img.*>).*<\\/a>/Ui';
        $change = '<a class="listViewPaginationLinkS1" onclick="javascript:save_checks(${1}, \'Contacts_CONTACT_offset\');" href="#">
        ${2}${3}</a>${4}<a class="listViewPaginationLinkS1" onclick="javascript:save_checks(${5}, \'Contacts_CONTACT_offset\');" href="#">${6}${7}</a>';
        $output_html = preg_replace(array($exp), array($change), $output_html);
        $output_html .= '<script>		
		checked_items = Array();
		inputs_array = document.MassUpdate.elements;

		for(wp = 0 ; wp < inputs_array.length; wp++) {
			if(inputs_array[wp].name == "mass[]" && inputs_array[wp].style.display == "none") {
				checked_items.push(inputs_array[wp].value);
			} 
		}
		for(i in checked_items) {
			for(wp = 0 ; wp < inputs_array.length; wp++) {
				if(inputs_array[wp].name == "mass[]" && inputs_array[wp].value == checked_items[i]) {
					inputs_array[wp].checked = true;
				}
			}
		}



        </script>';
        $output_html .= get_form_footer();
        $output_html .= insert_popup_footer();
        return $output_html;
    }
Esempio n. 15
0
 function ProcessSubPanelListView($xTemplatePath, &$mod_strings)
 {
     global $app_strings;
     global $image_path;
     global $current_user;
     global $sugar_config;
     if (isset($this->listview)) {
         $ListView =& $this->listview;
     } else {
         $ListView = new ListView();
     }
     $ListView->initNewXTemplate($xTemplatePath, $this->subpanel_defs->mod_strings);
     $ListView->xTemplateAssign("RETURN_URL", "&return_module=" . $this->parent_module . "&return_action=DetailView&return_id=" . $this->parent_bean->id);
     $ListView->xTemplateAssign("RELATED_MODULE", $this->parent_module);
     // TODO: what about unions?
     $ListView->xTemplateAssign("RECORD_ID", $this->parent_bean->id);
     $ListView->xTemplateAssign("EDIT_INLINE_PNG", get_image($image_path . 'edit_inline', 'align="absmiddle" alt="' . $app_strings['LNK_EDIT'] . '" border="0"'));
     $ListView->xTemplateAssign("DELETE_INLINE_PNG", get_image($image_path . 'delete_inline', 'align="absmiddle" alt="' . $app_strings['LNK_DELETE'] . '" border="0"'));
     $ListView->xTemplateAssign("REMOVE_INLINE_PNG", get_image($image_path . 'delete_inline', 'align="absmiddle" alt="' . $app_strings['LNK_REMOVE'] . '" border="0"'));
     $header_text = '';
     if (is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) {
         $exploded = explode('/', $xTemplatePath);
         $file_name = $exploded[sizeof($exploded) - 1];
         $mod_name = $exploded[sizeof($exploded) - 2];
         $header_text = "&nbsp;<a href='index.php?action=index&module=DynamicLayout&from_action={$file_name}&from_module={$mod_name}&mod_lang=" . $_REQUEST['module'] . "'>" . get_image($image_path . "EditLayout", "border='0' alt='Edit Layout' align='bottom'") . "</a>";
     }
     $ListView->setHeaderTitle('');
     $ListView->setHeaderText('');
     ob_start();
     $ListView->is_dynamic = true;
     $ListView->records_per_page = $sugar_config['list_max_entries_per_subpanel'] + 0;
     $ListView->start_link_wrapper = "javascript:showSubPanel('" . $this->subpanel_id . "','";
     $ListView->subpanel_id = $this->subpanel_id;
     $ListView->end_link_wrapper = "',true);";
     $where = '';
     $ListView->setQuery($where, '', '', '');
     $ListView->show_export_button = false;
     //function returns the query that was used to populate sub-panel data.
     $query = $ListView->process_dynamic_listview($this->parent_module, $this->parent_bean, $this->subpanel_defs);
     $this->subpanel_query = $query;
     $ob_contents = ob_get_contents();
     ob_end_clean();
     return $ob_contents;
 }
Esempio n. 16
0
 /**
  *
  */
 function process_page()
 {
     global $theme;
     global $mod_strings;
     global $app_strings;
     global $app_list_strings;
     global $currentModule;
     global $sugar_version, $sugar_config;
     $output_html = '';
     $where = '';
     $where = $this->_get_where_clause();
     $name = empty($_REQUEST['name']) ? '' : $_REQUEST['name'];
     $status = empty($_REQUEST['status']) ? '' : $_REQUEST['status'];
     $campaign_type = empty($_REQUEST['campaign_type']) ? '' : $_REQUEST['campaign_type'];
     $request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data'];
     $hide_clear_button = empty($_REQUEST['hide_clear_button']) ? false : true;
     $button = "<form action='index.php' method='post' name='form' id='form'>\n";
     //START:FOR MULTI-SELECT
     $multi_select = false;
     if (!empty($_REQUEST['mode']) && strtoupper($_REQUEST['mode']) == 'MULTISELECT') {
         $multi_select = true;
         $button .= "<input type='button' name='button' class='button' onclick=\"send_back_selected('Prospects',document.MassUpdate,'mass[]','" . $app_strings['ERR_NOTHING_SELECTED'] . "');\" title='" . $app_strings['LBL_SELECT_BUTTON_TITLE'] . "' accesskey='" . $app_strings['LBL_SELECT_BUTTON_KEY'] . "' value='  " . $app_strings['LBL_SELECT_BUTTON_LABEL'] . "  ' />\n";
     }
     //END:FOR MULTI-SELECT
     if (!$hide_clear_button) {
         $button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='" . $app_strings['LBL_CLEAR_BUTTON_TITLE'] . "' accesskey='" . $app_strings['LBL_CLEAR_BUTTON_KEY'] . "' value='  " . $app_strings['LBL_CLEAR_BUTTON_LABEL'] . "  ' />\n";
     }
     $button .= "<input type='submit' name='button' class='button' onclick=\"window.close();\" title='" . $app_strings['LBL_CANCEL_BUTTON_TITLE'] . "' accesskey='" . $app_strings['LBL_CANCEL_BUTTON_KEY'] . "' value='  " . $app_strings['LBL_CANCEL_BUTTON_LABEL'] . "  ' />\n";
     $button .= "</form>\n";
     $form = new XTemplate('modules/Campaigns/Popup_picker.html');
     $form->assign('MOD', $mod_strings);
     $form->assign('APP', $app_strings);
     $form->assign('THEME', $theme);
     $form->assign('MODULE_NAME', $currentModule);
     $form->assign('request_data', $request_data);
     $form->assign("TYPE_OPTIONS", get_select_options_with_id($app_list_strings['campaign_type_dom'], ""));
     ob_start();
     insert_popup_header($theme);
     $output_html .= ob_get_contents();
     ob_end_clean();
     $output_html .= get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE'], '', false);
     $form->parse('main.SearchHeader');
     $output_html .= $form->text('main.SearchHeader');
     // Reset the sections that are already in the page so that they do not print again later.
     $form->reset('main.SearchHeader');
     // create the listview
     $seed_bean = new Campaign();
     $ListView = new ListView();
     $ListView->show_export_button = false;
     $ListView->process_for_popups = true;
     $ListView->setXTemplate($form);
     $ListView->multi_select_popup = $multi_select;
     //FOR MULTI-SELECT
     $ListView->xTemplate->assign("TAG_TYPE", "A");
     //FOR MULTI-SELECT
     $ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE']);
     //FOR MULTI-SELECT
     $ListView->setHeaderText($button);
     //FOR MULTI-SELECT
     $ListView->setQuery($where, '', 'name', 'CAMPAIGN');
     $ListView->setModStrings($mod_strings);
     ob_start();
     //$output_html .= get_form_header($mod_strings['LBL_LIST_FORM_TITLE'], $button, false); //FOR MULTI-SELECT
     $ListView->processListView($seed_bean, 'main', 'CAMPAIGN');
     $output_html .= ob_get_contents();
     ob_end_clean();
     $output_html .= insert_popup_footer();
     return $output_html;
 }
Esempio n. 17
0
$button = "<form  action='index.php' method='post' name='form' id='form'>\n";
$button .= "<input type='hidden' name='module' value='WorkFlowAlertShells'>\n";
$button .= "<input type='hidden' name='module_tab' value='WorkFlow'>\n";
$button .= "<input type='hidden' name='workflow_id' value='{$focus->id}'>\n<input type='hidden' name='alert_name' value='{$focus->name}'>\n";
$button .= "<input type='hidden' name='return_module' value='" . $currentModule . "'>\n";
$button .= "<input type='hidden' name='return_action' value='" . $action . "'>\n";
$button .= "<input type='hidden' name='return_id' value='" . $focus->id . "'>\n";
$button .= "<input type='hidden' name='action' value='EditView';>\n";
require_once 'include/SugarSmarty/plugins/function.sugar_action_menu.php';
$button .= smarty_function_sugar_action_menu(array('id' => 'ACLRoles_EditView_action_menu', 'buttons' => $buttons), $xtpl);
//$button .= "<input title='".$current_module_strings['LBL_NEW_BUTTON_TITLE_ACTION']."' class='button' type='button' name='New' value='  ".$current_module_strings['LBL_NEW_BUTTON_LABEL_ACTION']."'";
//$button .= "LANGUAGE=javascript onclick='window.open(\"index.php?module=WorkFlowActionShells&action=CreateStep1&html=CreateStep1&form=ComponentView&form_submit=false&query=true&sugar_body_only=true&workflow_id=$focus->id\",\"new\",\"width=400,height=500,resizable=1,scrollbars=1\");'";
//$button .= ">\n";
$button .= "</form>";
$admin = Administration::getSettings();
$mail_server = trim($admin->settings['mail_smtpserver']);
if (empty($mail_server) && !empty($focus_alerts_list)) {
    echo "<BR><font color='red'><b>" . $mod_strings['LBL_LACK_OF_NOTIFICATIONS_ON'] . "</b></font><BR>";
}
//ALERT SUBPANEL
//$focus_alerts_list2 = array_merge($focus_alerts_list, $focus_actions_list);
$ListView = new ListView();
$header_text = '';
$ListView->initNewXTemplate('modules/WorkFlowAlertShells/SubPanelView.html', $current_module_strings);
$ListView->xTemplateAssign("WORKFLOW_ID", $focus->id);
$ListView->xTemplateAssign("RETURN_URL", "&return_module=" . $currentModule . "&return_action=DetailView&return_id={$_REQUEST['record']}");
$ListView->xTemplateAssign("EDIT_INLINE_PNG", SugarThemeRegistry::current()->getImage('edit_inline', 'align="absmiddle" border="0"', null, null, '.gif', $app_strings['LNK_EDIT']));
$ListView->xTemplateAssign("DELETE_INLINE_PNG", SugarThemeRegistry::current()->getImage('delete_inline', 'align="absmiddle" border="0"', null, null, '.gif', $app_strings['LNK_REMOVE']));
$ListView->setHeaderTitle($current_module_strings['LBL_MODULE_NAME_COMBO'] . $header_text);
$ListView->setHeaderText($button);
$ListView->processListView($focus_alerts_list, "main", "ALERT");
Esempio n. 18
0
    /**
     *
     */
    function process_page()
    {
        global $theme;
        global $mod_strings;
        global $app_strings;
        global $currentModule;
        global $app_list_strings, $sugar_version, $sugar_config;
        $output_html = "<script type=\"text/javascript\" src=\"" . getJSPath('include/javascript/sugar_3.js') . "\"></script>";
        $where = '';
        if (empty($_REQUEST[$currentModule . '_' . strtoupper($this->_popupMeta['moduleMain']) . '_offset'])) {
            $_POST[$currentModule . '_' . strtoupper($this->_popupMeta['moduleMain']) . '_offset'] = '';
        }
        if (empty($_REQUEST['saved_associated_data'])) {
            $_POST['saved_associated_data'] = '';
        }
        $where = $this->_get_where_clause();
        // CREATE STUFF
        if ($this->_create) {
            $formBase = new $this->_popupMeta['create']['formBaseClass']();
            if (isset($_REQUEST['doAction']) && $_REQUEST['doAction'] == 'save') {
                $formBase->handleSave('', false, true);
            }
            $lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
            $lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
            $lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
            // TODO: cleanup the construction of $addform
            $prefix = empty($this->_popupMeta['create']['getFormBodyParams'][0]) ? '' : $this->_popupMeta['create']['getFormBodyParams'][0];
            $mod = empty($this->_popupMeta['create']['getFormBodyParams'][1]) ? '' : $this->_popupMeta['create']['getFormBodyParams'][1];
            $formBody = empty($this->_popupMeta['create']['getFormBodyParams'][2]) ? '' : $this->_popupMeta['create']['getFormBodyParams'][2];
            $getFormMethod = empty($this->_popupMeta['create']['getFormMethod']) ? 'getFormBody' : $this->_popupMeta['create']['getFormMethod'];
            $formbody = $formBase->{$getFormMethod}($prefix, $mod, $formBody);
            $addform = '<table><tr><td nowrap="nowrap" valign="top">' . str_replace('<br>', '</td><td nowrap="nowrap" valign="top">&nbsp;', $formbody) . '</td></tr></table>' . '<input type="hidden" name="action" value="Popup" />';
            $formSave = <<<EOQ
\t\t\t<input type="hidden" name="create" value="true">
\t\t\t<input type="hidden" name="popup" value="true">
\t\t\t<input type="hidden" name="to_pdf" value="true">
\t\t\t<input type="hidden" name="return_module" value="{$currentModule}">
\t\t\t<input type="hidden" name="return_action" value="Popup">
\t\t\t<input type="submit" name="button" class="button" title="{$lbl_save_button_title}" value="  {$lbl_save_button_label}  " />
\t\t\t<input type="button" name="button" class="button" title="{$app_strings['LBL_CANCEL_BUTTON_TITLE']}" accesskey="{$app_strings['LBL_CANCEL_BUTTON_KEY']}" value="{$app_strings['LBL_CANCEL_BUTTON_LABEL']}" onclick="toggleDisplay('addform');" />
EOQ;
            // if metadata contains custom inputs for the quickcreate
            if (!empty($this->_popupMeta['customInput']) && is_array($this->_popupMeta['customInput'])) {
                foreach ($this->_popupMeta['customInput'] as $key => $value) {
                    $formSave .= '<input type="hidden" name="' . $key . '" value="' . $value . '">\\n';
                }
            }
            $createButtonTranslation = translate($this->_popupMeta['create']['createButton']);
            $createButton = <<<EOQ
\t\t\t<input type="button" id="showAdd" name="showAdd" class="button" value="{$createButtonTranslation}" onclick="toggleDisplay('addform');" />
EOQ;
            $addformheader = get_form_header($createButtonTranslation, $formSave, false);
        }
        // END CREATE STUFF
        // search request inputs
        $searchInputs = array();
        foreach ($this->_popupMeta['searchInputs'] as $input) {
            $searchInputs[$input] = empty($_REQUEST[$input]) ? '' : $_REQUEST[$input];
        }
        $request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data'];
        $hide_clear_button = empty($_REQUEST['hide_clear_button']) && empty($this->_hide_clear_button) ? false : true;
        $button = '<script>eval("var request_data = " + window.document.forms[\'popup_query_form\'].request_data.value);</script>';
        if (isset($_REQUEST['mass'])) {
            foreach (array_unique($_REQUEST['mass']) as $record) {
                $button .= "<input style='display: none' checked type='checkbox' name='mass[]' value='{$record}'>\n";
            }
        }
        //START:FOR MULTI-SELECT
        $multi_select = false;
        if (!empty($_REQUEST['mode']) && strtoupper($_REQUEST['mode']) == 'MULTISELECT') {
            $multi_select = true;
            $button .= "<input type='hidden' name='mode' value='MultiSelect'>";
            $button .= "<input type='button' name='button' class='button' onclick=\"send_back_selected('{$currentModule}',document.MassUpdate,'mass[]','" . $app_strings['ERR_NOTHING_SELECTED'] . "', request_data.field_to_name_array);\" title='" . $app_strings['LBL_SELECT_BUTTON_TITLE'] . "' value='  " . $app_strings['LBL_SELECT_BUTTON_LABEL'] . "  ' />\n";
        }
        //END:FOR MULTI-SELECT
        if (!$hide_clear_button) {
            $button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='" . $app_strings['LBL_CLEAR_BUTTON_TITLE'] . "' value='  " . $app_strings['LBL_CLEAR_BUTTON_LABEL'] . "  ' />\n";
        }
        $button .= "<input type='submit' name='button' class='button' onclick=\"window.close();\" title='" . $app_strings['LBL_CANCEL_BUTTON_TITLE'] . "' value='  " . $app_strings['LBL_CANCEL_BUTTON_LABEL'] . "  ' />\n";
        if (isset($this->_popupMeta['templateForm'])) {
            $form = new XTemplate($this->_popupMeta['templateForm']);
        } else {
            $form = new XTemplate('modules/' . $currentModule . '/Popup_picker.html');
        }
        $form->assign('MOD', $mod_strings);
        $form->assign('APP', $app_strings);
        $form->assign('THEME', $theme);
        $form->assign('MODULE_NAME', $currentModule);
        $form->assign('request_data', $request_data);
        // CREATE STUFF
        if ($this->_create) {
            $form->assign('CREATEBUTTON', $createButton);
            $form->assign('ADDFORMHEADER', $addformheader);
            $form->assign('ADDFORM', $addform);
        }
        // CREATE STUFF
        if (isset($this->_popupMeta['className'])) {
            $seed_bean = new $this->_popupMeta['className']();
        } else {
            $seed_bean = new $this->_popupMeta['moduleMain']();
        }
        // assign search inputs to xtemplates
        foreach (array_keys($searchInputs) as $key) {
            if (!empty($_REQUEST[$key]) && (isset($seed_bean->field_name_map[$key]['type']) && $seed_bean->field_name_map[$key]['type'] == 'bool')) {
                $form->assign(strtoupper($key), ' checked ');
            } else {
                $form->assign(strtoupper($key), $searchInputs[$key]);
            }
        }
        if ($this->_create) {
            $form->assign('CREATE', 'true');
        } else {
            $form->assign('CREATE', 'false');
        }
        // fill any doms
        if (isset($this->_popupMeta['selectDoms'])) {
            foreach ($this->_popupMeta['selectDoms'] as $key => $value) {
                $form->assign($key, get_select_options_with_id($app_list_strings[$value['dom']], $value['searchInput']));
            }
        }
        $form->assign('MULTI_SELECT', !empty($_REQUEST['mode']) ? strtoupper($_REQUEST['mode']) : '');
        ob_start();
        insert_popup_header($theme);
        $output_html .= ob_get_contents();
        ob_end_clean();
        $output_html .= get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE'], '', false);
        $form->parse('main.SearchHeader');
        $output_html .= $form->text('main.SearchHeader');
        // Reset the sections that are already in the page so that they do not print again later.
        $form->reset('main.SearchHeader');
        $ListView = new ListView();
        $ListView->show_select_menu = false;
        $ListView->show_delete_button = false;
        $ListView->show_export_button = false;
        $ListView->process_for_popups = true;
        $ListView->setXTemplate($form);
        $ListView->multi_select_popup = $multi_select;
        $ListView->xTemplate->assign('TAG_TYPE', 'A');
        if (isset($this->_popupMeta['listTitle'])) {
            $ListView->setHeaderTitle($this->_popupMeta['listTitle']);
        } else {
            $ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE']);
        }
        $ListView->setHeaderText($button);
        $ListView->setQuery($where, '', $this->_popupMeta['orderBy'], $this->_popupMeta['varName']);
        $ListView->setModStrings($mod_strings);
        ob_start();
        $ListView->processListView($seed_bean, 'main', $this->_popupMeta['varName']);
        $output_html .= ob_get_contents();
        ob_end_clean();
        $json = getJSONobj();
        // decode then encode to escape "'s
        $output_html .= "</form>\n\t\t<script type=\"text/javascript\">\n\t\tfunction save_checks(offset) {\n\t\t\tchecked_ids = Array();\n\t\t\tfor (i = 0; i < document.MassUpdate.elements.length; i++){\n\t\t\t\tif(document.MassUpdate.elements[i].name == 'mass[]' && document.MassUpdate.elements[i].checked) {\n\t\t\t\t\ttemp_string = '';\n\t\t\t\t\ttemp_string += '\"' + document.MassUpdate.elements[i].value + '\": {';\n\t\t\t\t\tfor(the_key in associated_javascript_data[document.MassUpdate.elements[i].value]) {\n\t\t\t\t\t\ttemp_string += '\"' + the_key + '\":\"' + associated_javascript_data[document.MassUpdate.elements[i].value][the_key] + '\",'; \n\t\t\t\t\t}\n\t\t\t\t\ttemp_string = temp_string.substring(0,temp_string.length - 1);\n\t\t\t\t\ttemp_string += '}';\n\t\t\t\t\tchecked_ids.push(temp_string);\n\t\t\t\t}\t\t\t\t \n\t\t\t}\n\t\t\tdocument.MassUpdate.saved_associated_data.value = escape('{' + checked_ids.join(',') + '}');\n\n\t\t\tdocument.MassUpdate.action.value = \"Popup\";\n\t\t\tdocument.MassUpdate.{$currentModule}" . '_' . strtoupper($this->_popupMeta['moduleMain']) . '_offset.value = offset;
			document.MassUpdate.submit();
		}
		// reassigned the saved data from the saved checks
		if(typeof(document.MassUpdate) != \'undefined\' && document.MassUpdate.saved_associated_data.value != \'\') {
			temp_array = ' . (!empty($_REQUEST['saved_associated_data']) ? $json->encode($json->decode(urldecode($_REQUEST['saved_associated_data']))) : '\'\'') . ';
			for(the_key in temp_array) {
				associated_javascript_data[the_key] = temp_array[the_key];
			}
		}

		// save checks across pages for multiselects 
		if(typeof(document.MassUpdate) != "undefined") {		
			checked_items = Array();
			inputs_array = document.MassUpdate.elements;
	
			for(wp = 0 ; wp < inputs_array.length; wp++) {
				if(inputs_array[wp].name == "mass[]" && inputs_array[wp].style.display == "none") {
					checked_items.push(inputs_array[wp].value);
				} 
			}
			for(i in checked_items) {
				for(wp = 0 ; wp < inputs_array.length; wp++) {
					if(inputs_array[wp].name == "mass[]" && inputs_array[wp].value == checked_items[i]) {
						inputs_array[wp].checked = true;
					}
				}
			}
		}
		</script>';
        $output_html .= insert_popup_footer();
        return $output_html;
    }