/**
 * Get getListActionCommType
 *
 * @param	array		$authentication		Array of authentication information
 * @return	mixed
 */
function getListActionCommType($authentication)
{
    global $db, $conf, $langs;
    dol_syslog("Function: getListActionCommType login=" . $authentication['login']);
    if ($authentication['entity']) {
        $conf->entity = $authentication['entity'];
    }
    // Init and check authentication
    $objectresp = array();
    $errorcode = '';
    $errorlabel = '';
    $error = 0;
    $fuser = check_authentication($authentication, $error, $errorcode, $errorlabel);
    if (!$error) {
        $fuser->getrights();
        if ($fuser->rights->agenda->myactions->read) {
            $cactioncomm = new CActionComm($db);
            $result = $cactioncomm->liste_array('', 'code');
            if ($result > 0) {
                $resultarray = array();
                foreach ($cactioncomm->liste_array as $code => $libeller) {
                    $resultarray[] = array('code' => $code, 'libelle' => $libeller);
                }
                $objectresp = array('result' => array('result_code' => 'OK', 'result_label' => ''), 'actioncommtypes' => $resultarray);
            } else {
                $error++;
                $errorcode = 'NOT_FOUND';
                $errorlabel = 'Object not found for id=' . $id . ' nor ref=' . $ref . ' nor ref_ext=' . $ref_ext;
            }
        } else {
            $error++;
            $errorcode = 'PERMISSION_DENIED';
            $errorlabel = 'User does not have permission for this request';
        }
    }
    if ($error) {
        $objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel));
    }
    return $objectresp;
}
 /**
  *  Output list of type of event
  *
  *  @param	string		$selected       Type pre-selected (can be 'manual', 'auto' or 'AC_xxx'
  *  @param  string		$htmlname       Nom champ formulaire
  *  @param	string		$excludetype	Type to exclude
  *  @param	string		$onlyautoornot	Group list by auto events or not: We keep only the 2 generic lines (AC_OTH and AC_OTH_AUTO)
  * 	@return	void
  */
 function select_type_actions($selected = '', $htmlname = 'actioncode', $excludetype = '', $onlyautoornot = 0)
 {
     global $langs, $user, $form;
     if (!is_object($form)) {
         $form = new Form($db);
     }
     require_once DOL_DOCUMENT_ROOT . '/comm/action/class/cactioncomm.class.php';
     require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php';
     $caction = new CActionComm($this->db);
     // Suggest a list with manual events or all auto events
     $arraylist = $caction->liste_array(1, 'code', $excludetype, $onlyautoornot);
     array_unshift($arraylist, ' ');
     // Add empty line at start
     //asort($arraylist);
     if ($selected == 'manual') {
         $selected = 'AC_OTH';
     }
     if ($selected == 'auto') {
         $selected = 'AC_OTH_AUTO';
     }
     print $form->selectarray($htmlname, $arraylist, $selected);
     if ($user->admin && empty($onlyautoornot)) {
         print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
     }
 }
Пример #3
0
 print $form->select_date($dateend, 'dateend', 0, 0, 1, '', 1, 0, 1);
 print '</td>';
 print '<td class="liste_titre"></td>';
 print '<td class="liste_titre"></td>';
 //print '<td class="liste_titre"></td>';
 print '<td class="liste_titre"></td>';
 print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
 print '<input type="image" class="liste_titre" name="button_removefilter" src="' . img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1) . '" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">';
 print '</td>';
 print "</tr>\n";
 $contactstatic = new Contact($db);
 $now = dol_now();
 $delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO * 24 * 60 * 60;
 require_once DOL_DOCUMENT_ROOT . '/comm/action/class/cactioncomm.class.php';
 $caction = new CActionComm($db);
 $arraylist = $caction->liste_array(1, 'code', '', empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : 0);
 $var = true;
 while ($i < min($num, $limit)) {
     $obj = $db->fetch_object($resql);
     // Discard auto action if option is on
     if (!empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO) && $obj->type_code == 'AC_OTH_AUTO') {
         $i++;
         continue;
     }
     $var = !$var;
     print "<tr " . $bc[$var] . ">";
     // Action (type)
     print '<td>';
     $actionstatic->id = $obj->id;
     $actionstatic->type_code = $obj->type_code;
     $actionstatic->type_label = $obj->type_label;
Пример #4
0
 /**
  *  Output html select list of type of event
  *
  *  @param	string		$selected       Type pre-selected (can be 'manual', 'auto' or 'AC_xxx')
  *  @param  string		$htmlname       Nom champ formulaire
  *  @param	string		$excludetype	A type to exclude ('systemauto', 'system', '')
  *  @param	string		$onlyautoornot	1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type
  *  @param	int		    $hideinfohelp	1=Do not show info help
  *  @param  int		    $multiselect    1=Allow multiselect of action type
  * 	@return	void
  */
 function select_type_actions($selected = '', $htmlname = 'actioncode', $excludetype = '', $onlyautoornot = 0, $hideinfohelp = 0, $multiselect = 0)
 {
     global $langs, $user, $form, $conf;
     if (!is_object($form)) {
         $form = new Form($db);
     }
     require_once DOL_DOCUMENT_ROOT . '/comm/action/class/cactioncomm.class.php';
     require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php';
     $caction = new CActionComm($this->db);
     // Suggest a list with manual events or all auto events
     $arraylist = $caction->liste_array(1, 'code', $excludetype, $onlyautoornot);
     array_unshift($arraylist, '&nbsp;');
     // Add empty line at start
     //asort($arraylist);
     if ($selected == 'manual') {
         $selected = 'AC_OTH';
     }
     if ($selected == 'auto') {
         $selected = 'AC_OTH_AUTO';
     }
     if (!empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO)) {
         unset($arraylist['AC_OTH_AUTO']);
     }
     if (!empty($multiselect)) {
         if (!is_array($selected) && !empty($selected)) {
             $selected = explode(',', $selected);
         }
         print $form->multiselectarray($htmlname, $arraylist, $selected, 0, 0, 'centpercent', 0, 0);
     } else {
         print $form->selectarray($htmlname, $arraylist, $selected);
     }
     if ($user->admin && empty($onlyautoornot) && empty($hideinfohelp)) {
         print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
     }
 }
Пример #5
0
 /**
  *  Output list of type of event
  *
  *  @param	string		$selected        Type pre-selectionne
  *  @param  string		$htmlname        Nom champ formulaire
  * 	@return	void
  */
 function select_type_actions($selected = '', $htmlname = 'actioncode', $active = 1, $idorcode = 'code', $type = '1,2')
 {
     global $langs, $user;
     require_once DOL_DOCUMENT_ROOT . "/comm/action/class/cactioncomm.class.php";
     require_once DOL_DOCUMENT_ROOT . "/core/class/html.form.class.php";
     $caction = new CActionComm($this->db);
     $form = new Form($this->db);
     $arraylist = array();
     $arraylist = $caction->liste_array($active, $idorcode, $type);
     $arraylist[0] = '&nbsp;';
     asort($arraylist);
     print $form->selectarray($htmlname, $arraylist, $selected);
     if ($user->admin) {
         print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"), 1);
     }
 }
    /**
     *    Output list of type of event
     *    @param      selected        Type pre-selectionne
     *    @param      htmlname        Nom champ formulaire
     */
    function select_type_actions($selected='',$htmlname='actioncode')
    {
        global $langs,$user;

        require_once(DOL_DOCUMENT_ROOT."/comm/action/class/cactioncomm.class.php");
        require_once(DOL_DOCUMENT_ROOT."/core/class/html.form.class.php");
        $caction=new CActionComm($this->db);
        $form=new Form($this->db);

        $arraylist=$caction->liste_array(1,'code');
        array_unshift($arraylist,'&nbsp;');     // Add empty line at start
        //asort($arraylist);

        print $form->selectarray($htmlname, $arraylist, $selected);
        if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
    }