예제 #1
0
 function _get_where_clause()
 {
     $where = '';
     $whereClauses = array();
     if (isset($_REQUEST['query'])) {
         foreach (array_keys($this->_popupMeta['whereClauses']) as $key) {
             append_where_clause($whereClauses, $key, $this->_popupMeta['whereClauses'][$key]);
             if ($key == 'name' && !empty($_REQUEST['name'])) {
                 $whereClauses[count($whereClauses) - 1] = "(" . $whereClauses[count($whereClauses) - 1] . " or teams.name_2 like '" . $GLOBALS['db']->quote($_REQUEST['name']) . "%')";
             }
         }
         $where = generate_where_statement($whereClauses);
     }
     if (!empty($this->_popupMeta['whereStatement'])) {
         if (!empty($where)) {
             $where .= ' AND ';
         }
         $where .= $this->_popupMeta['whereStatement'];
     }
     if (!empty($_REQUEST['custom_method'])) {
         if (!empty($_REQUEST['user_id'])) {
             $where .= !empty($where) ? ' and' : '';
             // deleted=0 added to fix CRYS-470.
             $where .= " teams.id in (select team_id from team_memberships where user_id = '" . $_REQUEST['user_id'] . "' and deleted=0)";
         } else {
             $where .= !empty($where) ? ' and teams.private = 0' : ' teams.private = 0';
         }
     }
     return $where;
 }
예제 #2
0
 public function testAppendWhereClauseDifferentColumnName()
 {
     $where = array();
     $_REQUEST['dog'] = 'yuck';
     append_where_clause($where, 'dog', 'cat');
     unset($_REQUEST['dog']);
     $this->assertEquals("cat like 'yuck%'", $where[0]);
 }
예제 #3
0
 function _get_where_clause()
 {
     $where = '';
     if (isset($_REQUEST['query'])) {
         $where_clauses = array();
         append_where_clause($where_clauses, "name", "acl_roles.name");
         $where = generate_where_statement($where_clauses);
     }
     return $where;
 }
예제 #4
0
 function _get_where_clause()
 {
     $where = '';
     if (isset($_REQUEST['query'])) {
         $where_clauses = array();
         append_where_clause($where_clauses, "name", "saved_reports.name");
         append_where_clause($where_clauses, "module_name", "saved_reports.module");
         $where = generate_where_statement($where_clauses);
     }
     return $where;
 }
예제 #5
0
 function _get_where_clause()
 {
     $where = '';
     if (isset($_REQUEST['query'])) {
         $where_clauses = array();
         append_where_clause($where_clauses, "name", "emails.name");
         append_where_clause($where_clauses, "contact_name", "contacts.last_name");
         $where = generate_where_statement($where_clauses);
     }
     return $where;
 }
예제 #6
0
 function _get_where_clause()
 {
     $where = '';
     if (isset($_REQUEST['query'])) {
         $where_clauses = array();
         append_where_clause($where_clauses, "name", "kbtags.tag_name");
         //append_where_clause($where_clauses, "last_name", "prospects.last_name");
         $where = generate_where_statement($where_clauses);
     }
     return $where;
 }
예제 #7
0
 function _get_where_clause()
 {
     $where = '';
     if (isset($_REQUEST['query'])) {
         $where_clauses = array();
         append_where_clause($where_clauses, "name", "timeperiods.name");
         append_where_clause($where_clauses, "start_date", "timeperiods.start_date");
         append_where_clause($where_clauses, "end_date", "timeperiods.end_date");
         $where = generate_where_statement($where_clauses);
     }
     return $where;
 }
예제 #8
0
 function _get_where_clause()
 {
     $where = '';
     if (isset($_REQUEST['query'])) {
         $where_clauses = array();
         append_where_clause($where_clauses, "first_name", "users.first_name");
         append_where_clause($where_clauses, "last_name", "users.last_name");
         append_where_clause($where_clauses, "user_name", "users.user_name");
         $where = generate_where_statement($where_clauses);
     }
     return $where;
 }
예제 #9
0
 function _get_where_clause()
 {
     $where = '';
     if (isset($_REQUEST['query'])) {
         $where_clauses = array();
         append_where_clause($where_clauses, "document_name", "documents.document_name");
         append_where_clause($where_clauses, "category_id", "documents.category_id");
         append_where_clause($where_clauses, "subcategory_id", "documents.subcategory_id");
         append_where_clause($where_clauses, "template_type", "documents.template_type");
         append_where_clause($where_clauses, "is_template", "documents.is_template");
         $where = generate_where_statement($where_clauses);
     }
     return $where;
 }
예제 #10
0
 function _get_where_clause()
 {
     $where = '';
     if (isset($_REQUEST['query'])) {
         $where_clauses = array();
         append_where_clause($where_clauses, "target_id", "campaign_log.target_id");
         //append_where_clause($where_clauses, "last_name", "prospects.last_name");
         $where = generate_where_statement($where_clauses);
         if (!empty($where)) {
             $where .= " AND ";
         }
         $where .= " activity_type='targeted'";
     }
     return $where;
 }
예제 #11
0
	function _get_where_clause()
	{
		$where = '';
		if(isset($_REQUEST['query']))
		{
			$where_clauses = array();
			append_where_clause($where_clauses, "first_name", "users.first_name");
			append_where_clause($where_clauses, "last_name", "users.last_name");
			append_where_clause($where_clauses, "user_name", "users.user_name");
		
			$where = generate_where_statement($where_clauses);
		}
		$GLOBALS['log']->debug("module.employees.popup_picker,  where: " . $where);
		
		return $where;
	}
예제 #12
0
 function _get_where_clause()
 {
     $where = '';
     $whereClauses = array();
     if (isset($_REQUEST['query'])) {
         foreach (array_keys($this->_popupMeta['whereClauses']) as $key) {
             append_where_clause($whereClauses, $key, $this->_popupMeta['whereClauses'][$key]);
         }
         $where = generate_where_statement($whereClauses);
     }
     if (!empty($this->_popupMeta['whereStatement'])) {
         if (!empty($where)) {
             $where .= ' AND ';
         }
         $where .= $this->_popupMeta['whereStatement'];
     }
     return $where;
 }
예제 #13
0
 ********************************************************************************/
global $theme;
global $app_strings;
global $app_list_strings;
global $mod_strings;
global $urlPrefix;
global $currentModule;
$current_module_strings = return_module_language($current_language, 'Users');
$seed_object = BeanFactory::getBean('Users');
$where = "";
if (isset($_REQUEST['query'])) {
    $search_fields = array("first_name", "last_name", "user_name");
    $where_clauses = array();
    append_where_clause($where_clauses, "first_name", "users.first_name");
    append_where_clause($where_clauses, "last_name", "users.last_name");
    append_where_clause($where_clauses, "user_name", "users.user_name");
    $where = generate_where_statement($where_clauses);
}
////////////////////////////////////////////////////////
// Start the output
////////////////////////////////////////////////////////
$from_form = empty($_REQUEST['form']) ? '' : $_REQUEST['form'];
$form_submit = !empty($_REQUEST['form_submit']) && $_REQUEST['form_submit'] != 'false' ? true : false;
$parent_id = empty($_REQUEST['parent_id']) ? 'parent_id' : $_REQUEST['parent_id'];
$parent_name = empty($_REQUEST['parent_name']) ? 'parent_name' : $_REQUEST['parent_name'];
$button = "<form action='index.php' method='post' name='form' id='form'>\n";
$button .= "<input type='hidden' name='record' value='" . $_REQUEST['record'] . "'>\n";
$button .= "<input type='hidden' name='module' value='Roles'>\n";
$button .= "<input type='hidden' name='action' value='SaveUserRelationship'>\n";
$button .= "<input type='submit' name='button' class='button' title='" . $current_module_strings['LBL_SELECT_CHECKED_BUTTON_TITLE'] . "' value='  " . $current_module_strings['LBL_SELECT_CHECKED_BUTTON_LABEL'] . "  ' />\n";
$button .= "<input type='submit' name='button' class='button' title='" . $app_strings['LBL_DONE_BUTTON_TITLE'] . "' onclick=\"window.close();\" value='  " . $app_strings['LBL_DONE_BUTTON_LABEL'] . "  ' />\n";
예제 #14
0
 */
/*********************************************************************************
 * Description:
 ********************************************************************************/
global $theme;
global $app_strings;
global $app_list_strings;
global $mod_strings;
global $urlPrefix;
global $currentModule;
$seed_object = BeanFactory::getBean('DataSets');
$where = "";
if (isset($_REQUEST['query'])) {
    $search_fields = array("name", "description");
    $where_clauses = array();
    append_where_clause($where_clauses, "name", "data_sets.name");
    $where = generate_where_statement($where_clauses);
    $GLOBALS['log']->info($where);
}
////////////////////////////////////////////////////////
// Start the output
////////////////////////////////////////////////////////
if (!isset($_REQUEST['html'])) {
    $form = new XTemplate('modules/DataSets/Popup_picker.html');
    $GLOBALS['log']->debug("using file modules/DataSets/Popup_picker.html");
} else {
    $GLOBALS['log']->debug("_REQUEST['html'] is " . $_REQUEST['html']);
    $form = new XTemplate('modules/DataSets/' . $_REQUEST['html'] . '.html');
    $GLOBALS['log']->debug("using file modules/DataSets/" . $_REQUEST['html'] . '.html');
}
$form->assign("MOD", $mod_strings);
예제 #15
0
require_once 'include/utils.php';
require_once 'include/ListView/ListView.php';
global $app_strings;
global $app_list_strings;
global $mod_strings;
global $urlPrefix;
global $currentModule;
$seed_object = new Contact();
$where = "";
if (isset($_REQUEST['query'])) {
    $search_fields = array("first_name", "last_name", "account_name");
    $where_clauses = array();
    append_where_clause($where_clauses, "first_name", "contacts.first_name");
    append_where_clause($where_clauses, "last_name", "contacts.last_name");
    append_where_clause($where_clauses, "account_name", "accounts.name");
    append_where_clause($where_clauses, "account_id", "accounts.id");
    $where = generate_where_statement($where_clauses);
    $GLOBALS['log']->info($where);
}
$image_path = 'themes/' . $theme . '/images/';
////////////////////////////////////////////////////////
// Start the output
////////////////////////////////////////////////////////
if (!isset($_REQUEST['html'])) {
    $form = new XTemplate('modules/Contacts/Popup_picker_old.html');
    $GLOBALS['log']->debug("using file modules/Contacts/Popup_picker_old.html");
} else {
    $GLOBALS['log']->debug("_REQUEST['html'] is " . $_REQUEST['html']);
    $form = new XTemplate('modules/Contacts/' . $_REQUEST['html'] . '.html');
    $GLOBALS['log']->debug("using file modules/Contacts/" . $_REQUEST['html'] . '.html');
}
예제 #16
0
/*********************************************************************************
 * Description:
 ********************************************************************************/
global $theme;
global $app_strings;
global $app_list_strings;
global $mod_strings;
global $urlPrefix;
global $currentModule;
$seed_object = BeanFactory::getBean('DataSets');
$where = "";
if (isset($_REQUEST['query'])) {
    $search_fields = array("name", "description");
    $where_clauses = array();
    append_where_clause($where_clauses, "name", "data_sets.name");
    append_where_clause($where_clauses, "description", "data_sets.description");
    $where = generate_where_statement($where_clauses);
    $GLOBALS['log']->info($where);
}
////////////////////////////////////////////////////////
// Start the output
////////////////////////////////////////////////////////
if (!isset($_REQUEST['html'])) {
    $form = new XTemplate('modules/DataSets/Popup_picker.html');
    $GLOBALS['log']->debug("using file modules/DataSets/Popup_picker.html");
} else {
    $_REQUEST['html'] = preg_replace("/[^a-zA-Z0-9_]/", "", $_REQUEST['html']);
    $GLOBALS['log']->debug("_REQUEST['html'] is " . $_REQUEST['html']);
    $form = new XTemplate('modules/DataSets/' . $_REQUEST['html'] . '.html');
    $GLOBALS['log']->debug("using file modules/DataSets/" . $_REQUEST['html'] . '.html');
}
예제 #17
0
require_once 'XTemplate/xtpl.php';
require_once 'include/utils.php';
require_once 'include/ListView/ListView.php';
global $app_strings;
global $app_list_strings;
global $mod_strings;
global $urlPrefix;
global $currentModule;
$seed_object = new Products();
$where = "";
if (isset($_REQUEST['query'])) {
    $search_fields = array("pnum", "name", "category");
    $where_clauses = array();
    append_where_clause($where_clauses, "pnum", "products.pnum");
    append_where_clause($where_clauses, "name", "products.name");
    append_where_clause($where_clauses, "category", "products.category");
    $where = generate_where_statement($where_clauses);
    $GLOBALS['log']->info($where);
}
$image_path = 'themes/' . $theme . '/images/';
////////////////////////////////////////////////////////
// Start the output
////////////////////////////////////////////////////////
if (isset($_REQUEST['html']) && $_REQUEST['html'] == 'quotes') {
    $form = new XTemplate('modules/Products/Popup_cust.html');
    $GLOBALS['log']->debug("using file modules/Products/Popup_cust.html");
    $form->assign("MOD", $mod_strings);
    $form->assign("APP", $app_strings);
    // the form key is required
    if (!isset($_REQUEST['form'])) {
        sugar_die("Missing 'form' parameter");
예제 #18
0
require_once 'log4php/LoggerManager.php';
require_once 'XTemplate/xtpl.php';
require_once 'include/utils.php';
require_once 'include/ListView/ListView.php';
global $app_strings;
global $app_list_strings;
global $mod_strings;
global $urlPrefix;
global $currentModule;
$seed_object = new Paper();
$where = "";
if (isset($_REQUEST['query'])) {
    $search_fields = array("pname", "fname");
    $where_clauses = array();
    append_where_clause($where_clauses, "pname", "paper.pname");
    append_where_clause($where_clauses, "fname", "paper.fname");
    $where = generate_where_statement($where_clauses);
    $GLOBALS['log']->info($where);
}
$image_path = 'themes/' . $theme . '/images/';
////////////////////////////////////////////////////////
// Start the output
////////////////////////////////////////////////////////
if (isset($_REQUEST['html']) && $_REQUEST['html'] == 'paper') {
    $form = new XTemplate('modules/Paper/Popup_cust.html');
    $GLOBALS['log']->debug("using file modules/Paper/Popup_cust.html");
    $form->assign("MOD", $mod_strings);
    $form->assign("APP", $app_strings);
    // the form key is required
    if (!isset($_REQUEST['form'])) {
        sugar_die("Missing 'form' parameter");
예제 #19
0
require_once 'XTemplate/xtpl.php';
require_once 'include/utils.php';
require_once 'include/ListView/ListView.php';
global $app_strings;
global $app_list_strings;
global $mod_strings;
global $urlPrefix;
global $currentModule;
$seed_object = new ClientOrders();
$where = "";
if (isset($_REQUEST['query'])) {
    $search_fields = array("number", "name", "category");
    $where_clauses = array();
    append_where_clause($where_clauses, "number", "clientorders.number");
    append_where_clause($where_clauses, "name", "clientorders.name");
    append_where_clause($where_clauses, "category", "clientorders.category");
    $where = generate_where_statement($where_clauses);
    $GLOBALS['log']->info($where);
}
$image_path = 'themes/' . $theme . '/images/';
////////////////////////////////////////////////////////
// Start the output
////////////////////////////////////////////////////////
if (isset($_REQUEST['html']) && $_REQUEST['html'] == 'quotes') {
    $form = new XTemplate('modules/ClientOrders/Popup_cust.html');
    $GLOBALS['log']->debug("using file modules/ClientOrders/Popup_cust.html");
    $form->assign("MOD", $mod_strings);
    $form->assign("APP", $app_strings);
    // the form key is required
    if (!isset($_REQUEST['form'])) {
        sugar_die("Missing 'form' parameter");
예제 #20
0
require_once 'include/utils.php';
require_once 'include/ListView/ListView.php';
global $app_strings;
global $app_list_strings;
global $mod_strings;
global $urlPrefix;
global $currentModule;
$seed_object = new Supplier();
require_once 'modules/Prices/Price.php';
$price = new Price();
$where = "";
if (isset($_REQUEST['query'])) {
    $search_fields = array("num", "name");
    $where_clauses = array();
    append_where_clause($where_clauses, "num", "supplier.num");
    append_where_clause($where_clauses, "name", "supplier.name");
    $where = generate_where_statement($where_clauses);
    $GLOBALS['log']->info($where);
}
$image_path = 'themes/' . $theme . '/images/';
////////////////////////////////////////////////////////
// Start the output
////////////////////////////////////////////////////////
if (isset($_REQUEST['html']) && $_REQUEST['html'] == 'supplier') {
    $form = new XTemplate('modules/Suppliers/Popup_cust.html');
    $GLOBALS['log']->debug("using file modules/Suppliers/Popup_cust.html");
    $form->assign("MOD", $mod_strings);
    $form->assign("APP", $app_strings);
    // the form key is required
    if (!isset($_REQUEST['form'])) {
        sugar_die("Missing 'form' parameter");
 function _get_where_clause()
 {
     $where = '';
     $whereClauses = array();
     if (isset($_REQUEST['query'])) {
         //Edit Peter Peshev
         if (isset($_REQUEST['filter0']) && isset($_REQUEST['filtervalue0'])) {
             $keys = array_keys($_GET);
             for ($i = 0; $i < count($keys); $i++) {
                 if (substr_count($keys[$i], "filter") > 0) {
                     $index = substr($keys[$i], -1, 1);
                     if (isset($_GET["filter" . $index]) && isset($_GET["filtervalue" . $index])) {
                         if (empty($_GET["filtervalue" . $index])) {
                             return $where = '';
                         }
                         $filter = $_GET["filter" . $index];
                         $filtervalue = $_GET["filtervalue" . $index];
                         if (empty($where)) {
                             if ($filtervalue == 'NULL') {
                                 $where = $where . " {$filter} IS NULL ";
                             } else {
                                 $where = $where . " {$filter}='{$filtervalue}' ";
                             }
                         } else {
                             if ($filtervalue == 'NULL') {
                                 $where = $where . " AND {$filter} IS NULL ";
                             } else {
                                 $where = $where . " AND {$filter}='{$filtervalue}' ";
                             }
                         }
                     }
                 }
             }
         } else {
             foreach (array_keys($this->_popupMeta['whereClauses']) as $key) {
                 append_where_clause($whereClauses, $key, $this->_popupMeta['whereClauses'][$key]);
             }
             $where = generate_where_statement($whereClauses);
         }
     }
     return $where;
 }
예제 #22
0
global $mod_strings;
global $urlPrefix;
global $currentModule;
$seed_object = new Material();
/* require_once('modules/Prices/Price.php');
$price = new Price();*/
$where = "";
//$where2 = "";
if (isset($_REQUEST['query'])) {
    $search_fields = array("num", "name", "category", "measure");
    $where_clauses = array();
    $where_clauses2 = array();
    append_where_clause($where_clauses, "num", "materials.num");
    append_where_clause($where_clauses, "name", "materials.name");
    append_where_clause($where_clauses, "category", "materials.category");
    append_where_clause($where_clauses, "measure", "materials.measure");
    //append_where_clause($where_clauses2, "price", "prices.price");
    $where = generate_where_statement($where_clauses);
    //$where2 = generate_where_statement($where_clauses2);
    $GLOBALS['log']->info($where);
}
$image_path = 'themes/' . $theme . '/images/';
////////////////////////////////////////////////////////
// Start the output
////////////////////////////////////////////////////////
if (isset($_REQUEST['html'])) {
    if ($_REQUEST['html'] == 'supplies' || $_REQUEST['html'] == 'purchaseorders') {
        $form = new XTemplate('modules/Materials/Popup_cust.html');
        $GLOBALS['log']->debug("using file modules/Materials/Popup_cust.html");
        $form->assign("MOD", $mod_strings);
        $form->assign("APP", $app_strings);
예제 #23
0
require_once 'XTemplate/xtpl.php';
require_once 'include/utils.php';
require_once 'include/ListView/ListView.php';
global $app_strings;
global $app_list_strings;
global $mod_strings;
global $urlPrefix;
global $currentModule;
$seed_object = new Estimates();
$where = "";
if (isset($_REQUEST['query'])) {
    $search_fields = array("number", "name", "category");
    $where_clauses = array();
    append_where_clause($where_clauses, "number", "estimates.number");
    append_where_clause($where_clauses, "name", "estimates.name");
    append_where_clause($where_clauses, "category", "estimates.category");
    $where = generate_where_statement($where_clauses);
    $GLOBALS['log']->info($where);
}
$image_path = 'themes/' . $theme . '/images/';
////////////////////////////////////////////////////////
// Start the output
////////////////////////////////////////////////////////
if (isset($_REQUEST['html']) && $_REQUEST['html'] == 'quotes') {
    $form = new XTemplate('modules/Estimates/Popup_cust.html');
    $GLOBALS['log']->debug("using file modules/Estimates/Popup_cust.html");
    $form->assign("MOD", $mod_strings);
    $form->assign("APP", $app_strings);
    // the form key is required
    if (!isset($_REQUEST['form'])) {
        sugar_die("Missing 'form' parameter");
예제 #24
0
require_once 'themes/' . $theme . '/layout_utils.php';
require_once 'log4php/LoggerManager.php';
require_once 'XTemplate/xtpl.php';
require_once 'include/utils.php';
require_once 'include/ListView/ListView.php';
global $app_strings;
global $app_list_strings;
global $mod_strings;
global $urlPrefix;
global $currentModule;
$seed_object = new Press();
$where = "";
if (isset($_REQUEST['query'])) {
    $search_fields = array("name");
    $where_clauses = array();
    append_where_clause($where_clauses, "name", "press.name");
    $where = generate_where_statement($where_clauses);
    $GLOBALS['log']->info($where);
    $image_path = 'themes/' . $theme . '/images/';
}
////////////////////////////////////////////////////////
// Start the output
////////////////////////////////////////////////////////
if (isset($_REQUEST['html']) && $_REQUEST['html'] == 'layout') {
    $form = new XTemplate('modules/Layout/Popup_cust.html');
    $GLOBALS['log']->debug("using file modules/Layout/Popup_cust.html");
    $form->assign("MOD", $mod_strings);
    $form->assign("APP", $app_strings);
    // the form key is required
    if (!isset($_REQUEST['form'])) {
        sugar_die("Missing 'form' parameter");